Compare commits
3 Commits
5dce57e4bb
...
7e2b75aaa5
Author | SHA1 | Date | |
---|---|---|---|
7e2b75aaa5 | |||
8ad9b9d717 | |||
3bf2757e42 |
@ -63,7 +63,7 @@ const tableProps = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
name: "EnergyPlc",
|
name: "EnergyQuantityRealtime",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formConfig: [
|
formConfig: [
|
||||||
@ -125,10 +125,34 @@ export default {
|
|||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
this.tableH = this.tableHeight(260)
|
this.tableH = this.tableHeight(260)
|
||||||
})
|
})
|
||||||
|
if (location.href.indexOf('?') > 0) {
|
||||||
|
let arr = location.href.split('?')[1].split('&')
|
||||||
|
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||||
|
} else {
|
||||||
|
this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||||
|
}
|
||||||
|
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
|
||||||
|
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getTypeList()
|
this.getTypeList()
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
$route: 'initData'
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
initData(to) {
|
||||||
|
if (to.name === 'EnergyQuantityRealtime') {
|
||||||
|
if (location.href.indexOf('?') > 0) {
|
||||||
|
let arr = location.href.split('?')[1].split('&')
|
||||||
|
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||||
|
} else {
|
||||||
|
this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||||
|
}
|
||||||
|
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
|
||||||
|
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1;
|
||||||
this.queryParams.energyTypeId = val.energyTypeId
|
this.queryParams.energyTypeId = val.energyTypeId
|
||||||
|
@ -80,8 +80,7 @@ export default {
|
|||||||
param: 'timeVal',
|
param: 'timeVal',
|
||||||
defaultSelect: [],
|
defaultSelect: [],
|
||||||
width: 350,
|
width: 350,
|
||||||
clearable: false,
|
clearable: false
|
||||||
required:true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@ -122,35 +121,11 @@ export default {
|
|||||||
this.tableH = this.tableHeight(260)
|
this.tableH = this.tableHeight(260)
|
||||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||||
})
|
})
|
||||||
if (location.href.indexOf('?') > 0) {
|
|
||||||
let arr = location.href.split('?')[1].split('&')
|
|
||||||
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
|
||||||
} else {
|
|
||||||
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
|
||||||
}
|
|
||||||
this.queryParams.startTime = this.formConfig[2].defaultSelect[0]
|
|
||||||
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
|
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getTypeList()
|
this.getTypeList()
|
||||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
$route: 'initData'
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
initData(to) {
|
|
||||||
if (to.name === 'EnergyReportSearch') {
|
|
||||||
if (location.href.indexOf('?') > 0) {
|
|
||||||
let arr = location.href.split('?')[1].split('&')
|
|
||||||
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
|
||||||
} else {
|
|
||||||
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
|
||||||
}
|
|
||||||
this.queryParams.startTime = this.formConfig[2].defaultSelect[0]
|
|
||||||
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getTypeList() {
|
getTypeList() {
|
||||||
getEnergyTypeListAll().then((res) => {
|
getEnergyTypeListAll().then((res) => {
|
||||||
this.formConfig[1].selectOptions = res.data || []
|
this.formConfig[1].selectOptions = res.data || []
|
||||||
|
@ -290,7 +290,8 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case '2': // 能源
|
case '2': // 能源
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
// path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
||||||
|
path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user