|
|
|
@ -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) { |
|
|
|
|