|
|
@ -53,7 +53,7 @@ export default { |
|
|
|
async handleScrollTop() { |
|
|
|
if (!this.tasks || !this.tasks.length || this.showSkeleton) return; |
|
|
|
const startTime = this.tasks[0].planStart - 0; |
|
|
|
if ((this.tasks[0].plugins && this.tasks[0].plugins.length === 0) || this.topEnd) { |
|
|
|
if (this.topEnd) { |
|
|
|
// 没有数据时 自动加载数据 |
|
|
|
console.warn('滚动到顶部没有数据时: '); |
|
|
|
const addTasks = setPlaceholderTasks(startTime, true, this.timeGranularity); |
|
|
@ -61,8 +61,10 @@ export default { |
|
|
|
} else { |
|
|
|
// 有数据时 |
|
|
|
console.warn('滚动到顶部有数据时: '); |
|
|
|
const detailId = this.tasks.findIndex(task => task.detailId); |
|
|
|
const timeNode = this.tasks[detailId].planStart - 0; |
|
|
|
const upQuery = { |
|
|
|
timeNode: startTime, |
|
|
|
timeNode, |
|
|
|
queryType: 0, |
|
|
|
queryNum: 6, |
|
|
|
}; |
|
|
@ -75,7 +77,7 @@ export default { |
|
|
|
if (!this.tasks || !this.tasks.length || this.showSkeleton) return; |
|
|
|
const { tasks, timeGranularity } = this; |
|
|
|
const startTime = tasks[tasks.length - 1].planStart - 0; |
|
|
|
if ((tasks[0].plugins && tasks[0].plugins.length === 0) || this.bottomEnd) { |
|
|
|
if (this.bottomEnd) { |
|
|
|
// 没有数据时 自动加载数据 |
|
|
|
console.warn('滚动到底部没有数据时: '); |
|
|
|
const addTasks = setPlaceholderTasks(startTime, false, this.timeGranularity); |
|
|
@ -83,9 +85,15 @@ export default { |
|
|
|
} else { |
|
|
|
// 时间基准点=最后一个任务的开始时间+当前时间颗粒度 |
|
|
|
console.warn('滚动到底部有数据时: '); |
|
|
|
const timeNode = this.$t.time.add(startTime, 1, timeGranularity).valueOf(); |
|
|
|
const arr = []; |
|
|
|
this.tasks.forEach(task => { |
|
|
|
if (task.detailId) { |
|
|
|
arr.push(task); |
|
|
|
} |
|
|
|
}); |
|
|
|
const nextQueryTime = +this.$t.time.add(+arr[arr.length - 1].planStart, 1, timeGranularity); |
|
|
|
const downQuery = { |
|
|
|
timeNode, |
|
|
|
timeNode: nextQueryTime, |
|
|
|
queryType: 1, |
|
|
|
queryNum: 6, |
|
|
|
}; |
|
|
|