优化大屏的返回操作
This commit is contained in:
parent
461a82ad2d
commit
37d9a2de00
@ -1,52 +1,57 @@
|
||||
<template>
|
||||
<el-tooltip class="closeBtn" effect="dark" content="关闭页面" placement="bottom">
|
||||
<!-- <a href="javascript:window.opener=null;window.close();">
|
||||
<el-tooltip class="closeBtn" effect="dark" content="关闭页面" placement="bottom">
|
||||
<!-- <a href="javascript:window.opener=null;window.close();">
|
||||
<img src="@/assets/images/carOverview/close.png" alt="">
|
||||
</a> -->
|
||||
<a @click="closePage">
|
||||
<img src="../assets/images/dataBoard/blueTheme2/close.png" alt="" v-if="enabledProjectV2==4">
|
||||
<img src="@/assets/images/carOverview/close.png" alt="" v-else>
|
||||
</a>
|
||||
</el-tooltip>
|
||||
<a @click="closePage">
|
||||
<img style="width: 100%" src="../assets/images/dataBoard/blueTheme2/close.png" alt="" v-if="enabledProjectV2==4">
|
||||
<img style="width: 100%" src="@/assets/images/carOverview/close.png" alt="" v-else>
|
||||
</a>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return{
|
||||
enabledProjectV2: 2
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
closePage(){
|
||||
// console.log(this.$route.path)
|
||||
// getDockingUrlApi().then((res)=>{
|
||||
// console.log('路径',res)
|
||||
// })
|
||||
|
||||
// if(this.$route.path.indexOf('/project/dataBoard') != -1 || this.$route.path.indexOf('/project/videoOverview') != -1 || this.$route.path.indexOf('/project/environmentalOverview') != -1 || this.$route.path.indexOf('/project/projectSummary') != -1 || this.$route.path.indexOf('/project/imgRanging') != -1 || this.$route.path.indexOf('/project/warningManage') != -1){
|
||||
// // console.log(window.location.href.split('#/')[0]+'#/projectIndex')
|
||||
// // window.location.href = window.location.href.split('#/')[0] + '#/projectIndex' //注释
|
||||
// } else{
|
||||
// window.history.back()
|
||||
// }
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.enabledProjectV2 = enabledProjectV2;
|
||||
data() {
|
||||
return {
|
||||
enabledProjectV2: 2
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closePage() {
|
||||
// this.$router.back()
|
||||
// console.log(this.$route.path)
|
||||
// getDockingUrlApi().then((res)=>{
|
||||
// console.log('路径',res)
|
||||
// })
|
||||
|
||||
if (this.$route.path.indexOf('/project/dataBoard') != -1 || this.$route.path.indexOf('/project/videoOverview') != -1 || this.$route.path.indexOf('/project/environmentalOverview') != -1 || this.$route.path.indexOf('/project/projectSummary') != -1 || this.$route.path.indexOf('/project/imgRanging') != -1 || this.$route.path.indexOf('/project/warningManage') != -1) {
|
||||
console.log(window.location.href.split('#/')[0] + '#/projectIndex')
|
||||
window.location.href = window.location.href.split('#/')[0] + '#/projectIndex' //注释
|
||||
} else {
|
||||
window.history.back()
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.enabledProjectV2 = enabledProjectV2;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.closeBtn{
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 6px;
|
||||
z-index: 9999;
|
||||
}
|
||||
a{
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
.closeBtn {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 6px;
|
||||
z-index: 9999;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a {
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user