[fix]添加伟创力B15 17 7详情组串显示数量不一致

main
huyuanxiang 8 months ago
parent ababdcda2f
commit 28d296a42a

@ -8,6 +8,8 @@ export const FIRST_STATIONS = [
export const UN_SHOW_STATIONS = [ export const UN_SHOW_STATIONS = [
'23', '22', '2' '23', '22', '2'
] ]
export const eightNumArr = ['1052758023'] // 塞纳8个组串
export const sixteenNumArr = ['30','35','36','37'] // 16个组串
export const STATION_LIST = { export const STATION_LIST = {
'1052758018': [ '1052758018': [
{ {

@ -356,7 +356,7 @@ export default {
this.$router.replace('/pages/station/list') this.$router.replace('/pages/station/list')
}, },
initData() { initData() {
console.log(this.stationData)
const hasLocalData = this.selectStations.length const hasLocalData = this.selectStations.length
const stationId = hasLocalData ? this.selectStations[0] : this.$route.query.id const stationId = hasLocalData ? this.selectStations[0] : this.$route.query.id
const station = this.stationData.filter(v => { const station = this.stationData.filter(v => {
@ -419,18 +419,27 @@ export default {
} }
// this.itemNum = eightNumArr.includes(this.selectStations[0]) ? 8 : sixteenNumArr.includes(this.selectStations[1]) ? 16 : 12 // this.itemNum = eightNumArr.includes(this.selectStations[0]) ? 8 : sixteenNumArr.includes(this.selectStations[1]) ? 16 : 12
this.itemNum = itemNum this.itemNum = itemNum
// width: 183px; const SELF_ARR = ['35', '36']
const eightNumArr = ['1052758023'] // 8 const B9Arr = ['1052758018', '31']
const sixteenNumArr = ['30'] // 16 const isB9 = B9Arr[0] === this.selectStations[0] && B9Arr[1]=== this.selectStations[1]
// this.itemNum = eightNumArr.includes(this.selectStations[0]) ? 8 : sixteenNumArr.includes(this.selectStations[1]) ? 16 : 12 const isB15OrB17 = SELF_ARR.includes(this.selectStations[1])
// B9 3,6,9 65535
this.secondList = Array.from(Array(maxNum)).map((v, inde) => { this.secondList = Array.from(Array(maxNum)).map((v, inde) => {
const index = inde + 1 const index = inde + 1
const cList = Array.from(Array(this.itemNum)).map((cv, cIndex) => { const cList = Array.from(Array(this.itemNum)).map((cv, cIndex) => {
const _cIndex = cIndex + 1 const _cIndex = cIndex + 1
const num = item[`electricQuantity${index}_${_cIndex}`].split('A')[0] let text = item[`electricQuantity${index}_${_cIndex}`]
text = text.split('A')[0] || 0
const isOffLine = +text <= 0.4
let num = isB9 && [3, 6, 9].includes(_cIndex) && isOffLine ? '655.35' : text
num = isB15OrB17 && [1,5,9,13].includes(_cIndex) && isOffLine ? '655.35' : num
// 0.0 655.35
// num = (+num) === 0 ? '655.35' : num
const reg = /^65/g const reg = /^65/g
const is65535 = reg.test(num) const is65535 = reg.test(num)
const _num = is65535 ? num.split('.').join('') : num const _num = is65535 ? num.split('.').join('') : +num
// console.log(num)
return { return {
id: '', id: '',
electricQuantity: parseFloat(_num), electricQuantity: parseFloat(_num),

@ -264,7 +264,7 @@
getBigScreenPowerInverterMqttBySn getBigScreenPowerInverterMqttBySn
} from '@/api/modules/station.js' } from '@/api/modules/station.js'
import _mixin from './mixin.js' import _mixin from './mixin.js'
import { AREA_SECOND_STATIONS, FIRST_STATIONS, UN_SHOW_STATIONS, END_NUM } from './config' import { AREA_SECOND_STATIONS, FIRST_STATIONS, UN_SHOW_STATIONS, END_NUM, sixteenNumArr, eightNumArr } from './config'
let myChart = null let myChart = null
let SECOND_VALUE = '' let SECOND_VALUE = ''
let timer = null let timer = null
@ -527,8 +527,6 @@
}, },
_getMaxNum(item, text = 'dayEnergy') { _getMaxNum(item, text = 'dayEnergy') {
if (text !== 'dayEnergy') { if (text !== 'dayEnergy') {
const eightNumArr = ['1052758023'] // 8
const sixteenNumArr = ['30'] // 16
return eightNumArr.includes(this.selectStations[0]) ? 8 : return eightNumArr.includes(this.selectStations[0]) ? 8 :
sixteenNumArr.includes(this.selectStations[1]) ? 16 : 12 sixteenNumArr.includes(this.selectStations[1]) ? 16 : 12
} }

Loading…
Cancel
Save