diff --git a/src/hooks/common/router.ts b/src/hooks/common/router.ts index 21fe3db..6f1ce1e 100644 --- a/src/hooks/common/router.ts +++ b/src/hooks/common/router.ts @@ -21,7 +21,7 @@ export function useRouterPush(inSetup = true) { interface RouterPushOptions { query?: Record; params?: Record; - state?: Record; + state?: Record; } async function routerPushByKey(key: RouteKey, options?: RouterPushOptions) { diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index b65346a..e494e5e 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -1162,7 +1162,7 @@ declare namespace Api { /** retryLog search params */ type RetryLogSearchParams = CommonType.RecordNullable< - Pick & + Pick & CommonSearchParams >; diff --git a/src/views/home/modules/card-data.vue b/src/views/home/modules/card-data.vue index a560d9e..fe1e282 100644 --- a/src/views/home/modules/card-data.vue +++ b/src/views/home/modules/card-data.vue @@ -108,22 +108,22 @@ const cardData = computed(() => [ { label: $t('common.success'), value: props.modelValue?.jobTask.successNum ?? 0, - click: () => routerPushByKey('job_batch', { state: { taskBatchStatus: '3' } }) + click: () => routerPushByKey('job_batch', { state: { taskBatchStatus: 3 } }) }, { label: $t('common.fail'), value: props.modelValue?.jobTask.failNum ?? 0, - click: () => routerPushByKey('job_batch', { state: { taskBatchStatus: '4' } }) + click: () => routerPushByKey('job_batch', { state: { taskBatchStatus: 4 } }) }, { label: $t('common.stop'), value: props.modelValue?.jobTask.stopNum ?? 0, - click: () => routerPushByKey('job_batch', { state: { taskBatchStatus: '5' } }) + click: () => routerPushByKey('job_batch', { state: { taskBatchStatus: 5 } }) }, { label: $t('common.cancel'), value: props.modelValue?.jobTask.cancelNum ?? 0, - click: () => routerPushByKey('job_batch', { state: { taskBatchStatus: '6' } }) + click: () => routerPushByKey('job_batch', { state: { taskBatchStatus: 6 } }) } ] }, @@ -142,19 +142,23 @@ const cardData = computed(() => [ bottom: [ { label: $t('common.success'), - value: props.modelValue?.retryTask.finishNum ?? 0 + value: props.modelValue?.retryTask.finishNum ?? 0, + click: () => routerPushByKey('retry_log', { state: { retryStatus: 1 } }) }, { label: $t('common.running'), - value: props.modelValue?.retryTask.runningNum ?? 0 + value: props.modelValue?.retryTask.runningNum ?? 0, + click: () => routerPushByKey('retry_log', { state: { retryStatus: 0 } }) }, { label: $t('page.manage.retryTask.status.maxRetryTimes'), - value: props.modelValue?.retryTask.maxCountNum ?? 0 + value: props.modelValue?.retryTask.maxCountNum ?? 0, + click: () => routerPushByKey('retry_log', { state: { retryStatus: 2 } }) }, { label: $t('page.manage.retryTask.status.pauseRetry'), - value: props.modelValue?.retryTask.suspendNum ?? 0 + value: props.modelValue?.retryTask.suspendNum ?? 0, + click: () => routerPushByKey('retry_log', { state: { retryStatus: 3 } }) } ] }, @@ -173,19 +177,23 @@ const cardData = computed(() => [ bottom: [ { label: $t('common.success'), - value: props.modelValue?.workFlowTask.successNum ?? 0 + value: props.modelValue?.workFlowTask.successNum ?? 0, + click: () => routerPushByKey('workflow_batch', { state: { taskBatchStatus: 3 } }) }, { label: $t('common.fail'), - value: props.modelValue?.workFlowTask.failNum ?? 0 + value: props.modelValue?.workFlowTask.failNum ?? 0, + click: () => routerPushByKey('workflow_batch', { state: { taskBatchStatus: 4 } }) }, { label: $t('common.stop'), - value: props.modelValue?.workFlowTask.stopNum ?? 0 + value: props.modelValue?.workFlowTask.stopNum ?? 0, + click: () => routerPushByKey('workflow_batch', { state: { taskBatchStatus: 5 } }) }, { label: $t('common.cancel'), - value: props.modelValue?.workFlowTask.cancelNum ?? 0 + value: props.modelValue?.workFlowTask.cancelNum ?? 0, + click: () => routerPushByKey('workflow_batch', { state: { taskBatchStatus: 6 } }) } ] }, @@ -204,11 +212,13 @@ const cardData = computed(() => [ bottom: [ { label: $t('page.manage.machine.type.client'), - value: props.modelValue?.onLineService.clientTotal ?? 0 + value: props.modelValue?.onLineService.clientTotal ?? 0, + click: () => routerPushByKey('pods') }, { label: $t('page.manage.machine.type.server'), - value: props.modelValue?.onLineService.serverTotal ?? 0 + value: props.modelValue?.onLineService.serverTotal ?? 0, + click: () => routerPushByKey('pods') } ] } @@ -283,9 +293,9 @@ function getGradientColor(color: CardData['color']) { @@ -317,4 +327,15 @@ function getGradientColor(color: CardData['color']) { box-shadow: var(--n-box-shadow); border-radius: 8px; } + +.home-card-footer:hover { + color: #fff; + font-size: 14px; + transition: all 0.25s ease-in; +} + +.home-card-footer:hover { + color: #1366ff !important; + font-size: 15px; +} diff --git a/src/views/job/batch/index.vue b/src/views/job/batch/index.vue index 43cf6dc..ead9755 100644 --- a/src/views/job/batch/index.vue +++ b/src/views/job/batch/index.vue @@ -20,6 +20,8 @@ const detailData = ref(); /** 详情页可见状态 */ const { bool: detailVisible, setTrue: openDetail } = useBoolean(false); +const taskBatchStatus = history.state.taskBatchStatus; + const { columnChecks, columns, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({ apiFn: fetchGetJobBatchList, apiParams: { @@ -27,7 +29,7 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP size: 10, groupName: null, jobName: null, - taskBatchStatus: null + taskBatchStatus }, columns: () => [ { diff --git a/src/views/job/batch/modules/job-batch-search.vue b/src/views/job/batch/modules/job-batch-search.vue index ea29c97..2df1836 100644 --- a/src/views/job/batch/modules/job-batch-search.vue +++ b/src/views/job/batch/modules/job-batch-search.vue @@ -23,12 +23,6 @@ function reset() { function search() { emit('search'); } - -const taskBatchStatus = history.state.taskBatchStatus; - -if (taskBatchStatus) { - model.value.taskBatchStatus = Number(taskBatchStatus) as Api.Common.TaskBatchStatus; -}