Authored by 鲁尚清

搭建的页面路由跳转设置及返回上级页面

... ... @@ -50,6 +50,22 @@ export const monitorCustomPiePercentageCard = {
placeholder: '',
value: '',
},
{
type: 'el-switch',
label: '是否有跳转',
name: 'isNextPage',
required: false,
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '跳转路由',
name: 'nextRouter',
required: false,
placeholder: '',
value: '',
},
[
{
name: '标题设置',
... ...
<template>
<div class="button-container" :style="styleObj">
<div class="button-title" :style="titleStyle">
<div class="button-title" :style="titleStyle" @click="goBack">
<img :src="imgStyle.titleIcon" alt="" class="icon-title">
{{ transStyle.titleName }}
</div>
... ... @@ -111,6 +111,9 @@ export default {
},
methods: {
goBack() {
this.$router.go(-1)
},
//计算按钮是否显示
btnDisplay(){
this.btnGroup.map((item,index)=>{
... ... @@ -181,6 +184,7 @@ export default {
padding:5px;
display: flex;
align-items: center;
cursor: pointer;
}
.icon-title{
margin-right:5px;
... ...
... ... @@ -142,6 +142,7 @@ export default {
left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px",
background: this.optionsSetup.background,
cursor:this.optionsSetup.isNextPage?'pointer':''
};
},
flexStyle(){
... ... @@ -415,20 +416,20 @@ export default {
},
goJump(){
let locationUrl=this.$route.query;
console.log("reportCode",locationUrl.second_router)
//二级路由传递给iframe父页面
/*let param={
type:'second_router',
data:{
reportCode: this.$route.query.second_router
if(this.optionsSetup.isNextPage){
let nextRouter=this.optionsSetup.nextRouter;
if( this.$route.query.second_router){
nextRouter=this.$route.query.second_router
}
if(nextRouter){
this.$router.push({
path: `/bigscreen/viewer`,
query: { reportCode: nextRouter },
})
}
}
window.parent.postMessage(param, '*')
*/
this.$router.push({
path: `/bigscreen/viewer`,
query: { reportCode: this.$route.query.second_router },
})
}
}
};
... ...
... ... @@ -31,6 +31,11 @@ export default {
widgets: []
};
},
//start 监听路由变化,刷新页面 lsq 2022-03-18
watch:{
"$route":'getData'
},
//end lsq 2022-03-18
mounted() {
this.getData();
},
... ...