diff --git a/src/assets/images/map/bottom/ico19.png b/src/assets/images/map/bottom/ico19.png new file mode 100644 index 0000000..865d3b7 Binary files /dev/null and b/src/assets/images/map/bottom/ico19.png differ diff --git a/src/assets/images/map/bottom/ico19_on.png b/src/assets/images/map/bottom/ico19_on.png new file mode 100644 index 0000000..802b06c Binary files /dev/null and b/src/assets/images/map/bottom/ico19_on.png differ diff --git a/src/views/BI/components/bottom_options.vue b/src/views/BI/components/bottom_options.vue index 883fac2..8719d80 100644 --- a/src/views/BI/components/bottom_options.vue +++ b/src/views/BI/components/bottom_options.vue @@ -74,18 +74,25 @@ const props = defineProps({ required: true, default: false, }, + isRealTimeTracking: { + type: Boolean, + required: true, + default: false, + }, }); const emits = defineEmits([ "update:leftCurrentComponent", "update:rightCurrentComponent", "update:rightOption", "update:isHistoricalTrajectory", + "update:isRealTimeTracking", ]); const { leftCurrentComponent, rightCurrentComponent, rightOption, isHistoricalTrajectory, + isRealTimeTracking, } = useVModels(props, emits); const bottomOptionsList = [ @@ -144,6 +151,17 @@ const bottomOptionsList = [ type: "historicalTrajectory", check: false, }, + { + img: new URL("/src/assets/images/map/bottom/ico19.png", import.meta.url) + .href, + imgSelect: new URL( + "/src/assets/images/map/bottom/ico19_on.png", + import.meta.url + ).href, + title: "实时追踪", + type: "realTimeTracking", + check: false, + }, ], }, { @@ -376,8 +394,9 @@ const fnBottomOptionsListChange = (item, index) => { rightOption.value = index !== 4; }; const fnBottomChildOptionsListChange = (index, item1, index1) => { + const singleChoiceType = ["historicalTrajectory", "realTimeTracking"]; const currentItem = data.bottomOptionsList[index].list[index1]; - if (item1.type === "historicalTrajectory") { + if (singleChoiceType.includes(item1.type)) { for (let i = 0; i < data.bottomOptionsList.length; i++) { for (let j = 0; j < data.bottomOptionsList[i].list.length; j++) { const currentForItem = data.bottomOptionsList[i].list[j]; @@ -388,20 +407,26 @@ const fnBottomChildOptionsListChange = (index, item1, index1) => { } } currentItem.check = !currentItem.check; - isHistoricalTrajectory.value = !isHistoricalTrajectory.value; + if (item1.type === "historicalTrajectory") { + isHistoricalTrajectory.value = !isHistoricalTrajectory.value; + isRealTimeTracking.value = false; + } + if (item1.type === "realTimeTracking") { + isRealTimeTracking.value = !isRealTimeTracking.value; + isHistoricalTrajectory.value = false; + } } else { - let isSelf = false; for (let i = 0; i < data.bottomOptionsList.length; i++) { for (let j = 0; j < data.bottomOptionsList[i].list.length; j++) { const currentForItem = data.bottomOptionsList[i].list[j]; - if (currentForItem.type === "historicalTrajectory") { - currentForItem.check = false; - isHistoricalTrajectory.value = false; - isSelf = true; - break; + if (singleChoiceType.includes(currentForItem.type)) { + if (currentForItem.check) { + currentForItem.check = false; + isHistoricalTrajectory.value = false; + isRealTimeTracking.value = false; + } } } - if (isSelf) break; } currentItem.check = !currentItem.check; if (currentItem.action) currentItem.action(currentItem.check, item1.type); diff --git a/src/views/BI/components/real_time_tracking.vue b/src/views/BI/components/real_time_tracking.vue new file mode 100644 index 0000000..17d19ae --- /dev/null +++ b/src/views/BI/components/real_time_tracking.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/views/BI/index.vue b/src/views/BI/index.vue index d1998af..3ad63ef 100644 --- a/src/views/BI/index.vue +++ b/src/views/BI/index.vue @@ -38,6 +38,7 @@ v-model:right-current-component="rightCurrentComponent" v-model:right-option="right_option" v-model:is-historical-trajectory="isHistoricalTrajectory" + v-model:is-real-time-tracking="isRealTimeTracking" /> @@ -68,6 +69,13 @@ v-if="isHistoricalTrajectory && !isPureMap" /> + + + @@ -81,6 +89,7 @@ import { initMap } from "./js/map"; import { useUserStore } from "@/pinia/user.js"; import { getEnterpriseInfo } from "@/request/enterprise_management.js"; import HistoricalTrajectoryOptions from "@/views/BI/components/historical_trajectory_options.vue"; +import RealTimeTracking from "@/views/BI/components/real_time_tracking.vue"; const router = useRouter(); const right_option = ref(true); @@ -88,6 +97,7 @@ const transitionKey = ref(0); const leftCurrentComponent = ref(""); const rightCurrentComponent = ref(""); const isHistoricalTrajectory = ref(false); +const isRealTimeTracking = ref(false); const isPureMap = ref(false); const userStore = useUserStore(); const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;