From b90562959963916bbe5cf06e1919a5fb092908d3 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Wed, 22 May 2024 14:19:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5tab=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=98=BE=E7=A4=BAJob?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/modules/card-data.vue | 58 ++++++++++++++-------------- src/views/home/modules/retry-tab.vue | 20 +++++----- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/views/home/modules/card-data.vue b/src/views/home/modules/card-data.vue index d42573b..0d06815 100644 --- a/src/views/home/modules/card-data.vue +++ b/src/views/home/modules/card-data.vue @@ -91,6 +91,35 @@ interface CardData { // eslint-disable-next-line complexity const cardData = computed(() => [ + { + key: 'jobTask', + title: $t('page.home.jobTask'), + tip: $t('page.home.jobTaskTip'), + value: props.modelValue?.jobTask.totalNum ?? 0, + color: { + start: '#f5b386', + end: '#FFD6BA' + }, + icon: 'ant-design:profile-outlined', + bottom: [ + { + label: $t('common.success'), + value: props.modelValue?.jobTask.successNum ?? 0 + }, + { + label: $t('common.fail'), + value: props.modelValue?.jobTask.failNum ?? 0 + }, + { + label: $t('common.stop'), + value: props.modelValue?.jobTask.stopNum ?? 0 + }, + { + label: $t('common.cancel'), + value: props.modelValue?.jobTask.cancelNum ?? 0 + } + ] + }, { key: 'retryTask', title: $t('page.home.retryTask'), @@ -121,35 +150,6 @@ const cardData = computed(() => [ } ] }, - { - key: 'jobTask', - title: $t('page.home.jobTask'), - tip: $t('page.home.jobTaskTip'), - value: props.modelValue?.jobTask.totalNum ?? 0, - color: { - start: '#f5b386', - end: '#FFD6BA' - }, - icon: 'ant-design:profile-outlined', - bottom: [ - { - label: $t('common.success'), - value: props.modelValue?.jobTask.successNum ?? 0 - }, - { - label: $t('common.fail'), - value: props.modelValue?.jobTask.failNum ?? 0 - }, - { - label: $t('common.stop'), - value: props.modelValue?.jobTask.stopNum ?? 0 - }, - { - label: $t('common.cancel'), - value: props.modelValue?.jobTask.cancelNum ?? 0 - } - ] - }, { key: 'workflow', title: $t('page.home.workflow'), diff --git a/src/views/home/modules/retry-tab.vue b/src/views/home/modules/retry-tab.vue index 6d24160..4301aa4 100644 --- a/src/views/home/modules/retry-tab.vue +++ b/src/views/home/modules/retry-tab.vue @@ -17,7 +17,7 @@ interface Props { defineProps(); -const type = ref(0); +const type = ref(1); const appStore = useAppStore(); const gap = computed(() => (appStore.isMobile ? 0 : 16)); const data = ref(); @@ -25,7 +25,8 @@ const groupOptions = ref(); const tabParams = ref({ type: 'WEEK', page: 1, - size: 6 + size: 6, + mode: 'JOB' }); const dateRange = ref<[number, number] | null>(); const formattedValue = ref<[string, string] | null>( @@ -41,8 +42,6 @@ const getData = async () => { } }; -getData(); - const getGroupNames = async () => { const { data: groupNames, error } = await fetchAllGroupName(); @@ -53,8 +52,6 @@ const getGroupNames = async () => { } }; -getGroupNames(); - watch( () => tabParams.value, () => { @@ -108,14 +105,14 @@ const pagination = ref({ }); const createPanels = () => [ - { - name: 'retryTask', - tab: $t('page.home.retryTask') - }, { name: 'jobTask', tab: $t('page.home.jobTask') }, + { + name: 'retryTask', + tab: $t('page.home.retryTask') + }, { name: 'workflow', tab: $t('page.home.workflow') @@ -152,6 +149,9 @@ watch( columns.value = createColumns(); } ); + +getData(); +getGroupNames();