| | |
| | | XData: [0], |
| | | YData: [0], |
| | | isLazyRequest: '',// 是否开启懒加载 |
| | | requestAlldataSize: 8,// 总共请求的列表项数目 |
| | | requestAllDataSize: 8,// 总共请求的列表项数目 |
| | | everyRequestDataSize: 15,// 每次请求的列表项数目 |
| | | toggleSearchStatus: false |
| | | } |
| | |
| | | * 生命周期 挂载前 |
| | | * */ |
| | | created() { |
| | | this.searchReset() |
| | | this.queryGroup() |
| | | this.getDriveTypeByApi() |
| | | this.initDictData('device_level') |
| | |
| | | }, |
| | | mounted() { |
| | | this.tableScroll = document.querySelector('.table2') |
| | | this.searchReset() |
| | | window.addEventListener('resize', this.handleWindowResize) |
| | | }, |
| | | beforeDestroy() { |
| | |
| | | this.tableHeads = [] |
| | | this.dataList = [] |
| | | // 若日期选择器设置的查询请求数量超过15条则开启懒加载 |
| | | if (this.requestAlldataSize > 15) { |
| | | if (this.requestAllDataSize > 15) { |
| | | // 开启懒加载后将结束日期设置为开始日期之后的14天,即先查询15天内的数据 |
| | | this.queryParam.endDate = moment(this.queryParam.startDate).add(this.everyRequestDataSize - 1, 'days').format('YYYYMMDD') |
| | | this.isLazyRequest = true |
| | |
| | | this.queryParam.parentId = this.queryParamPeople.parentId |
| | | this.queryParam.equipmentId = '' |
| | | } |
| | | this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1 |
| | | this.requestAllDataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1 |
| | | |
| | | Object.keys(this.queryParams).forEach(item => { |
| | | if (Array.isArray(this.queryParams[item])) { |
| | |
| | | } |
| | | this.queryParam = {} |
| | | this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] |
| | | this.requestAllDataSize = this.dates[1].diff(this.dates[0],'days') + 1 |
| | | this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') |
| | | this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') |
| | | this.loadData() |