Files
emsfront/src/mixins/ems/getQuerySiteId.js
2025-07-21 23:00:41 +08:00

26 lines
694 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 用于单站监控二级菜单页面获取路由中的站点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('设置页面siteIdthis.siteId=',this.siteId)
})
},
immediate: true,
}
},
}
export default getQuerySiteId