mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-11 00:55:34 +00:00
优化甘特图
This commit is contained in:
parent
c53db63cc7
commit
5497bd97b2
@ -16,7 +16,7 @@
|
||||
:name="item.id"
|
||||
:class="{'dropdown-active':filtrProjectId == item.id}">
|
||||
{{ item.name }}
|
||||
<span v-if="item.tasks">({{ item.tasks.length }})</span>
|
||||
<span v-if="item.tasks">({{ filtrLength(item.tasks) }})</span>
|
||||
</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
@ -39,7 +39,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
import {mapGetters, mapState} from "vuex";
|
||||
import GanttView from "../../../components/GanttView";
|
||||
|
||||
export default {
|
||||
@ -49,6 +49,9 @@ export default {
|
||||
projectColumn: {
|
||||
default: []
|
||||
},
|
||||
flowInfo: {
|
||||
default: {}
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@ -105,12 +108,18 @@ export default {
|
||||
computed: {
|
||||
...mapState(['userId', 'windowWidth', 'taskPriority']),
|
||||
|
||||
...mapGetters(['projectParameter']),
|
||||
|
||||
menuWidth() {
|
||||
return this.windowWidth < 1440 ? 180 : 260;
|
||||
},
|
||||
|
||||
dropStyle() {
|
||||
return this.windowWidth < 1440 ? {left: '142px'} : {};
|
||||
},
|
||||
|
||||
completedTask() {
|
||||
return this.projectParameter('completedTask');
|
||||
}
|
||||
},
|
||||
|
||||
@ -120,6 +129,15 @@ export default {
|
||||
this.initData();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
flowInfo: {
|
||||
handler() {
|
||||
this.initData();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
completedTask() {
|
||||
this.initData();
|
||||
}
|
||||
},
|
||||
|
||||
@ -129,6 +147,18 @@ export default {
|
||||
this.projectColumn && this.projectColumn.some(this.checkAdd);
|
||||
},
|
||||
|
||||
filtrLength(list) {
|
||||
return list.filter(taskData => {
|
||||
if (taskData.complete_at && !this.completedTask) {
|
||||
return false;
|
||||
}
|
||||
if (this.flowInfo.value > 0 && taskData.flow_item_id !== this.flowInfo.value) {
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
}).length
|
||||
},
|
||||
|
||||
checkAdd(item) {
|
||||
if (this.filtrProjectId > 0) {
|
||||
if (item.id != this.filtrProjectId) {
|
||||
@ -141,18 +171,20 @@ export default {
|
||||
let start = times.start;
|
||||
let end = times.end;
|
||||
//
|
||||
let color = '#058ce4';
|
||||
if (taskData.complete_at) {
|
||||
return;
|
||||
} else {
|
||||
// 等级颜色
|
||||
this.taskPriority.some(level => {
|
||||
if (level.priority === taskData.p_level) {
|
||||
color = level.color;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (taskData.complete_at && !this.completedTask) {
|
||||
return false;
|
||||
}
|
||||
if (this.flowInfo.value > 0 && taskData.flow_item_id !== this.flowInfo.value) {
|
||||
return false;
|
||||
}
|
||||
// 等级颜色
|
||||
let color = '#058ce4';
|
||||
this.taskPriority.some(level => {
|
||||
if (level.priority === taskData.p_level) {
|
||||
color = level.color;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
//
|
||||
let tempTime = {start, end};
|
||||
let bakTime = $A.cloneJSON(tempTime)
|
||||
|
||||
@ -315,7 +315,7 @@
|
||||
</div>
|
||||
<div v-else-if="tabTypeActive === 'gantt'" class="project-gantt">
|
||||
<!--甘特图-->
|
||||
<ProjectGantt :projectColumn="columnList"/>
|
||||
<ProjectGantt :projectColumn="columnList" :flowInfo="flowInfo"/>
|
||||
</div>
|
||||
<!--项目设置-->
|
||||
<Modal
|
||||
@ -1302,6 +1302,7 @@ export default {
|
||||
},
|
||||
|
||||
getFlowData() {
|
||||
this.flowInfo = {}
|
||||
this.$store.dispatch("call", {
|
||||
url: 'project/flow/list',
|
||||
data: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user