diff --git a/pages/index/index.vue b/pages/index/index.vue index 7eefeb5..100f4f1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -66,8 +66,8 @@ 巡检任务 currentGroup.value.useWalkText); // ========== 一级Tab:养护/巡检/工单 ========= // 默认期望打开 maintain,watch权限自动修正 -const mainTab = ref<'maintain' | 'inspect' | 'workorder'>('maintain'); +const mainTab = ref<'maintain' | 'inspection' | 'workorder'>('maintain'); // ✅ 修复:用户角色数组 const userRoles = computed(() => userStore.userInfo?.roles || []); @@ -215,9 +215,9 @@ const showMainTabXj = computed(() => { // 获取可见tab数组,用于自动选中 const availableTabList = computed(() => { - const list: Array<'maintain' | 'inspect' | 'workorder'> = []; + const list: Array<'maintain' | 'inspection' | 'workorder'> = []; if (showMainTabYh.value) list.push('maintain'); - if (showMainTabXj.value) list.push('inspect'); + if (showMainTabXj.value) list.push('inspection'); list.push('workorder'); return list; }); @@ -233,7 +233,7 @@ watch([showMainTabYh, showMainTabXj], () => { }, { immediate: true }); // 一级Tab切换事件 -const handleMainTabClick = async (tabKey: 'maintain' | 'inspect' | 'workorder') => { +const handleMainTabClick = async (tabKey: 'maintain' | 'inspection' | 'workorder') => { if (mainTab.value === tabKey) return; mainTab.value = tabKey; currentTabValue.value = 0; // 切大tab默认回到待办 @@ -504,11 +504,11 @@ const loadAllTaskByDept = async () => { } else { await loadSmartSortTask(loc.lon, loc.lat, 'maintain'); } - } else if (mainTab.value === 'inspect') { + } else if (mainTab.value === 'inspection') { if (useDistanceApi.value) { - await loadDistanceApiTask(loc.lon, loc.lat, 'inspect'); + await loadDistanceApiTask(loc.lon, loc.lat, 'inspection'); } else { - await loadSmartSortTask(loc.lon, loc.lat, 'inspect'); + await loadSmartSortTask(loc.lon, loc.lat, 'inspection'); } } else if (mainTab.value === 'workorder') { // ========= 工单tab,后续对接工单接口,先置空列表占位 =========