轮询接口

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. 10
      src/views/energySources/component/equipmentAnalyze.vue
  4. 8
      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.$nextTick(() => {
this.getTotal() this.getTotal()
this.$nextTick(() => {
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.getPeriodData()
this.echartsInit() // this.$nextTick(() => {
})
// this.echartsInit()
// })
this.timeFun = setInterval(() => {
this.getPeriodData()
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
}, },
computed: { computed: {
...mapGetters(["userInfo", "permission"]), ...mapGetters(["userInfo", "permission"]),

@ -59,7 +59,8 @@ export default {
data() { data() {
return { return {
selectDay: "", selectDay: "",
tableData: [] tableData: [],
timeFun: null
}; };
}, },
components: { components: {
@ -71,6 +72,12 @@ export default {
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() {
@ -110,6 +117,7 @@ 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;
} }

@ -40,6 +40,12 @@ export default {
}, },
created() { created() {
this.getTableData() this.getTableData()
this.timeFun = setInterval(() => {
this.getTableData()
}, 300000)
},
beforeDestroyed() {
clearInterval(this.timeFun)
}, },
methods: { methods: {
getTableData() { getTableData() {
@ -80,6 +86,7 @@ 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