| | |
| | | blindPlatePluggingCount: [], |
| | | riskEventConfig: {}, |
| | | riskStatusConfig: {}, |
| | | deviceConfig: {} |
| | | deviceConfig: {}, |
| | | myVar: null |
| | | }; |
| | | }, |
| | | created(){ |
| | |
| | | |
| | | // 各部门预约 |
| | | initAppoint(){ |
| | | const t = this |
| | | const dom = document.getElementById(this.appointId); |
| | | let myChart = this.$echarts.init(dom, null, { |
| | | renderer: 'canvas', |
| | |
| | | type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' |
| | | } |
| | | }, |
| | | dataZoom: { |
| | | type: 'slider', |
| | | show: true, |
| | | showDetails: true, |
| | | textStyle: { |
| | | color: '#fff' |
| | | dataZoom: [ |
| | | //滑动条 |
| | | { |
| | | yAxisIndex: 0, //这里是从X轴的0刻度开始 |
| | | show: false, //是否显示滑动条,不影响使用 |
| | | type: "slider", // 这个 dataZoom 组件是 slider 型 dataZoom 组件 |
| | | startValue: 0, // 从头开始。 |
| | | endValue: 6, // 一次性展示几个。 |
| | | }, |
| | | realtime: true, |
| | | right: 10, |
| | | height: 200, |
| | | width: 15, |
| | | start: 50, |
| | | end: 100, |
| | | orient: 'vertical' |
| | | }, |
| | | ], |
| | | legend: { |
| | | textStyle: { |
| | | color: '#fff', |
| | |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: this.hotCount |
| | | data: t.hotCount |
| | | }, |
| | | { |
| | | name: '受限空间作业', |
| | |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: this.confinedSpaceCount |
| | | data: t.confinedSpaceCount |
| | | }, |
| | | { |
| | | name: '吊装作业', |
| | |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: this.liftingCount |
| | | data: t.liftingCount |
| | | }, |
| | | { |
| | | name: '动土作业', |
| | |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: this.groundBreakingCount |
| | | data: t.groundBreakingCount |
| | | }, |
| | | { |
| | | name: '断路作业', |
| | |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: this.openCircuitCout |
| | | data: t.openCircuitCout |
| | | }, |
| | | { |
| | | name: '高处作业', |
| | |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: this.heightCount |
| | | data: t.heightCount |
| | | }, |
| | | { |
| | | name: '临时用电作业', |
| | |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: this.temporaryPowerCount |
| | | data: t.temporaryPowerCount |
| | | }, |
| | | { |
| | | name: '盲板抽堵作业', |
| | |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: this.blindPlatePluggingCount |
| | | data: t.blindPlatePluggingCount |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | if (option && typeof option === 'object') { |
| | | myChart.setOption(option); |
| | | t.myVar = setInterval(function(){ |
| | | console.log('tik') |
| | | if (option.dataZoom[0].endValue == t.depList.length ) { |
| | | option.dataZoom[0].endValue = 6; |
| | | option.dataZoom[0].startValue = 0; |
| | | } else { |
| | | option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1; |
| | | option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1; |
| | | } |
| | | |
| | | myChart.setOption(option); |
| | | }, 3000) |
| | | } |
| | | window.addEventListener('resize', myChart.resize); |
| | | setTimeout(()=>{ |
| | | myChart.resize |
| | |
| | | myChart.resize |
| | | },500) |
| | | } |
| | | }, |
| | | beforeDestroy(){ |
| | | window.clearInterval(this.myVar) |
| | | this.myVar = null |
| | | }, |
| | | destroyed(){ |
| | | // 离开当前路由后的操作 |
| | | window.clearInterval(this.myVar) |
| | | this.myVar = null |
| | | } |
| | | } |
| | | </script> |