import Vue from 'vue' var vms = Vue.component("amplify-sbgk", { template: `
`, props: { }, data() { return { show:false, overview: 0, showOverviewLabel:'设备数量', surveyUrlSb: '/images/survey_icon_1.png', overviewInterval: '', overviewData:[], showOverviewData: {}, } }, mounted(){ }, methods: { openAmplify(){ this.show = true //设备概况点击事件定时器 this.overviewInterval = setInterval(this.overviewClick, 5000); this.getOverviewData() }, closeAmplify(){ this.show = false this.overview = 0 this.showOverviewLabel='设备数量' this.surveyUrlSb= '/images/survey_icon_1.png' clearInterval(this.overviewInterval); }, closeAmplifyAll(e){ if(e.target.className == 'amplify-fixed'){ this.show = false this.overview = 0 this.showOverviewLabel='设备数量' this.surveyUrlSb= '/images/survey_icon_1.png' clearInterval(this.overviewInterval); } }, //设备概况点击事件定时器方法 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.showOverviewLabel = '设备数量' this.surveyUrlSb = '/images/survey_icon_1.png' } else if (this.overview == 1) { this.showOverviewLabel = '绑定数量' this.surveyUrlSb = '/images/survey_icon_2.png' } else { this.showOverviewLabel = '监控数量' this.surveyUrlSb = '/images/survey_icon_3.png' } }, //设备概况点击事件 onClickoOverview(n) { this.overview = n this.showOverviewData = this.overviewData[this.overview]; if (this.overview == 0) { this.showOverviewLabel = '设备数量' this.surveyUrlSb = '/images/survey_icon_1.png' } else if (this.overview == 1) { this.showOverviewLabel = '绑定数量' this.surveyUrlSb = '/images/survey_icon_2.png' } else { this.showOverviewLabel = '监控数量' this.surveyUrlSb = '/images/survey_icon_3.png' } }, //设备概况数据 getOverviewData(){ axios.post(requestUrl+"getEquipmentOverview?deptId="+deptId+"&projectId="+JSON.parse(localStorage.getItem("data1")).jzgj, { }).then(res => { this.overviewData = [res.data.data.count,res.data.data.bind,res.data.data.monitor]; this.showOverviewData = this.overviewData[0]; }).catch(err => { }) }, }, watch:{ }, })