|
@@ -51,10 +51,10 @@ export default { |
|
|
components: {}, |
|
|
components: {}, |
|
|
props: {}, |
|
|
props: {}, |
|
|
data() { |
|
|
data() { |
|
|
const now = new Date(); |
|
|
|
|
|
|
|
|
// const now = new Date().getTime(); |
|
|
// const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()]; |
|
|
// const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()]; |
|
|
const today = new Date().getTime(); |
|
|
const today = new Date().getTime(); |
|
|
const tenminAgo = today - (10 * 60 * 1000); |
|
|
|
|
|
|
|
|
const tenminAgo = new Date(today - (10 * 60 * 1000)).getTime(); |
|
|
return { |
|
|
return { |
|
|
searchBarFormConfig: [ |
|
|
searchBarFormConfig: [ |
|
|
{ |
|
|
{ |
|
@@ -77,7 +77,7 @@ export default { |
|
|
dateType: 'datetimerange', // datetimerange |
|
|
dateType: 'datetimerange', // datetimerange |
|
|
format: 'yyyy-MM-dd HH:mm:ss', |
|
|
format: 'yyyy-MM-dd HH:mm:ss', |
|
|
// valueFormat: 'yyyy-MM-dd HH:mm:ss', |
|
|
// valueFormat: 'yyyy-MM-dd HH:mm:ss', |
|
|
valueFormat: 'timestamp', |
|
|
|
|
|
|
|
|
valueFormat: 'yyyy-MM-dd HH:mm:ss', |
|
|
rangeSeparator: '-', |
|
|
rangeSeparator: '-', |
|
|
startPlaceholder: '开始时间', |
|
|
startPlaceholder: '开始时间', |
|
|
endPlaceholder: '结束时间', |
|
|
endPlaceholder: '结束时间', |
|
@@ -94,8 +94,8 @@ export default { |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
queryParams: { |
|
|
queryParams: { |
|
|
id: null, |
|
|
|
|
|
time: [tenminAgo, today], |
|
|
|
|
|
|
|
|
equipmentId: null, |
|
|
|
|
|
recordTime: [parseTime(tenminAgo), parseTime(today)], |
|
|
}, |
|
|
}, |
|
|
tableList: [ |
|
|
tableList: [ |
|
|
// { |
|
|
// { |
|
@@ -118,7 +118,7 @@ export default { |
|
|
beforeRouteEnter(to, from, next) { |
|
|
beforeRouteEnter(to, from, next) { |
|
|
if (Object.keys(to.params).length > 0) { |
|
|
if (Object.keys(to.params).length > 0) { |
|
|
next((vm) => { |
|
|
next((vm) => { |
|
|
vm.$set(vm.queryParams, 'id', to.params.equipmentId); |
|
|
|
|
|
|
|
|
vm.$set(vm.queryParams, 'equipmentId', to.params.equipmentId); |
|
|
vm.$set( |
|
|
vm.$set( |
|
|
vm.searchBarFormConfig[0], |
|
|
vm.searchBarFormConfig[0], |
|
|
'defaultSelect', |
|
|
'defaultSelect', |
|
@@ -132,7 +132,7 @@ export default { |
|
|
vm.$set( |
|
|
vm.$set( |
|
|
vm.searchBarFormConfig[2], |
|
|
vm.searchBarFormConfig[2], |
|
|
'defaultSelect', |
|
|
'defaultSelect', |
|
|
vm.queryParams.time |
|
|
|
|
|
|
|
|
vm.queryParams.recordTime |
|
|
); |
|
|
); |
|
|
vm.handleQuery(); |
|
|
vm.handleQuery(); |
|
|
}); |
|
|
}); |
|
@@ -167,7 +167,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
beforeRouteLeave(to, from, next) { |
|
|
beforeRouteLeave(to, from, next) { |
|
|
// clean job |
|
|
// clean job |
|
|
this.$set(this.queryParams, 'id', null); |
|
|
|
|
|
|
|
|
this.$set(this.queryParams, 'equipmentId', null); |
|
|
this.$set(this.searchBarFormConfig[0], 'defaultSelect', null); |
|
|
this.$set(this.searchBarFormConfig[0], 'defaultSelect', null); |
|
|
this.$set(this.searchBarFormConfig[1], 'defaultSelect', null); |
|
|
this.$set(this.searchBarFormConfig[1], 'defaultSelect', null); |
|
|
this.tableList = []; |
|
|
this.tableList = []; |
|
@@ -204,7 +204,7 @@ export default { |
|
|
props.push({ |
|
|
props.push({ |
|
|
label: item.name, |
|
|
label: item.name, |
|
|
prop: item.name, |
|
|
prop: item.name, |
|
|
width: 128, |
|
|
|
|
|
|
|
|
// width: 128, |
|
|
}); |
|
|
}); |
|
|
firstLineData[item.name] = `${item.minValue ?? ''}-${ |
|
|
firstLineData[item.name] = `${item.minValue ?? ''}-${ |
|
|
item.maxValue ?? '' |
|
|
item.maxValue ?? '' |
|
@@ -280,14 +280,15 @@ export default { |
|
|
|
|
|
|
|
|
async handleSearchBarBtnClick({ btnName, timeVal }) { |
|
|
async handleSearchBarBtnClick({ btnName, timeVal }) { |
|
|
if (timeVal && timeVal.length > 0) { |
|
|
if (timeVal && timeVal.length > 0) { |
|
|
if (timeVal[1] - timeVal[0] <= 10 * 60 * 1000) { |
|
|
|
|
|
this.queryParams.time = timeVal; |
|
|
|
|
|
|
|
|
console.log('nihc ', timeVal) |
|
|
|
|
|
if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 10 * 60 * 1000) { |
|
|
|
|
|
this.queryParams.recordTime = timeVal; |
|
|
await this.handleQuery(); |
|
|
await this.handleQuery(); |
|
|
} else { |
|
|
} else { |
|
|
this.$message.warning('时间范围最大一小时限制!') |
|
|
this.$message.warning('时间范围最大一小时限制!') |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
this.queryParams.time = []; |
|
|
|
|
|
|
|
|
this.queryParams.recordTime = []; |
|
|
this.$message.warning('时间段必选!') |
|
|
this.$message.warning('时间段必选!') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|