feat: 首页tab默认显示Job
This commit is contained in:
parent
9996e16e16
commit
b905629599
@ -91,6 +91,35 @@ interface CardData {
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
const cardData = computed<CardData[]>(() => [
|
||||
{
|
||||
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<CardData[]>(() => [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
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'),
|
||||
|
@ -17,7 +17,7 @@ interface Props {
|
||||
|
||||
defineProps<Props>();
|
||||
|
||||
const type = ref(0);
|
||||
const type = ref(1);
|
||||
const appStore = useAppStore();
|
||||
const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
||||
const data = ref<Api.Dashboard.DashboardLine>();
|
||||
@ -25,7 +25,8 @@ const groupOptions = ref();
|
||||
const tabParams = ref<Api.Dashboard.DashboardLineParams>({
|
||||
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();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Loading…
Reference in New Issue
Block a user