diff --git a/apps/web-antd/src/views/ops/work-order/index.vue b/apps/web-antd/src/views/ops/work-order/index.vue index b35d73f12..29a9f4190 100644 --- a/apps/web-antd/src/views/ops/work-order/index.vue +++ b/apps/web-antd/src/views/ops/work-order/index.vue @@ -2,7 +2,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { OpsOrderCenterApi } from '#/api/ops/order-center'; -import { nextTick, onMounted, ref } from 'vue'; +import { nextTick, onActivated, onMounted, ref } from 'vue'; import { useRouter } from 'vue-router'; import { Page, useVbenModal } from '@vben/common-ui'; @@ -55,7 +55,6 @@ const tabCounts = ref>({ ALL: 0, PENDING: 0, IN_PROGRESS: 0, - PAUSED: 0, COMPLETED: 0, CANCELLED: 0, }); @@ -282,8 +281,18 @@ const [Grid, gridApi] = useVbenVxeGrid({ } as VxeTableGridOptions, }); +let isFirstActivate = true; onMounted(() => { - // 默认使用卡片视图 + handleRefresh(); +}); + +onActivated(() => { + // 首次 activated 与 onMounted 同时触发,跳过以避免重复请求 + if (isFirstActivate) { + isFirstActivate = false; + return; + } + handleRefresh(); });