perf: 优化任务面板

This commit is contained in:
kuaifan 2024-12-22 17:45:58 +08:00
parent 14775e2861
commit b13758d3e9

View File

@ -1018,7 +1018,7 @@ export default {
this.handleColumnDebounce();
},
windowWidth() {
this.handleColumnDebounce();
this.handleColumnDebounce(100);
},
projectData() {
this.sortData = this.getSort();
@ -1697,7 +1697,14 @@ export default {
return style;
},
handleColumnDebounce() {
handleColumnDebounce(wait = 10) {
if (this.columnDebounceWait !== wait) {
this.columnDebounceWait = wait;
if (this.columnDebounceInvoke) {
this.columnDebounceInvoke.cancel();
this.columnDebounceInvoke = null;
}
}
if (!this.columnDebounceInvoke) {
this.columnDebounceInvoke = debounce(_ => {
this.$nextTick(_ => {
@ -1710,7 +1717,7 @@ export default {
break;
}
})
}, 10);
}, wait);
}
this.columnDebounceInvoke();
},