New file |
| | |
| | | import Vue from 'vue' |
| | | const self = new Vue() |
| | | |
| | | export default { |
| | | |
| | | /** |
| | | * 电池组实时数据 |
| | | */ |
| | | getRTData (data) { |
| | | return self.$axios({ |
| | | method: 'post' |
| | | ,url: 'Batt_rtstateAction!serchByCondition' |
| | | ,data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | import electric from './electric' |
| | | import chargepower from './electric/chargepower' |
| | | import water from './water' |
| | | import batt from './batt' |
| | | |
| | | export default { |
| | | common, |
| | |
| | | motor, |
| | | electric, |
| | | chargepower, |
| | | water |
| | | water, |
| | | batt |
| | | } |
| | |
| | | /** |
| | | * 画面板框 |
| | | */ |
| | | // 电源3 |
| | | can.drawRect({ |
| | | startX: 320 |
| | | ,startY: 6 |
| | | ,width: 150 |
| | | startX: 230 |
| | | ,startY: 66 |
| | | ,width: 80 |
| | | ,height: 40 |
| | | ,strokeStyle: 'transparent' |
| | | }, true); |
| | | // 电源2 |
| | | can.drawRect({ |
| | | startX: 320 |
| | | ,startY: 226 |
| | | ,width: 150 |
| | | startX: 230 |
| | | ,startY: 286 |
| | | ,width: 80 |
| | | ,height: 40 |
| | | ,strokeStyle: 'transparent' |
| | | }, true); |
| | | // 电源1 |
| | | can.drawRect({ |
| | | startX: 320 |
| | | ,startY: 446 |
| | | ,width: 150 |
| | | startX: 230 |
| | | ,startY: 516 |
| | | ,width: 80 |
| | | ,height: 40 |
| | | ,strokeStyle: 'transparent' |
| | | }, true); |
| | | // 电机 |
| | | can.drawRect({ |
| | | startX: 320 |
| | | ,startY: 654 |
| | |
| | | ,height: 40 |
| | | ,strokeStyle: 'transparent' |
| | | }, true); |
| | | |
| | | // 电源3信息 index 12 |
| | | can.drawRect({ |
| | | startX: 320 |
| | | ,startY: 6 |
| | | ,width: 150 |
| | | ,height: 40 |
| | | ,strokeStyle: 'transparent' |
| | | }, true); |
| | | can.drawRect({ |
| | | startX: 320 |
| | | ,startY: 226 |
| | | ,width: 150 |
| | | ,height: 40 |
| | | ,strokeStyle: 'transparent' |
| | | }, true); |
| | | can.drawRect({ |
| | | startX: 320 |
| | | ,startY: 446 |
| | | ,width: 150 |
| | | ,height: 40 |
| | | ,strokeStyle: 'transparent' |
| | | }, true); |
| | | |
| | | } |
| | | |
| | |
| | | :top="load.top" :left="load.left"> |
| | | <info-group :list="load.list"></info-group> |
| | | </science-box> |
| | | <div class="status" v-for="(item, idx) in status" :key="'status_' + idx" :style="getStyle(item)"> |
| | | <div class="status" v-for="(item, idx) in status.slice(3)" :key="'status_' + idx" :style="getStyle(item)"> |
| | | <label>通讯:</label> |
| | | <span :class="['indicator_css', {'status_normal': item.status, 'status_error': !item.status}]"></span> |
| | | </div> |
| | | <!-- 电源状态 --> |
| | | <div class="status" v-for="(item, idx) in status.slice(0, 3)" :key="'status_power_' + idx" :style="getStyle(item)"> |
| | | <div class="pos_bl flexR_center"> |
| | | <label>通讯:</label> |
| | | <span :class="['indicator_css', {'status_normal': item.status, 'status_error': !item.status}]"></span> |
| | | </div> |
| | | <div class="pos_bl_o flexR_center"> |
| | | <label>运行:</label> |
| | | <span :class="['indicator_css', {'status_normal': item.run, 'status_error': !item.run}]"></span> |
| | | </div> |
| | | </div> |
| | | <div class="power-info" v-for="(item, idx) in powerInfo" :key="'info_' + idx" :style="getPowerInfoStyle(item)"> |
| | | <div class="pos_bl"> |
| | | <label>电流:</label> |
| | | <span>{{item.cur}}A</span> |
| | | <label>电压:</label> |
| | | <span>{{item.vol}}V</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- ROOTEND --> |
| | |
| | | let can, can1; |
| | | let resizeHandler; |
| | | let el = ''; |
| | | // 保留位数 |
| | | const bit = 1; |
| | | // 通信状态 |
| | | let connects = { |
| | | load1: false |
| | |
| | | ] |
| | | } |
| | | ], |
| | | // 电池组信息 |
| | | battInfo: [ |
| | | { |
| | | show: false, |
| | | title: '1#蓄电池组', |
| | | top: 0, |
| | | left: 0, |
| | | list: [ |
| | | { |
| | | text: '组端电压:', |
| | | value: 0, |
| | | unit: 'A' |
| | | }, |
| | | { |
| | | text: '在线电压:', |
| | | value: 0, |
| | | unit: 'V' |
| | | }, |
| | | { |
| | | text: '电池电流:', |
| | | value: 0, |
| | | unit: 'A' |
| | | } |
| | | ] |
| | | }, { |
| | | show: false, |
| | | title: '2#蓄电池组', |
| | | top: 0, |
| | | left: 0, |
| | | list: [ |
| | | { |
| | | text: '组端电压:', |
| | | value: 0, |
| | | unit: 'A' |
| | | }, |
| | | { |
| | | text: '在线电压:', |
| | | value: 0, |
| | | unit: 'V' |
| | | }, |
| | | { |
| | | text: '电池电流:', |
| | | value: 0, |
| | | unit: 'A' |
| | | } |
| | | ] |
| | | }, { |
| | | show: false, |
| | | title: '3#蓄电池组', |
| | | top: 0, |
| | | left: 0, |
| | | list: [ |
| | | { |
| | | text: '组端电压:', |
| | | value: 0, |
| | | unit: 'A' |
| | | }, |
| | | { |
| | | text: '在线电压:', |
| | | value: 0, |
| | | unit: 'V' |
| | | }, |
| | | { |
| | | text: '电池电流:', |
| | | value: 0, |
| | | unit: 'A' |
| | | } |
| | | ] |
| | | }, { |
| | | show: false, |
| | | title: '4#蓄电池组', |
| | | top: 0, |
| | | left: 0, |
| | | list: [ |
| | | { |
| | | text: '组端电压:', |
| | | value: 0, |
| | | unit: 'A' |
| | | }, |
| | | { |
| | | text: '在线电压:', |
| | | value: 0, |
| | | unit: 'V' |
| | | }, |
| | | { |
| | | text: '电池电流:', |
| | | value: 0, |
| | | unit: 'A' |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | loads: [ |
| | | { |
| | | title: '水冷负载1', |
| | |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false, |
| | | run: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false, |
| | | run: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false, |
| | | run: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | width: 0, |
| | | height: 0, |
| | | status: false |
| | | }, |
| | | } |
| | | ] |
| | | ,powerInfo: [ |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | status: false |
| | | }, |
| | | { |
| | | left: 0, |
| | | top: 0, |
| | | status: false |
| | | top: 0 |
| | | ,left: 0 |
| | | ,width: 0 |
| | | ,height: 0 |
| | | ,vol: 0 |
| | | ,cur: 0 |
| | | } |
| | | ,{ |
| | | top: 0 |
| | | ,left: 0 |
| | | ,width: 0 |
| | | ,height: 0 |
| | | ,vol: 0 |
| | | ,cur: 0 |
| | | } |
| | | ,{ |
| | | top: 0 |
| | | ,left: 0 |
| | | ,width: 0 |
| | | ,height: 0 |
| | | ,vol: 0 |
| | | ,cur: 0 |
| | | } |
| | | ] |
| | | } |
| | |
| | | this.status[9].status = connects.load3; |
| | | this.status[10].status = connects.load4; |
| | | } |
| | | console.log(this.connects); |
| | | }); |
| | | } |
| | | ,getBoolFromArr (arr) { |
| | |
| | | this.setLoadPos(); |
| | | this.setFloatBoxPos(); |
| | | this.setPanelPos(); |
| | | this.setPowerInfoPos(); |
| | | // this.setRect(); |
| | | } |
| | | // 添加电源数据 |
| | |
| | | // let D = data[3]; |
| | | // console.log('state', AB, B, CD, D); |
| | | this.floatBox[2].list[1].value = AB.conn_flag ? '串联' : '并联'; |
| | | this.floatBox[2].list[2].value = AB.alldcvol; |
| | | this.floatBox[2].list[3].value = AB.alldccurr; |
| | | this.floatBox[2].list[2].value = (AB.alldcvol).toFixed(bit); |
| | | this.floatBox[2].list[3].value = (AB.alldccurr).toFixed(bit); |
| | | |
| | | this.powerInfo[2].vor = (AB.alldcvol).toFixed(bit); |
| | | this.powerInfo[2].cur = (AB.alldccurr).toFixed(bit); |
| | | |
| | | this.floatBox[1].list[1].value = CD.conn_flag ? '串联' : '并联'; |
| | | this.floatBox[1].list[2].value = CD.alldcvol; |
| | | this.floatBox[1].list[3].value = CD.alldccurr; |
| | | this.floatBox[1].list[2].value = (CD.alldcvol).toFixed(bit); |
| | | this.floatBox[1].list[3].value = (CD.alldccurr).toFixed(bit); |
| | | |
| | | this.powerInfo[1].vol = (CD.alldcvol).toFixed(bit); |
| | | this.powerInfo[1].cur = (CD.alldccurr).toFixed(bit); |
| | | } |
| | | }); |
| | | this.$api.electric.getAllRtData().then((res)=>{ |
| | |
| | | let D = data[3]; |
| | | // console.log('data', AB, B, CD, D); |
| | | this.floatBox[2].list[0].value = AB.consvolcurrflag ? '恒流' : '恒压'; |
| | | this.floatBox[2].list[4].value = AB.dcvol / 10; |
| | | this.floatBox[2].list[5].value = AB.dccurr / 10; |
| | | this.floatBox[2].list[6].value = AB.controlangle / 10; |
| | | this.floatBox[2].list[7].value = B.dcvol / 10; |
| | | this.floatBox[2].list[8].value = B.dccurr / 10; |
| | | this.floatBox[2].list[9].value = B.controlangle / 10; |
| | | this.floatBox[2].list[4].value = (AB.dcvol / 10).toFixed(bit); |
| | | this.floatBox[2].list[5].value = (AB.dccurr / 10).toFixed(bit); |
| | | this.floatBox[2].list[6].value = (AB.controlangle / 10).toFixed(bit); |
| | | this.floatBox[2].list[7].value = (B.dcvol / 10).toFixed(bit); |
| | | this.floatBox[2].list[8].value = (B.dccurr / 10).toFixed(bit); |
| | | this.floatBox[2].list[9].value = (B.controlangle / 10).toFixed(bit); |
| | | |
| | | this.floatBox[1].list[0].value = CD.consvolcurrflag ? '恒流' : '恒压'; |
| | | this.floatBox[1].list[4].value = CD.dcvol / 10; |
| | | this.floatBox[1].list[5].value = CD.dccurr / 10; |
| | | this.floatBox[1].list[6].value = CD.controlangle / 10; |
| | | this.floatBox[1].list[7].value = D.dcvol / 10; |
| | | this.floatBox[1].list[8].value = D.dccurr / 10; |
| | | this.floatBox[1].list[9].value = D.controlangle / 10; |
| | | this.floatBox[1].list[4].value = (CD.dcvol / 10).toFixed(bit); |
| | | this.floatBox[1].list[5].value = (CD.dccurr / 10).toFixed(bit); |
| | | this.floatBox[1].list[6].value = (CD.controlangle / 10).toFixed(bit); |
| | | this.floatBox[1].list[7].value = (D.dcvol / 10).toFixed(bit); |
| | | this.floatBox[1].list[8].value = (D.dccurr / 10).toFixed(bit); |
| | | this.floatBox[1].list[9].value = (D.controlangle / 10).toFixed(bit); |
| | | } |
| | | }); |
| | | |
| | |
| | | let data = res.data[0]; |
| | | if (i) { |
| | | // 电流 |
| | | this.floatBox[0].list[6].value = data.brachdccurr; |
| | | this.floatBox[0].list[6].value = (data.brachdccurr).toFixed(bit); |
| | | // 电压 |
| | | this.floatBox[0].list[7].value = data.brachdcvol; |
| | | this.floatBox[0].list[7].value = (data.brachdcvol).toFixed(bit); |
| | | // 控制角 |
| | | this.floatBox[0].list[9].value = data.controlangle; |
| | | this.floatBox[0].list[9].value = (data.controlangle).toFixed(bit); |
| | | } else { |
| | | // 总直流电压 |
| | | this.floatBox[0].list[1].value = data.alldcvol; |
| | | this.floatBox[0].list[1].value = (data.alldcvol).toFixed(bit); |
| | | this.powerInfo[0].vol = (data.alldcvol).toFixed(bit); |
| | | // 总直流电流 |
| | | this.floatBox[0].list[0].value = data.alldccurr; |
| | | this.floatBox[0].list[0].value = (data.alldccurr).toFixed(bit); |
| | | this.powerInfo[0].cur = (data.alldccurr).toFixed(bit); |
| | | // 电流 |
| | | this.floatBox[0].list[2].value = data.brachdccurr; |
| | | this.floatBox[0].list[2].value = (data.brachdccurr).toFixed(bit); |
| | | // 电压 |
| | | this.floatBox[0].list[3].value = data.brachdcvol; |
| | | this.floatBox[0].list[3].value = (data.brachdcvol).toFixed(bit); |
| | | // 控制角 |
| | | this.floatBox[0].list[5].value = data.controlangle; |
| | | this.floatBox[0].list[5].value = (data.controlangle).toFixed(bit); |
| | | // this.real_set_cur = data.localgivecurr; |
| | | // this.real_set_vol = data.localgivevol; |
| | | } |
| | |
| | | |
| | | }); |
| | | }); |
| | | } |
| | | // 设置电池组信息 |
| | | ,setBattData () { |
| | | /*let param = { |
| | | BattGroupId: batt.BattGroupId |
| | | }; |
| | | this.$api.batt.getRTData(param).then((res) => { |
| | | |
| | | });*/ |
| | | } |
| | | // 获取负载列表 |
| | | ,getLoadList () { |
| | |
| | | this.floatBox[3].top = pos.top; |
| | | } |
| | | ,getStyle (obj) { |
| | | console.log(obj, 90) |
| | | return { |
| | | left: obj.left + 'px', |
| | | top: obj.top + 'px' |
| | | top: obj.top + 'px', |
| | | width: obj.width + 'px', |
| | | height: obj.height + 'px' |
| | | } |
| | | } |
| | | ,getPowerInfoStyle (obj) { |
| | | return { |
| | | left: obj.left + 'px' |
| | | ,top: obj.top + 'px' |
| | | ,width: obj.width + 'px' |
| | | ,height: obj.height + 'px' |
| | | } |
| | | } |
| | | ,setPanelPos () { |
| | |
| | | this.status[i] = this.status[i] || {}; |
| | | this.status[i].left = position.left; |
| | | this.status[i].top = position.top; |
| | | this.status[i].width = position.width; |
| | | this.status[i].height = position.height; |
| | | this.status[i].status = 0; |
| | | } |
| | | } |
| | | ,setPowerInfoPos () { |
| | | const $container = this.$refs.container; |
| | | const width = $container.offsetWidth; |
| | | const height = $container.offsetHeight; |
| | | for (let i = 11; i < 14; i++) { |
| | | let position = this.$common.transSize(width, height, 1880, 810, can.getInfo('rect_' + i)); |
| | | this.powerInfo[i - 11].top = position.top; |
| | | this.powerInfo[i - 11].left = position.left; |
| | | this.powerInfo[i - 11].width = position.width; |
| | | this.powerInfo[i - 11].height = position.height; |
| | | } |
| | | } |
| | | // 画布点击事件 |
| | |
| | | this.setLoadPos(); |
| | | this.setFloatBoxPos(); |
| | | this.setPanelPos(); |
| | | this.setPowerInfoPos(); |
| | | } |
| | | window.addEventListener('resize', resizeHandler); |
| | | |
| | |
| | | height: 100%; |
| | | display: block; |
| | | -o-object-fit: contain; |
| | | object-fit: contain; |
| | | object-fit: contain; |
| | | } |
| | | .can1 { |
| | | position: absolute; |
| | |
| | | width: 24px; |
| | | height: 24px; |
| | | margin-left: .4em; |
| | | display: inline-block; |
| | | } |
| | | .box { |
| | | z-index: 1; |
| | | } |
| | | .power-info { |
| | | position: absolute; |
| | | } |
| | | .power-info span { |
| | | color: #df0; |
| | | margin-right: .8em; |
| | | margin-left: .4em; |
| | | } |
| | | .pos_bl { |
| | | position: absolute; |
| | | left: 0; |
| | | bottom: 0; |
| | | white-space: nowrap; |
| | | } |
| | | .pos_bl_o { |
| | | position: absolute; |
| | | top: 100%; |
| | | left: 0; |
| | | white-space: nowrap; |
| | | -webkit-transform: translateY(10px); |
| | | transform: translateY(10px); |
| | | } |
| | | </style> |