26 lines
694 B
JavaScript
26 lines
694 B
JavaScript
// 用于单站监控二级菜单页面获取路由中的站点ID
|
||
const getQuerySiteId= {
|
||
data: function () {
|
||
return {
|
||
siteId:''
|
||
}
|
||
},
|
||
watch: {
|
||
'$store.state.ems.zdList':{
|
||
handler (newQuery,oldQuery) {
|
||
if(!newQuery || newQuery.length === 0){return}
|
||
// 参数变化处理
|
||
this.$nextTick(() => {
|
||
const {siteId} =newQuery[0]
|
||
this.siteId = siteId
|
||
siteId && this.init(newQuery.siteId)
|
||
console.log('watch站点列表返回数据newQuery=',newQuery)
|
||
console.log('设置页面siteId,this.siteId=',this.siteId)
|
||
})
|
||
},
|
||
immediate: true,
|
||
}
|
||
},
|
||
}
|
||
export default getQuerySiteId
|