pull/110/head
孙萌 2024-02-19 18:03:38 +08:00
parent fd10372039
commit e58028d02d
2 changed files with 62 additions and 54 deletions

View File

@ -371,6 +371,7 @@ export function realTimeLine(id, data,pageId) {
}
export function statusCharts(id, data) {
var chartDom = document.getElementById(id);
var myChart = echarts.init(chartDom);
var option;

View File

@ -148,6 +148,7 @@
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>5#风机</span>
</div>
<div style="display: none;"></div>
</div>
</div>
<div v-else class="status-noTrue">
@ -219,6 +220,7 @@
<img v-else src="../../assets/img/fan-off.png" alt="">
<span>8#补光灯</span>
</div>
<div style="display: none;"></div>
</div>
</div>
<div v-else class="status-noTrue">
@ -250,7 +252,7 @@
</div>
<div class="status-true-text" v-if="item.type == 2 || item.type == 5 || item.type == 6 || item.type == 12
|| item.type == 13 || item.type == 14 || item.type == 15|| item.type == 16">
|| item.type == 13 || item.type == 14 || item.type == 15 || item.type == 16">
<div class="status-true-text-left">{{ getNumberStatus(item) }}</div>
<div class="status-true-text-right"
v-if="item.type == 6 || item.type == 5 || item.type == 2 || item.type == 15 || item.type == 14 || item.type == 13 || item.type == 12">
@ -258,10 +260,9 @@
</div>
<div class="status-fan status-btn" v-else>
<div class="btn" :class="item.index == 1 ? 'blue' : 'off'">
<img class="light-img" :src="getIcon(item)"
alt="">
<img class="light-img" :src="getIcon(item)" alt="">
<!-- <img v-else src="../../assets/img/fan-off.png" alt=""> -->
<span>{{item.index==1?'开启':'关闭'}}</span>
<span>{{ item.index == 1 ? '开启' : '关闭' }}</span>
</div>
</div>
</div>
@ -667,7 +668,7 @@ export default {
height: divH, // 1080 px
})
},
getIcon(item){
getIcon(item) {
var index = item.index
if (item.type == 3) {
//
@ -688,7 +689,7 @@ export default {
} else {
return ''
}
}else if (item.type == 4) {
} else if (item.type == 4) {
//
if (index == 0) {
return require('../../assets/img/fan-off.png')
@ -697,7 +698,7 @@ export default {
} else {
return ''
}
}else if (item.type == 9) {
} else if (item.type == 9) {
//
if (index == 0) {
return require('../../assets/img/fan-off.png')
@ -732,7 +733,7 @@ export default {
getNumberStatus(item) {
var index = item.index
if (item.type == 2 || item.type == 5 || item.type == 6 || item.type == 12
|| item.type == 13 || item.type == 14 || item.type == 15|| item.type == 16) {
|| item.type == 13 || item.type == 14 || item.type == 15 || item.type == 16) {
//
if (index == 0) {
return '静止状态'
@ -944,7 +945,7 @@ export default {
this.api.postFsdata(data1).then(res => {
if (res.data.code == 200) {
var chartsData = res.data.data
realTimeLine('realTime-line', chartsData,data1)
realTimeLine('realTime-line', chartsData, data1)
} else {
// this.$message.error(res.data.msg);
}
@ -1057,7 +1058,7 @@ export default {
this.api.getControlFsdata(data1).then(res => {
if (res.data.code == 200) {
var chartsData = res.data.data
realTimeLine('realTime-line', chartsData,data1)
realTimeLine('realTime-line', chartsData, data1)
} else {
// this.$message.error(res.data.msg);
}
@ -1120,7 +1121,7 @@ export default {
if (res.data.code == 200) {
res.data.data.forEach((el, index) => {
var chartsData = res.data.data
realTimeLine('realTime-line', chartsData,equipmentId)
realTimeLine('realTime-line', chartsData, equipmentId)
})
}
})
@ -1224,19 +1225,19 @@ export default {
}
this.api.getControlGetState(TargetValue).then(res => {
if (res.data.code == 200) {
if(res.data.data["1119"]){
if (res.data.data["1119"]) {
this.sunrise = this.insertColonEveryTwoDigits(
this.convertToTimeMinutes(res.data.data["1119"])
);
}else{
this.sunrise =''
} else {
this.sunrise = ''
}
if(res.data.data["1120"]){
if (res.data.data["1120"]) {
this.sunset = this.insertColonEveryTwoDigits(
this.convertToTimeMinutes(res.data.data["1120"])
);
}else{
this.sunset =''
} else {
this.sunset = ''
}
const statusList = []
@ -1249,7 +1250,7 @@ export default {
fandata.type = 1
fandata.name = el.name
fandata.status = []
var num = res.data.data['1024']?res.data.data['1024']:0
var num = res.data.data['1024'] ? res.data.data['1024'] : 0
var num1 = this.padString(num.toString(2), 5)
var openListNew = []
openListNew = num1.split("")
@ -1263,7 +1264,7 @@ export default {
fandata.type = 1
fandata.name = el.name
fandata.status = []
var num = res.data.data['1079']?res.data.data['1079']:0
var num = res.data.data['1079'] ? res.data.data['1079'] : 0
var num1 = this.padString(num.toString(2), 5)
var openListNew = []
openListNew = num1.split("")
@ -1277,7 +1278,7 @@ export default {
fandata.type = 8
fandata.name = el.name
fandata.status = []
var num = res.data.data['1069']?res.data.data['1069']:0
var num = res.data.data['1069'] ? res.data.data['1069'] : 0
var num1 = this.padString(num.toString(2), 8)
var openListNew = []
openListNew = num1.split("")
@ -1339,19 +1340,25 @@ export default {
//
var statusData = { name: el.name, type: 15, id: el.id, open: res.data.data[(1102 + ((el.id - 26) * 3))], progress: res.data.data[(1104 + ((el.id - 26) * 3))], index: res.data.data[(1103 + ((el.id - 26) * 3))] }
statusList.push(statusData)
} else if (el.id == 30 || el.id == 31 ) {
} else if (el.id == 30 || el.id == 31) {
//
var statusData = { name: el.name, type: 16, id: el.id, open: res.data.data[(1182 + ((el.id - 30) * 3))], progress: res.data.data[(1184 + ((el.id - 30) * 3))], index: res.data.data[(1183 + ((el.id - 30) * 3))] }
statusList.push(statusData)
}
})
this.statusList = statusList
this.$forceUpdate();
setTimeout(() => {
this.statusList.forEach((el, index) => {
if (el.open != 0 && (el.type == 6 || el.type == 5 || el.type == 2 || el.type == 15 || el.type == 14 || el.type == 13 || el.type == 12)) {
setTimeout(() => {
statusCharts(`statusCharts${index}`, el.progress)
}, 0);
}
})
}, 10);