历史轨迹

pull/1/head
LiuJiaNan 2024-02-22 11:57:42 +08:00
parent 4a5bd7df58
commit 55ccefb142
5 changed files with 43 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -31,7 +31,7 @@
v-for="(item, index) in data.breadcrumbList" v-for="(item, index) in data.breadcrumbList"
:key="item.path" :key="item.path"
> >
<router-link v-if="index === 0" :to="item.path"> <router-link v-if="index === 0" to="/index">
{{ item.meta.title }} {{ item.meta.title }}
</router-link> </router-link>
<span v-else-if="index !== data.breadcrumbList.length - 1"> <span v-else-if="index !== data.breadcrumbList.length - 1">

View File

@ -61,22 +61,23 @@ const props = defineProps({
required: true, required: true,
default: false, default: false,
}, },
currentCheckChildren: { isHistoricalTrajectory: {
type: String, type: Boolean,
required: true, required: true,
default: "", default: false,
}, },
}); });
const emits = defineEmits([ const emits = defineEmits([
"update:leftCurrentComponent", "update:leftCurrentComponent",
"update:rightCurrentComponent", "update:rightCurrentComponent",
"update:isHistoricalTrajectory",
"update:rightOption", "update:rightOption",
]); ]);
const { const {
leftCurrentComponent, leftCurrentComponent,
rightCurrentComponent, rightCurrentComponent,
rightOption, rightOption,
currentCheckChildren, isHistoricalTrajectory,
} = useVModels(props, emits); } = useVModels(props, emits);
const bottomOptionsList = [ const bottomOptionsList = [
@ -125,10 +126,10 @@ const bottomOptionsList = [
action: handleFence, action: handleFence,
}, },
{ {
img: new URL("/src/assets/images/map/bottom/ico3.png", import.meta.url) img: new URL("/src/assets/images/map/bottom/ico18.png", import.meta.url)
.href, .href,
imgSelect: new URL( imgSelect: new URL(
"/src/assets/images/map/bottom/ico3_on.png", "/src/assets/images/map/bottom/ico18_on.png",
import.meta.url import.meta.url
).href, ).href,
title: "历史轨迹", title: "历史轨迹",
@ -369,16 +370,39 @@ const fnBottomOptionsListChange = (item, index) => {
rightOption.value = index !== 4; rightOption.value = index !== 4;
}; };
const fnBottomChildOptionsListChange = (index, item1, index1) => { const fnBottomChildOptionsListChange = (index, item1, index1) => {
currentCheckChildren.value = ""; if (item1.type === "historicalTrajectory") {
data.bottomOptionsList[index].list[index1].check = for (let i = 0; i < data.bottomOptionsList.length; i++) {
!data.bottomOptionsList[index].list[index1].check; for (let j = 0; j < data.bottomOptionsList[i].list.length; j++) {
if (data.bottomOptionsList[index].list[index1].action) { const currentItem = data.bottomOptionsList[i].list[j];
data.bottomOptionsList[index].list[index1].action( if (currentItem.type !== item1.type) currentItem.check = false;
data.bottomOptionsList[index].list[index1].check, }
item1.type }
); data.bottomOptionsList[index].list[index1].check =
!data.bottomOptionsList[index].list[index1].check;
isHistoricalTrajectory.value = !isHistoricalTrajectory.value;
} 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 currentItem = data.bottomOptionsList[i].list[j];
if (currentItem.type === "historicalTrajectory") {
currentItem.check = false;
isHistoricalTrajectory.value = false;
isSelf = true;
break;
}
}
if (isSelf) break;
}
data.bottomOptionsList[index].list[index1].check =
!data.bottomOptionsList[index].list[index1].check;
if (data.bottomOptionsList[index].list[index1].action) {
data.bottomOptionsList[index].list[index1].action(
data.bottomOptionsList[index].list[index1].check,
item1.type
);
}
} }
currentCheckChildren.value = item1.type;
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -27,7 +27,7 @@
v-model:left-current-component="leftCurrentComponent" v-model:left-current-component="leftCurrentComponent"
v-model:right-current-component="rightCurrentComponent" v-model:right-current-component="rightCurrentComponent"
v-model:right-option="right_option" v-model:right-option="right_option"
v-model:current-check-children="currentCheckChildren" v-model:is-historical-trajectory="isHistoricalTrajectory"
/> />
</div> </div>
<transition <transition
@ -43,9 +43,7 @@
<div v-show="right_option" class="right_ico"> <div v-show="right_option" class="right_ico">
<right-ico></right-ico> <right-ico></right-ico>
</div> </div>
<historical-trajectory-options <historical-trajectory-options v-if="isHistoricalTrajectory" />
v-if="currentCheckChildren === 'historicalTrajectory'"
/>
</div> </div>
</template> </template>
@ -63,7 +61,7 @@ const right_option = ref(true);
const transitionKey = ref(0); const transitionKey = ref(0);
const leftCurrentComponent = ref(""); const leftCurrentComponent = ref("");
const rightCurrentComponent = ref(""); const rightCurrentComponent = ref("");
const currentCheckChildren = ref(""); const isHistoricalTrajectory = ref(false);
const corp = { CORP_NAME: "河北秦安", lng: 119.44758654, lat: 39.91845908 }; const corp = { CORP_NAME: "河北秦安", lng: 119.44758654, lat: 39.91845908 };
onMounted(() => { onMounted(() => {