| | |
| | | <div class="title"> |
| | | <div>现有设备</div> |
| | | <div class="title-tab"> |
| | | <span :class="{ choosed: linetype == 0 }" @click="lineTabClick(0)">设备种类</span>/ |
| | | <span :class="{ choosed: linetype == 1 }" @click="lineTabClick(1)">设备状态</span> |
| | | <span :class="{ choosed: linetype == 0 }" @click="initEquipmentEcharts(0)">设备种类</span>/ |
| | | <span :class="{ choosed: linetype == 1 }" @click="initEquipmentEcharts(1)">设备状态</span> |
| | | </div> |
| | | </div> |
| | | <div style="overflow: hidden;" id="EquipmentEcharts" class="echarts-box"></div> |
| | |
| | | const oneColor = ['#4caf50', '#2979ff', '#ffd600', '#0d47a1', '#b71c1c'] |
| | | const twoColor = ['#5470FE', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'] |
| | | |
| | | let rightTiming = null |
| | | let equipmentmyChart = null |
| | | let eventchangemychart = null |
| | | let timer |
| | |
| | | |
| | | this.initEventChangeEcharts() |
| | | |
| | | this.initEquipmentEcharts() |
| | | this.initEquipmentEcharts(this.linetype) |
| | | |
| | | if (rightTiming != null) { |
| | | clearInterval(rightTiming) |
| | | rightTiming = null |
| | | } |
| | | |
| | | rightTiming = setInterval(async () => { |
| | | |
| | | this.initEquipmentEcharts(this.linetype) |
| | | |
| | | }, 600000) |
| | | }, |
| | | |
| | | getSchedulingList () { |
| | |
| | | return dataAll |
| | | }, |
| | | |
| | | // 设备种类,设备状态切换 |
| | | async lineTabClick (type) { |
| | | // 现有设备饼图初始化 |
| | | async initEquipmentEcharts (type) { |
| | | this.linetype = type |
| | | |
| | | const data = await this.getEquipment() |
| | | |
| | | const newData = data.filter(item => { |
| | | if (item.value != 0) { |
| | | return item |
| | | } |
| | | }) |
| | | |
| | | equipmentmyChart.setOption(this.initEquipmentOptions(newData)) |
| | | |
| | | if (newData.length > 1) { |
| | | this.equipmentEchartsCarousel() |
| | | } else { |
| | | clearInterval(timer) |
| | | equipmentmyChart.off('mouseover') |
| | | equipmentmyChart.off('mouseout') |
| | | if (equipmentmyChart != null && equipmentmyChart != '' && equipmentmyChart != undefined) { |
| | | equipmentmyChart.dispose() |
| | | equipmentmyChart.off('click') |
| | | } |
| | | }, |
| | | |
| | | // 现有设备饼图初始化 |
| | | async initEquipmentEcharts () { |
| | | var chartDom = document.getElementById('EquipmentEcharts') |
| | | if (equipmentmyChart != null && equipmentmyChart != '' && equipmentmyChart != undefined) equipmentmyChart.dispose() |
| | | |
| | | equipmentmyChart = this.$echarts.init(chartDom) |
| | | |
| | | const data = await this.getEquipment() |