|
@ -34,7 +34,7 @@ export default { |
|
|
|
|
|
|
|
|
computed: { |
|
|
computed: { |
|
|
...mapState('role', ['visibleRoles']), |
|
|
...mapState('role', ['visibleRoles']), |
|
|
...mapState('task', ['scrollTop', 'showTips', 'tasks', 'topEnd', 'bottomEnd']), |
|
|
...mapState('task', ['scrollTop', 'showTips', 'tasks', 'topEnd', 'bottomEnd', 'showSkeleton', 'randomId']), |
|
|
...mapGetters('task', ['timeGranularity']), |
|
|
...mapGetters('task', ['timeGranularity']), |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -54,25 +54,49 @@ export default { |
|
|
|
|
|
|
|
|
// 滚动到顶部 |
|
|
// 滚动到顶部 |
|
|
async handleScrollTop() { |
|
|
async handleScrollTop() { |
|
|
if (!this.tasks || !this.tasks.length) return; |
|
|
if (!this.tasks || !this.tasks.length || this.showSkeleton) return; |
|
|
const startTime = this.tasks[0].planStart - 0; |
|
|
const startTime = this.tasks[0].planStart - 0; |
|
|
if ((this.tasks[0].plugins && this.tasks[0].plugins.length === 0) || this.topEnd) { |
|
|
if ((this.tasks[0].plugins && this.tasks[0].plugins.length === 0) || this.topEnd) { |
|
|
// 没有数据时 自动加载数据 |
|
|
// 没有数据时 自动加载数据 |
|
|
// console.warn('滚动到顶部没有数据时: '); |
|
|
// console.warn('滚动到顶部没有数据时: '); |
|
|
const addTasks = [ |
|
|
const addTasks = [ |
|
|
{ |
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
|
|
|
panel: {}, |
|
|
|
|
|
plugins: [], |
|
|
|
|
|
process: 4, |
|
|
|
|
|
planStart: this.$t.time.add(startTime, -6, 'day').valueOf(), |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
|
|
|
panel: {}, |
|
|
|
|
|
plugins: [], |
|
|
|
|
|
process: 4, |
|
|
|
|
|
planStart: this.$t.time.add(startTime, -5, 'day').valueOf(), |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
|
|
|
panel: {}, |
|
|
|
|
|
plugins: [], |
|
|
|
|
|
process: 4, |
|
|
|
|
|
planStart: this.$t.time.add(startTime, -4, 'day').valueOf(), |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
panel: {}, |
|
|
panel: {}, |
|
|
plugins: [], |
|
|
plugins: [], |
|
|
process: 4, |
|
|
process: 4, |
|
|
planStart: this.$t.time.add(startTime, -3, 'day').valueOf(), |
|
|
planStart: this.$t.time.add(startTime, -3, 'day').valueOf(), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
panel: {}, |
|
|
panel: {}, |
|
|
plugins: [], |
|
|
plugins: [], |
|
|
process: 4, |
|
|
process: 4, |
|
|
planStart: this.$t.time.add(startTime, -2, 'day').valueOf(), |
|
|
planStart: this.$t.time.add(startTime, -2, 'day').valueOf(), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
panel: {}, |
|
|
panel: {}, |
|
|
plugins: [], |
|
|
plugins: [], |
|
|
process: 4, |
|
|
process: 4, |
|
@ -95,7 +119,7 @@ export default { |
|
|
|
|
|
|
|
|
// 滚动到底部 |
|
|
// 滚动到底部 |
|
|
async handleScrollBottom() { |
|
|
async handleScrollBottom() { |
|
|
if (!this.tasks || !this.tasks.length) return; |
|
|
if (!this.tasks || !this.tasks.length || this.showSkeleton) return; |
|
|
const { tasks, timeGranularity } = this; |
|
|
const { tasks, timeGranularity } = this; |
|
|
const startTime = tasks[tasks.length - 1].planStart - 0; |
|
|
const startTime = tasks[tasks.length - 1].planStart - 0; |
|
|
if ((tasks[0].plugins && tasks[0].plugins.length === 0) || this.bottomEnd) { |
|
|
if ((tasks[0].plugins && tasks[0].plugins.length === 0) || this.bottomEnd) { |
|
@ -103,23 +127,47 @@ export default { |
|
|
// console.warn('滚动到底部没有数据时: '); |
|
|
// console.warn('滚动到底部没有数据时: '); |
|
|
const addTasks = [ |
|
|
const addTasks = [ |
|
|
{ |
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
panel: {}, |
|
|
panel: {}, |
|
|
plugins: [], |
|
|
plugins: [], |
|
|
process: 4, |
|
|
process: 4, |
|
|
planStart: this.$t.time.add(startTime, 1, timeGranularity).valueOf(), |
|
|
planStart: this.$t.time.add(startTime, 1, timeGranularity).valueOf(), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
panel: {}, |
|
|
panel: {}, |
|
|
plugins: [], |
|
|
plugins: [], |
|
|
process: 4, |
|
|
process: 4, |
|
|
planStart: this.$t.time.add(startTime, 2, timeGranularity).valueOf(), |
|
|
planStart: this.$t.time.add(startTime, 2, timeGranularity).valueOf(), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
panel: {}, |
|
|
panel: {}, |
|
|
plugins: [], |
|
|
plugins: [], |
|
|
process: 4, |
|
|
process: 4, |
|
|
planStart: this.$t.time.add(startTime, 3, timeGranularity).valueOf(), |
|
|
planStart: this.$t.time.add(startTime, 3, timeGranularity).valueOf(), |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
|
|
|
panel: {}, |
|
|
|
|
|
plugins: [], |
|
|
|
|
|
process: 4, |
|
|
|
|
|
planStart: this.$t.time.add(startTime, 4, timeGranularity).valueOf(), |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
|
|
|
panel: {}, |
|
|
|
|
|
plugins: [], |
|
|
|
|
|
process: 4, |
|
|
|
|
|
planStart: this.$t.time.add(startTime, 5, timeGranularity).valueOf(), |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: this.randomId, |
|
|
|
|
|
panel: {}, |
|
|
|
|
|
plugins: [], |
|
|
|
|
|
process: 4, |
|
|
|
|
|
planStart: this.$t.time.add(startTime, 6, timeGranularity).valueOf(), |
|
|
|
|
|
}, |
|
|
]; |
|
|
]; |
|
|
this.setDownTasks(addTasks); |
|
|
this.setDownTasks(addTasks); |
|
|
} else { |
|
|
} else { |
|
|