[fix]添加伟创力车棚,及页面显示调整

main
huyuanxiang 2 years ago
parent d55bb48d8b
commit 8db4f8cbd8

@ -87,7 +87,9 @@
<div class="item flex" :class="itemStateClass(item.state).clas" v-for="item in secondList" :key="item.id"> <div class="item flex" :class="itemStateClass(item.state).clas" v-for="item in secondList" :key="item.id">
<div class="item-img"> <div class="item-img">
<div class="img-list flex flex-wrap base-item" <div class="img-list flex flex-wrap base-item"
:class="item.list.length > 8 ? '' : 'eight-item'" :class="item.list.length === 12 ? 'base-item' :
item.list.length === 16 ? 'sixteen-item' :
'eight-item'"
> >
<div :class="['img-it' <div :class="['img-it'
, itemClass(it.electricQuantity) , itemClass(it.electricQuantity)
@ -308,6 +310,7 @@
this.$router.replace('/pages/station/list') this.$router.replace('/pages/station/list')
}, },
initData() { initData() {
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 => {
@ -321,7 +324,9 @@
this.station = this.stationData.filter(v => { this.station = this.stationData.filter(v => {
return v.id === data[0] return v.id === data[0]
})[0] })[0]
this.type = FIRST_STATIONS.includes(data[0]) ? 'first' : 'second' const AREA_SECOND_STATIONS = ['30']
this.type = AREA_SECOND_STATIONS.includes(data[1]) ? 'second' : FIRST_STATIONS.includes(data[0]) ? 'first' : 'second'
// this.type = FIRST_STATIONS.includes(data[0]) ? 'first' : 'second'
this.getDataInfo(this.type) this.getDataInfo(this.type)
}, },
@ -360,7 +365,8 @@
// width: 183px; // width: 183px;
const eightNumArr = ['1052758023'] // 8 const eightNumArr = ['1052758023'] // 8
this.itemNum = eightNumArr.includes(this.selectStations[0]) ? 8 : 12 const sixteenNumArr = ['30'] // 16
this.itemNum = eightNumArr.includes(this.selectStations[0]) ? 8 : sixteenNumArr.includes(this.selectStations[1]) ? 16 : 12
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) => {
@ -377,7 +383,7 @@
return { return {
list: cList, list: cList,
dayEnergy: item[`dayEnergy${index}`], dayEnergy: item[`dayEnergy${index}`],
equipmentName: item[`equipmentName${index}`].split(' ')[1], equipmentName: item[`equipmentName${index}`] ? item[`equipmentName${index}`].split(' ')[1] : '-',
id: item[`inverterInfoId${index}`], id: item[`inverterInfoId${index}`],
state: item[`state${index}`], state: item[`state${index}`],
totalHavePower: item[`totalHavePower${index}`], totalHavePower: item[`totalHavePower${index}`],
@ -634,6 +640,12 @@
&.eight-item { &.eight-item {
width: 300upx; width: 300upx;
} }
&.sixteen-item {
width: 450upx;
.img-it {
width: 52upx;
}
}
.img-it { .img-it {
width: 70upx; width: 70upx;
height: 40upx; height: 40upx;

@ -273,6 +273,7 @@
const UN_SHOW_STATIONS = [ const UN_SHOW_STATIONS = [
'23', '22', '2' '23', '22', '2'
] ]
const AREA_SECOND_STATIONS = ['30']
const END_NUM = 65535 const END_NUM = 65535
let SECOND_VALUE = '' let SECOND_VALUE = ''
let timer = null let timer = null
@ -369,7 +370,8 @@
uni.setStorageSync('_pro_selectStation', this.selectStations) uni.setStorageSync('_pro_selectStation', this.selectStations)
this.isChange = true this.isChange = true
SECOND_VALUE = null SECOND_VALUE = null
this.type = FIRST_STATIONS.includes(this.selectStations[0]) ? 'first' : 'second'
this.type = AREA_SECOND_STATIONS.includes(this.selectStations[1]) ? 'second' : FIRST_STATIONS.includes(this.selectStations[0]) ? 'first' : 'second'
this.getDataListInfo(this.type, 'change') this.getDataListInfo(this.type, 'change')
scrollSmoothTo() scrollSmoothTo()
@ -391,7 +393,7 @@
this.station = this.stationData.filter(v => { this.station = this.stationData.filter(v => {
return v.id === data[0] return v.id === data[0]
})[0] })[0]
this.type = FIRST_STATIONS.includes(data[0]) ? 'first' : 'second' this.type = AREA_SECOND_STATIONS.includes(data[1]) ? 'second' : FIRST_STATIONS.includes(data[0]) ? 'first' : 'second'
uni.setStorageSync('_pro_selectStation', this.selectStations) uni.setStorageSync('_pro_selectStation', this.selectStations)
this.getDataListInfo(this.type) this.getDataListInfo(this.type)
}, },
@ -533,6 +535,12 @@
}, },
_getMaxNum(item, text = 'dayEnergy') { _getMaxNum(item, text = 'dayEnergy') {
if (text !== 'dayEnergy') {
const eightNumArr = ['1052758023'] // 8
const sixteenNumArr = ['30'] // 16
return eightNumArr.includes(this.selectStations[0]) ? 8 :
sixteenNumArr.includes(this.selectStations[1]) ? 16 : 12
}
let maxNum = 1 let maxNum = 1
for (let i = 1; i<= 50; i++) { for (let i = 1; i<= 50; i++) {
if (!item[text + i]) { if (!item[text + i]) {

@ -106,6 +106,10 @@
id: '5', id: '5',
stationName: '伟创力超毅厂区' stationName: '伟创力超毅厂区'
}, },
{
id: '30',
stationName: '三期中央车棚'
}
], ],
'1052758019': [ '1052758019': [
{ {
@ -200,7 +204,7 @@
], ],
'1052758029': [ { '1052758029': [ {
id: '24', id: '24',
stationName: '枫泾兴塔厂' stationName: '汉钟兴塔厂'
}], }],
'1052758031': [ { '1052758031': [ {
id: '28', id: '28',

Loading…
Cancel
Save