This commit is contained in:
duanxiaohai 2024-08-06 11:25:30 +08:00
commit 1011b01aa7
5 changed files with 50 additions and 11 deletions

BIN
src/assets/person/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -5,7 +5,17 @@
<img class="title" src="../assets/img_07.png" alt="" /> <img class="title" src="../assets/img_07.png" alt="" />
</div> --> </div> -->
<Header /> <Header />
<!-- <keep-alive include="首页地图">
<router-view /> <router-view />
</keep-alive> -->
<!-- <router-view v-slot="{ Component }">
<keep-alive>
<component :is="Component" />
</keep-alive>
</router-view> -->
<keep-alive :max="1" :include="['首页地图']">
<router-view />
</keep-alive>
</div> </div>
</div> </div>
</template> </template>
@ -13,7 +23,7 @@
<script setup> <script setup>
import Header from "../components/header.vue"; import Header from "../components/header.vue";
import { ref, onMounted, onBeforeMount ,watch, nextTick} from "vue"; import { ref, onMounted, onBeforeMount, watch, nextTick } from "vue";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
const router = useRouter(); const router = useRouter();
const routers = useRoute(); const routers = useRoute();
@ -21,9 +31,9 @@ console.log(routers.path);
watch( watch(
() => routers.path, () => routers.path,
(newVal, oldVal) => { (newVal, oldVal) => {
nextTick(()=>{ nextTick(() => {
reset_font() reset_font();
}) });
} }
); );
const reset_font = () => { const reset_font = () => {
@ -31,7 +41,6 @@ const reset_font = () => {
let height = let height =
document.documentElement.clientHeight || document.body.clientHeight; document.documentElement.clientHeight || document.body.clientHeight;
document.querySelector("#m").style.transformOrigin = "top left"; document.querySelector("#m").style.transformOrigin = "top left";
document.querySelector("#m").style.transform = document.querySelector("#m").style.transform =
"scale(" + width / 1920 + "," + height / 1080 + ")"; "scale(" + width / 1920 + "," + height / 1080 + ")";
@ -39,17 +48,14 @@ const reset_font = () => {
document.querySelector(".header_content").style.transformOrigin = "top left"; document.querySelector(".header_content").style.transformOrigin = "top left";
document.querySelector(".header_content").style.transform = document.querySelector(".header_content").style.transform =
"scale(" + width / 1920 + "," + height / 1080 + ")"; "scale(" + width / 1920 + "," + height / 1080 + ")";
if ( if (document.querySelector(".left")) {
document.querySelector(".left")) {
document.querySelector(".left").style.transformOrigin = "bottom left"; document.querySelector(".left").style.transformOrigin = "bottom left";
document.querySelector(".left").style.transform = document.querySelector(".left").style.transform =
"scale(" + width / 1920 + "," + height / 1080 + ")"; "scale(" + width / 1920 + "," + height / 1080 + ")";
document.querySelector(".right").style.transformOrigin = "bottom right"; document.querySelector(".right").style.transformOrigin = "bottom right";
document.querySelector(".right").style.transform = document.querySelector(".right").style.transform =
"scale(" + width / 1920 + "," + height / 1080 + ")"; "scale(" + width / 1920 + "," + height / 1080 + ")";
} }
}; };
onMounted(() => { onMounted(() => {
reset_font(); reset_font();
@ -93,7 +99,6 @@ body {
overflow: hidden; overflow: hidden;
// position: absolute; // position: absolute;
z-index: -1; z-index: -1;
} }
#emap { #emap {

View File

@ -89,6 +89,10 @@
<div class="main-tag-item">身后事</div> <div class="main-tag-item">身后事</div>
<div class="main-tag-item">综合</div> <div class="main-tag-item">综合</div>
<div class="person-main-person"></div> <div class="person-main-person"></div>
<div class="back" @click="back()">
<img src="@/assets/person/back.png" alt="" />
<p>返回</p>
</div>
</div> </div>
<div class="person-side"> <div class="person-side">
<div class="my-label"> <div class="my-label">
@ -461,6 +465,9 @@ const getData = (nm, identNo) => {
// } // }
// }); // });
// }; // };
const back=()=>{
router.back()
}
onMounted(() => { onMounted(() => {
// console.log(routers.query); // console.log(routers.query);
if (routers.query.type == "map") { if (routers.query.type == "map") {
@ -777,4 +784,30 @@ onMounted(() => {
} }
} }
} }
.back {
box-sizing: border-box;
position: absolute;
width: 88px;
height: 36px;
top: 0px;
left: 30px;
background: url("../../assets/person/back_bg.png") no-repeat;
background-size: 100% 100%;
display: flex;
align-items: center;
padding: 10px 16px;
z-index: 10;
cursor: pointer;
img {
width: 17px;
height: 16px;
}
p {
margin-left: 5px;
font-weight: 400;
font-size: 16px;
color: #b5eaff;
line-height: 22px;
}
}
</style> </style>

View File

@ -179,6 +179,7 @@ import {
defineProps, defineProps,
watch, watch,
nextTick, nextTick,
onActivated
} from "vue"; } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import tools from "@/utils/tools"; import tools from "@/utils/tools";