接口提交

This commit is contained in:
luoshiwen 2024-03-14 09:14:55 +08:00
parent e0aaa4aa8f
commit 42778fb010
1 changed files with 80 additions and 3 deletions

View File

@ -2,6 +2,7 @@
import {ref, reactive,onMounted} from "vue"; import {ref, reactive,onMounted} from "vue";
import getPath from "@/utils/getPath.js"; import getPath from "@/utils/getPath.js";
import dialogBox from './components/dialogBox.vue' import dialogBox from './components/dialogBox.vue'
import {getGeneralSituation,getElectricalCondition,getFailureWarning,getBootStrategy,getMaintenanceReminder,getPolicyEditing} from '@/api/air-conditioning'
const systemNumList = ref([ const systemNumList = ref([
{ {
name: '运行设备数量', name: '运行设备数量',
@ -53,7 +54,7 @@ const electricityContent = ref([
unit:"kWh", unit:"kWh",
}, },
{ {
name:'本用电费用', name:'本用电费用',
value:66, value:66,
unit:"万元", unit:"万元",
}, },
@ -170,8 +171,79 @@ const closeDialog = (val) =>{
const controlBtn = ref('on') const controlBtn = ref('on')
const toggleControl = (event) => { const toggleControl = (event) => {
controlBtn.value = event.srcElement.className controlBtn.value = event.srcElement.className
maintenanceReminderInterface()
}
//
const generalSituationInterface = () =>{
getGeneralSituation().then(res=>{
systemNumList.value[0].num = res.data[0].Operation
systemNumList.value[1].num = res.data[0].Stop
overviewList.value[0].num = res.data[0].Area / 10000
overviewList.value[1].num = res.data[0].Amount
})
}
//
const failureWarningInterface = () =>{
getFailureWarning().then(res=>{
faultList.value = res.data.map(el=>{
return {
name:el.FailureWarning,
date:el.FailureTime
}
})
})
}
//
const electricalConditionInterface = () =>{
getElectricalCondition().then(res=>{
//
electricityContent.value[0].value = res.data[0].EH
electricityContent.value[1].value = res.data[0].Electricity
//
electricityContent.value[2].value = res.data[1].EH
electricityContent.value[3].value = res.data[1].Electricity
//
electricityContent.value[4].value = res.data[2].EH
electricityContent.value[5].value = res.data[2].Electricity
})
}
//
const bootStrategyInterface = () =>{
getBootStrategy().then(res=>{
runTimeList.value = res.data.map(el=>{
return {
name:el.StrategyName,
value:el.StrategyState
}
})
})
}
//
const maintenanceReminderInterface = () =>{
console.log(controlBtn.value);
let params = {
name: controlBtn.value === 'on' ? '已超期':'即将开始'
}
getMaintenanceReminder(params).then(res=>{
maintenanceList.value = res.data.map(el=>{
return {
name:el.DeviceName,
date:el.OverDue
}
})
})
} }
onMounted(()=>{ onMounted(()=>{
//
generalSituationInterface()
//
electricalConditionInterface()
//
failureWarningInterface()
//
bootStrategyInterface()
//
maintenanceReminderInterface()
}) })
</script> </script>
@ -231,7 +303,7 @@ onMounted(()=>{
<div class="title margin10"> <div class="title margin10">
<span>故障报警</span> <span>故障报警</span>
</div> </div>
<div id="fault" class="margin10 box-bg"> <div id="fault" class="margin10 box-bg" >
<p v-for="s in faultList"> <p v-for="s in faultList">
<span class="name">{{s.name}}</span> <span class="name">{{s.name}}</span>
<span class="date">时间{{s.date}}</span> <span class="date">时间{{s.date}}</span>
@ -409,13 +481,18 @@ onMounted(()=>{
} }
} }
// //
#fault::-webkit-scrollbar{
display:none;
}
#fault{ #fault{
padding: 0 1rem; padding: 0 1rem;
overflow-y:scroll;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-content: space-evenly; // align-content: space-evenly;
p{ p{
margin:.8rem;
width: 100%; width: 100%;
height: 20%; height: 20%;
background-image: url("@/assets/images/air-conditioning/fault.png"); background-image: url("@/assets/images/air-conditioning/fault.png");