| | |
| | | <template> |
| | | <div class="echarts-wrapper" @click="toParentPage"> |
| | | <div class="echarts-wrapper" @click="toParentPage" @dblclick="dblclick"> |
| | | <div class="echarts-content" ref="dischargeCircuit"> |
| | | |
| | | </div> |
| | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | import { WebSocketClass } from '@/assets/js/socket' |
| | | import { checkboxs } from '@/assets/js/powerInfoData' |
| | | // 放电电流 页面 |
| | | export default { |
| | | name: "dischargeCircuit", |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | toParentPage() { |
| | | window.parent.parent.postMessage({ |
| | | cmd: "syncPage", |
| | | params: { |
| | | pageInfo: { |
| | | label: "电池实时告警", |
| | | name: "batteryrTimequery", |
| | | src: "#/batteryrTimequery", |
| | | closable: true |
| | | }, |
| | | } |
| | | }, "*"); |
| | | findParents(node, select) { |
| | | var parent = node.parentNode; |
| | | if (parent === null || parent.className.indexOf(select) != -1) { |
| | | return parent; |
| | | } else { |
| | | return this.findParents(parent, select); |
| | | } |
| | | }, |
| | | dblclick(e) { |
| | | this.isAllScreen = !this.isAllScreen |
| | | let parents = this.findParents(e.currentTarget, 'vdr') |
| | | if (this.isAllScreen) { |
| | | this.parentsStyle = JSON.parse(JSON.stringify(parents.style)); |
| | | parents.style.transform = 'none'; |
| | | parents.style.width = '100%'; |
| | | parents.style.height = '100%'; |
| | | parents.style.position = 'fixed'; |
| | | parents.style.left = 0; |
| | | parents.style.right = 0; |
| | | parents.style.bottom = 0; |
| | | parents.style.top = 0; |
| | | parents.style.zIndex = 99999; |
| | | } else { |
| | | parents.style.transform = this.parentsStyle.transform; |
| | | parents.style.width = this.parentsStyle.width; |
| | | parents.style.height = this.parentsStyle.height; |
| | | parents.style.position = this.parentsStyle.position; |
| | | parents.style.left = 'initial'; |
| | | parents.style.right = 'initial'; |
| | | parents.style.bottom = 'initial'; |
| | | parents.style.top = 'initial'; |
| | | parents.style.zIndex = 'auto'; |
| | | } |
| | | this.$options.discharge.resize(); |
| | | }, |
| | | toParentPage(value) { |
| | | if (typeof (value) == 'string') { |
| | | window.parent.parent.postMessage({ |
| | | cmd: "syncPage", |
| | | params: { |
| | | pageInfo: { |
| | | label: "电池实时告警", |
| | | name: "batteryrTimequery", |
| | | src: "#/batteryrTimequery/?alarmType=" + value, |
| | | closable: true |
| | | }, |
| | | } |
| | | }, "*"); |
| | | } |
| | | }, |
| | | setOption(opt) { |
| | | this.$options.discharge.setOption(opt); |
| | | this.$options.discharge.on('click', () => { |
| | | let name = "放电电流" |
| | | checkboxs.dcgj.map(item => { |
| | | if (item.label == name) { |
| | | this.toParentPage(item.value) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | postData() { |
| | | let userId = localStorage.getItem('userId'); |
| | | this.websock = new WebSocketClass(`/screen/batteryAlarm/dischargeAnalysis/${userId}`, this.wsMessage, 4000) |
| | | this.websock = new WebSocketClass(`/screen/batteryAlarm/dischargeAnalysis/${userId}`, this.wsMessage) |
| | | }, |
| | | wsMessage(res) { |
| | | let self = this; |
| | |
| | | maxYAxis.push(maxInt); |
| | | }); |
| | | self.optionSet(xAxisData, maxYAxis, xData, data); |
| | | console.log(xAxisData, data) |
| | | } |
| | | }, |
| | | outClear() { |