var vms = Vue.component("Company-amplify-sbgk", { template: `
`, props: { }, data() { return { projectIdStr:"", show:false, //设备概况 overview:0, overviewInterval:'', surveyUrlSb:'/images/survey_icon_1.png', showOverViewLabel:'设备数量', showOverviewData:{}, projectIdList:[], projectList:JSON.parse(localStorage.getItem("projectList")), } }, mounted(){ }, methods: { openAmplify(){ this.show = true //获取机智管家项目ID this.getProjectIdList() this.getOverviewData() this.overviewInterval = setInterval(this.overviewClick,5000); }, closeAmplify(){ this.show = false }, closeAmplifyAll(e){ if(e.target.className == 'amplify-fixed'){ this.show = false } }, //设备概况数据 getOverviewData(){ var that = this axios.post(requestUrl+"getEquipmentOverview?deptId=131&projectId="+this.projectIdStr, { }).then(res => { that.overviewData = [res.data.data.count,res.data.data.bind,res.data.data.monitor]; that.showOverviewData = that.overviewData[0]; console.log(that.showOverviewData) }).catch(err => { }) }, //获取机制管家id getProjectIdList(){ let projectList = this.projectList; let projectIdList = []; for (let i = 0; i < projectList.length ; i++) { if(projectList[i].jzgj!="" && projectList[i].jzgj!=0){ projectIdList.push(projectList[i].jzgj); } } this.projectIdList = projectIdList; this.projectIdStr = projectIdList.toString(); }, //设备概况点击事件定时器方法 overviewClick(){ if(this.overview < 2){ this.overview = this.overview + 1 }else{ this.overview = 0 } this.showOverviewData = this.overviewData[this.overview]; if(this.overview == 0){ this.surveyUrl = '/images/survey_icon_1.png' this.showOverViewLabel= '设备数量' }else if(this.overview == 1){ this.surveyUrl = '/images/survey_icon_2.png' this.showOverViewLabel= '绑定数量' }else{ this.surveyUrl = '/images/survey_icon_3.png' this.showOverViewLabel= '监测数量' } }, //设备概况点击事件 onClickoOverview(n){ var that = this that.overview = n that.showOverviewData = this.overviewData[this.overview]; if(this.overview == 0){ this.surveyUrl = '/images/survey_icon_1.png' this.showOverViewLabel= '设备数量' }else if(this.overview == 1){ this.surveyUrl = '/images/survey_icon_2.png' this.showOverViewLabel= '绑定数量' }else{ this.surveyUrl = '/images/survey_icon_3.png' this.showOverViewLabel= '监测数量' } }, }, watch:{ }, })