mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 21:02:49 +00:00
perf: 优化项目面板
This commit is contained in:
parent
8cbae629a5
commit
a1ce6e6928
@ -527,6 +527,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {debounce} from "lodash";
|
||||||
import Draggable from 'vuedraggable'
|
import Draggable from 'vuedraggable'
|
||||||
import TaskPriority from "./TaskPriority";
|
import TaskPriority from "./TaskPriority";
|
||||||
import {mapGetters, mapState} from "vuex";
|
import {mapGetters, mapState} from "vuex";
|
||||||
@ -987,11 +988,20 @@ export default {
|
|||||||
handler(val) {
|
handler(val) {
|
||||||
if (val > 0) {
|
if (val > 0) {
|
||||||
this.getFlowData();
|
this.getFlowData();
|
||||||
this.$nextTick(this.handleColumnScroll);
|
this.handleColumnDebounce();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
|
'allTask.length'() {
|
||||||
|
this.handleColumnDebounce();
|
||||||
|
},
|
||||||
|
'projectData.cacheParameter.completedTask'() {
|
||||||
|
this.handleColumnDebounce();
|
||||||
|
},
|
||||||
|
windowWidth() {
|
||||||
|
this.handleColumnDebounce();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -1658,6 +1668,17 @@ export default {
|
|||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleColumnDebounce() {
|
||||||
|
if (!this.columnDebounceInvoke) {
|
||||||
|
this.columnDebounceInvoke = debounce(_ => {
|
||||||
|
if (this.tabTypeActive === 'column') {
|
||||||
|
this.$nextTick(this.handleColumnScroll)
|
||||||
|
}
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
this.columnDebounceInvoke();
|
||||||
|
},
|
||||||
|
|
||||||
handleColumnScroll() {
|
handleColumnScroll() {
|
||||||
this.columnList.forEach(({id}) => {
|
this.columnList.forEach(({id}) => {
|
||||||
const ref = this.$refs[`column_${id}`];
|
const ref = this.$refs[`column_${id}`];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user