perf: 优化项目面板

This commit is contained in:
kuaifan 2024-12-14 23:21:41 +08:00
parent 8cbae629a5
commit a1ce6e6928

View File

@ -527,6 +527,7 @@
</template>
<script>
import {debounce} from "lodash";
import Draggable from 'vuedraggable'
import TaskPriority from "./TaskPriority";
import {mapGetters, mapState} from "vuex";
@ -987,11 +988,20 @@ export default {
handler(val) {
if (val > 0) {
this.getFlowData();
this.$nextTick(this.handleColumnScroll);
this.handleColumnDebounce();
}
},
immediate: true,
},
'allTask.length'() {
this.handleColumnDebounce();
},
'projectData.cacheParameter.completedTask'() {
this.handleColumnDebounce();
},
windowWidth() {
this.handleColumnDebounce();
}
},
methods: {
@ -1658,6 +1668,17 @@ export default {
return style;
},
handleColumnDebounce() {
if (!this.columnDebounceInvoke) {
this.columnDebounceInvoke = debounce(_ => {
if (this.tabTypeActive === 'column') {
this.$nextTick(this.handleColumnScroll)
}
}, 10);
}
this.columnDebounceInvoke();
},
handleColumnScroll() {
this.columnList.forEach(({id}) => {
const ref = this.$refs[`column_${id}`];