diff --git a/index.html b/index.html index 1368087..7cc05fd 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ diff --git a/src/components/Filter.vue b/src/components/Filter.vue index 0fdc10e..ed408e9 100644 --- a/src/components/Filter.vue +++ b/src/components/Filter.vue @@ -53,8 +53,8 @@ const markerStatus = ref({}); const checkedStatus = ref({}) watch(checkedStatus, (checked) => { for (let key in checked) { - markerStatus.value[key].forEach((marker) => { - marker.visible = checked[key] + markerStatus.value?.[key]?.forEach((marker) => { + marker.visible = !checked[key] }) } }, { @@ -67,7 +67,8 @@ function createDivMarker(content, polygon) { contentNode.className = "marker" contentNode.textContent = content contentNode.onclick = (e) => { - routeLineRef.value.addPathId(polygon.id) + if(!polygon?.isNavi) return + routeLineRef.value.addPath(polygon) } wrapper.appendChild(contentNode) diff --git a/src/hooks/useNavi.js b/src/hooks/useNavi.js index 9a70635..f57736c 100644 --- a/src/hooks/useNavi.js +++ b/src/hooks/useNavi.js @@ -2,9 +2,20 @@ import { ref, watch } from "vue" export function useNavi(map) { const pathIdList = ref([]) + + function addPath(polygon) { + if(polygon?.id && pathIdList.value[pathIdList.value.length - 1] === polygon?.id) return // 不连续添加相同的项 + + const modelId = polygon.extrasModelId; + const model = map.value.getModelById(modelId) + const modelName = model.userData.modelData.name + console.log(modelName, 'model.name') + + addPathId(polygon.id) + } function addPathId(id) { - if(pathIdList.value[pathIdList.value.length - 1] === id) return + if(id && pathIdList.value[pathIdList.value.length - 1] === id) return pathIdList.value.push(id) } @@ -70,6 +81,7 @@ export function useNavi(map) { return { pathIdList, + addPath, addPathId, startNavi, pauseNavi, diff --git a/src/router/index.js b/src/router/index.js index e6c70b4..a15e43b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -74,54 +74,54 @@ const router = createRouter({ } }, { - path: '/Path/PathManager', - name: 'pathManager', - components: { - map: HomeView, // 左侧显示地图视图 - right: PathManager // 右侧显示巡检路径管理视图 - } - }, - { - path: '/Path/PathSchedule', - name: 'pathSchedule', - components: { - map: HomeView, // 左侧显示地图视图 - right: PathSchedule // 右侧显示巡检计划管理视图 - } - }, - { - path: '/Path/PathLog', - name: 'pathLog', - components: { - map: HomeView, // 左侧显示地图视图 - right: PathLog // 右侧显示巡检日志管理视图 - } - }, - { - path: '/Car/CarManager', - name: 'carManager', - components: { - map: HomeView, // 左侧显示地图视图 - right: CarManager // 右侧显示车辆管理视图 - } - }, - { - path: '/Car/CarUseLog', - name: 'carUseLog', - components: { - map: HomeView, // 左侧显示地图视图 - right: CarUseLog // 右侧显示车辆使用记录视图 - } - }, - { - path: '/Car/CarEntryExitLog', - name: 'carEntryExitLog', - components: { - map: HomeView, // 左侧显示地图视图 - right: CarEntryExitLog // 右侧显示车辆进出记录视图 - } - } - // 可以在这里添加更多子路由 + path: '/Path/PathManager', + name: 'pathManager', + components: { + map: HomeView, // 左侧显示地图视图 + right: PathManager // 右侧显示巡检路径管理视图 + } + }, + { + path: '/Path/PathSchedule', + name: 'pathSchedule', + components: { + map: HomeView, // 左侧显示地图视图 + right: PathSchedule // 右侧显示巡检计划管理视图 + } + }, + { + path: '/Path/PathLog', + name: 'pathLog', + components: { + map: HomeView, // 左侧显示地图视图 + right: PathLog // 右侧显示巡检日志管理视图 + } + }, + { + path: '/Car/CarManager', + name: 'carManager', + components: { + map: HomeView, // 左侧显示地图视图 + right: CarManager // 右侧显示车辆管理视图 + } + }, + { + path: '/Car/CarUseLog', + name: 'carUseLog', + components: { + map: HomeView, // 左侧显示地图视图 + right: CarUseLog // 右侧显示车辆使用记录视图 + } + }, + { + path: '/Car/CarEntryExitLog', + name: 'carEntryExitLog', + components: { + map: HomeView, // 左侧显示地图视图 + right: CarEntryExitLog // 右侧显示车辆进出记录视图 + } + } + // 可以在这里添加更多子路由 ] } ] @@ -134,7 +134,7 @@ const router = createRouter({ router.beforeEach((to, from, next) => { const userStore = useUserStore() // 获取用户状态管理实例 const isLoggedIn = userStore.isLoggedIn // 检查用户是否已登录 - + // 检查路由是否需要身份验证 if (to.matched.some(record => record.meta.requiresAuth)) { // 需要身份验证的路由 diff --git a/src/views/Key/KeyRecord.vue b/src/views/Key/KeyRecord.vue index 9d971d2..3254f76 100644 --- a/src/views/Key/KeyRecord.vue +++ b/src/views/Key/KeyRecord.vue @@ -290,6 +290,10 @@ onMounted(() => { backdrop-filter: blur(5px); } +:deep(.el-table tr){ + background: transparent !important; +} + :deep(.el-table__header th) { background: rgba(12, 43, 77, 0.7) !important; border-bottom: 1px solid #68c9ff !important; diff --git a/src/views/Path/PathEditor.vue b/src/views/Path/PathEditor.vue index 962fd7a..b428c59 100644 --- a/src/views/Path/PathEditor.vue +++ b/src/views/Path/PathEditor.vue @@ -41,12 +41,13 @@ +