轮询接口

main
jn517618 2 years ago
parent cfe0d3bfab
commit 0400c86397
  1. 13
      src/views/energySources/component/all.vue
  2. 16
      src/views/energySources/component/dosage.vue
  3. 28
      src/views/energySources/component/equipmentAnalyze.vue
  4. 20
      src/views/energySources/component/equipmentLoad.vue
  5. 1
      src/views/energySources/component/header.vue
  6. 9
      src/views/energySourcesProvince/component/emissionAll.vue
  7. 1
      src/views/energySourcesProvince/component/header.vue
  8. 23
      src/views/energySourcesProvince/component/statistics.vue

@ -95,7 +95,8 @@ export default {
todayNum:0,
selectMonth:'',
currentMonthData:[120, 200, 150, 80, 70, 110, 130],
lastMonthData:[150, 120, 180, 60, 40, 130, 150]
lastMonthData:[150, 120, 180, 60, 40, 130, 150],
timeFun: null
};
},
components: {
@ -103,12 +104,16 @@ export default {
},
created() {
this.selectMonth = this.$moment().format('YYYY-MM')
this.getTotal()
this.$nextTick(() => {
this.getTotal()
this.getTrend()
})
// let nums = 1223.45;
// this.num = nums.toString().split('')
this.timeFun = setInterval(() => {
this.getTotal()
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
},
computed:{
...mapGetters(["userInfo", "permission"]),

@ -95,7 +95,8 @@ export default {
return {
selectDay: '',
tableData: [],
visible: false
visible: false,
timeFun: null
};
},
components: {
@ -104,10 +105,17 @@ export default {
},
created() {
this.selectDay = this.$moment().format('YYYY-MM-DD')
this.$nextTick(() => {
this.getPeriodData()
// this.$nextTick(() => {
// this.echartsInit()
// })
this.timeFun = setInterval(() => {
this.getPeriodData()
this.echartsInit()
})
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
},
computed: {
...mapGetters(["userInfo", "permission"]),

@ -1,7 +1,7 @@
<template>
<div class="equipmentAnalyze box">
<tit :title="'设备日均负载分析'">
<div class="tit-r" >
<div class="tit-r">
<span style="color: #fff;">选择时间</span>
<el-date-picker size="mini" v-model="selectDay" type="date" placeholder="选择月" @change="changeDate"
style="width: 1.3rem;margin-right: 0.26rem;" value-format="yyyy-MM-dd" format="yyyy-MM-dd">
@ -54,30 +54,37 @@
import tit from "./tit.vue";
import { mapGetters } from "vuex";
import {getInstrumentDaylyLoad} from "@/api/energySources/energySources"
import { getInstrumentDaylyLoad } from "@/api/energySources/energySources"
export default {
data() {
return {
selectDay: "",
tableData: []
tableData: [],
timeFun: null
};
},
components: {
tit
},
computed:{
computed: {
...mapGetters(["userInfo", "permission"]),
},
created() {
this.selectDay = this.$moment().format('YYYY-MM-DD')
this.getTotalData()
this.timeFun = setInterval(() => {
this.getTotalData()
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
},
methods: {
changeDate(){
changeDate() {
this.getTotalData()
},
getTotalData(){
getInstrumentDaylyLoad({manufacturerBrand:this.userInfo.dept_name,today:this.selectDay}).then(res =>{
getTotalData() {
getInstrumentDaylyLoad({ manufacturerBrand: this.userInfo.dept_name, today: this.selectDay }).then(res => {
this.tableData = res.data.data;
// this.yearNum = data.currentYear.toString().split('')
// this.monthNum = data.currentMonth.toString().split('')
@ -110,7 +117,8 @@ export default {
background-color: transparent !important;
border: 0 !important;
}
.equipmentAnalyze /deep/ .el-table td span{
.equipmentAnalyze /deep/ .el-table td span {
font-size: 0.14rem !important;
}
@ -130,8 +138,8 @@ export default {
height: 0.24rem !important;
}
.equipmentAnalyze /deep/ .el-input__icon{
line-height: 0.24rem !important;
.equipmentAnalyze /deep/ .el-input__icon {
line-height: 0.24rem !important;
}
.box {

@ -1,7 +1,7 @@
<template>
<div class="equipmentLoad box">
<tit :title="'设备负载监控'">
<div class="tit-r" @click="visible=true">监测明细</div>
<div class="tit-r" @click="visible = true">监测明细</div>
</tit>
<el-table :data="tableData" style="width: 100%;" height="92%" :stripe="true" :size="mini"
:row-class-name="tableRowClassName">
@ -23,7 +23,7 @@
import tit from "./tit.vue";
import emodal from "./emodal.vue";
import { mapGetters } from "vuex";
import {getInstrumentActLoad} from "@/api/energySources/energySources"
import { getInstrumentActLoad } from "@/api/energySources/energySources"
export default {
data() {
return {
@ -35,15 +35,21 @@ export default {
tit,
emodal
},
computed:{
computed: {
...mapGetters(["userInfo", "permission"]),
},
created() {
this.getTableData()
this.timeFun = setInterval(() => {
this.getTableData()
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
},
methods: {
getTableData(){
getInstrumentActLoad({manufacturerBrand:this.userInfo.dept_name}).then(res =>{
getTableData() {
getInstrumentActLoad({ manufacturerBrand: this.userInfo.dept_name }).then(res => {
this.tableData = res.data.data
})
},
@ -80,7 +86,8 @@ export default {
background-color: transparent !important;
border: 0 !important;
}
.equipmentLoad /deep/ .el-table td span{
.equipmentLoad /deep/ .el-table td span {
font-size: 0.14rem !important;
}
@ -110,6 +117,7 @@ export default {
margin-right: 0.22rem;
padding: 0.54rem 0.22rem 0 0.22rem;
position: relative;
.tit-r {
font-size: 0.14rem;
color: #0096FF;

@ -56,7 +56,6 @@ export default {
this.timeFun = setInterval(() => {
this.time = this.$moment().format('HH:mm:ss')
}, 1000)
// this.timeFun()
},
methods: {
},

@ -32,7 +32,8 @@ export default {
data() {
return {
num: 0,
jnjhl: 0
jnjhl: 0,
timeFun: null
};
},
components: {
@ -42,6 +43,12 @@ export default {
this.$nextTick(() => {
this.getData()
})
this.timeFun = setInterval(() => {
this.getData()
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
},
methods: {
getData() {

@ -50,7 +50,6 @@ export default {
this.timesFun = setInterval(() => {
this.time = this.$moment().format('HH:mm:ss')
}, 1000)
// this.timesFun()
},
methods: {
},

@ -50,18 +50,27 @@ export default {
today:this.$moment().format('YYYY-MM-DD'),
month:this.$moment().format('YYYY-MM'),
year:this.$moment().format('YYYY'),
timeFun: null,
params: null
};
},
components: {
tit
},
created() {
let params = {currentYear:this.year}
this.getData(params)
this.params = {currentYear:this.year}
this.getData()
this.timeFun = setInterval(() => {
this.getData()
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
},
methods: {
getData(params){
getEnterprisePower(params).then(res =>{
getData(){
getEnterprisePower(this.params).then(res =>{
console.log('res ===>',res)
this.tableData = res.data.data
})
@ -77,9 +86,9 @@ export default {
},
timeClick(index) {
this.timeActiveIndex1 = index;
let params = index == 0 ? {currentYear:this.year} : index == 1 ? {currentMonth:this.month} : index == 2 ? {today:this.today} : ''
console.log('params ====>',params)
this.getData(params)
this.params = index == 0 ? {currentYear:this.year} : index == 1 ? {currentMonth:this.month} : index == 2 ? {today:this.today} : ''
console.log('params ====>',this.params)
this.getData()
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 === 0) {

Loading…
Cancel
Save