轮询接口

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

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

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

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

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

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

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

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

Loading…
Cancel
Save