mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 20:12:48 +00:00
perf: 优化项目面板
This commit is contained in:
parent
8cbae629a5
commit
a1ce6e6928
@ -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}`];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user