From 0c577b6868346455a729524a3d7a030acab33ec7 Mon Sep 17 00:00:00 2001
From: 刘淇 <290219706@qq.com>
Date: Sat, 17 Oct 2026 14:59:08 +0800
Subject: [PATCH] 首页tab切换
---
pages/index/index.vue | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
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,后续对接工单接口,先置空列表占位 =========
--
libgit2 0.21.4