mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-16 14:12:51 +00:00
fix: 项目-任务列表tab修改,甘特图数据优化
This commit is contained in:
parent
07d864e48b
commit
f68226f4b4
2
resources/assets/js/functions/web.js
vendored
2
resources/assets/js/functions/web.js
vendored
@ -66,6 +66,8 @@
|
|||||||
return {
|
return {
|
||||||
project_id,
|
project_id,
|
||||||
card: true,
|
card: true,
|
||||||
|
menu: false,
|
||||||
|
gantt: false,
|
||||||
cardInit: false,
|
cardInit: false,
|
||||||
chat: false,
|
chat: false,
|
||||||
showMy: true,
|
showMy: true,
|
||||||
|
|||||||
@ -291,6 +291,7 @@ export default {
|
|||||||
type: type,
|
type: type,
|
||||||
clientX: e.clientX,
|
clientX: e.clientX,
|
||||||
value: item[type],
|
value: item[type],
|
||||||
|
time: item.time,
|
||||||
};
|
};
|
||||||
this.mouseItem = item;
|
this.mouseItem = item;
|
||||||
this.dateMove = null;
|
this.dateMove = null;
|
||||||
@ -299,7 +300,14 @@ export default {
|
|||||||
if (this.mouseItem != null) {
|
if (this.mouseItem != null) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var diff = e.clientX - this.mouseBak.clientX;
|
var diff = e.clientX - this.mouseBak.clientX;
|
||||||
if (diff < 0 && this.mouseItem.time.start > this.mouseItem.time.end) {
|
const {start, end} = this.mouseBak.time;
|
||||||
|
let date = new Date();
|
||||||
|
let nowTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0).getTime();
|
||||||
|
let diffStartDay = (start - nowTime) / 1000 / 60 / 60 / 24;
|
||||||
|
let diffEndDay = (end - nowTime) / 1000 / 60 / 60 / 24;
|
||||||
|
let width = this.dateWidth * (diffEndDay - diffStartDay);
|
||||||
|
width += this.mouseBak.value + diff;
|
||||||
|
if (width <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$set(this.mouseItem, this.mouseBak.type, this.mouseBak.value + diff);
|
this.$set(this.mouseItem, this.mouseBak.type, this.mouseBak.value + diff);
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
<div class="project-gstc-close" @click="$emit('on-close')"><Icon type="md-close" /></div>
|
|
||||||
<div class="project-gstc-edit" :class="{info:editShowInfo, visible:editData&&editData.length > 0}">
|
<div class="project-gstc-edit" :class="{info:editShowInfo, visible:editData&&editData.length > 0}">
|
||||||
<div class="project-gstc-edit-info">
|
<div class="project-gstc-edit-info">
|
||||||
<Table size="small" max-height="600" :columns="editColumns" :data="editData"></Table>
|
<Table size="small" max-height="600" :columns="editColumns" :data="editData"></Table>
|
||||||
|
|||||||
@ -81,10 +81,10 @@
|
|||||||
<span :class="`project-flow ${flowInfo.status}`">{{ flowTitle }}</span>
|
<span :class="`project-flow ${flowInfo.status}`">{{ flowTitle }}</span>
|
||||||
</Cascader>
|
</Cascader>
|
||||||
</div>
|
</div>
|
||||||
<div :class="['project-switch-button', !projectParameter('card') ? 'menu' : '']" @click="$store.dispatch('toggleProjectParameter', 'card')">
|
<div class="project-switch-button">
|
||||||
<div><i class="taskfont"></i></div>
|
<div @click="tabTypeChange('card')" :class="{ 'active': projectParameter('card')}"><i class="taskfont"></i></div>
|
||||||
<div><i class="taskfont"></i></div>
|
<div @click="tabTypeChange('menu')" :class="{ 'active': projectParameter('menu')}"><i class="taskfont"></i></div>
|
||||||
<div @click="projectGanttShow=!projectGanttShow"><i class="taskfont"></i></div>
|
<div @click="tabTypeChange('gantt')" :class="{ 'active': projectParameter('gantt')}"><i class="taskfont"></i></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -225,7 +225,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</Draggable>
|
</Draggable>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="project-table overlay-y">
|
<div v-if="projectParameter('menu')" class="project-table overlay-y">
|
||||||
<div class="project-table-head">
|
<div class="project-table-head">
|
||||||
<Row class="task-row">
|
<Row class="task-row">
|
||||||
<Col span="12"># {{$L('任务名称')}}</Col>
|
<Col span="12"># {{$L('任务名称')}}</Col>
|
||||||
@ -312,13 +312,11 @@
|
|||||||
<TaskRow v-if="projectParameter('showCompleted')" :list="completedList" open-key="completed" @on-priority="addTaskOpen" showCompleteAt/>
|
<TaskRow v-if="projectParameter('showCompleted')" :list="completedList" open-key="completed" @on-priority="addTaskOpen" showCompleteAt/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="project-table overlay-y" v-if="projectGanttShow">
|
<div v-if="projectParameter('gantt')" class="project-table overlay-y" style="position: relative">
|
||||||
<!-- 甘特图 -->
|
<!-- 甘特图 -->
|
||||||
<ProjectGantt v-if="projectGanttShow"
|
<ProjectGantt :lineData="ganttColumnList[0].tasks"
|
||||||
@on-close="projectGanttShow=false"
|
:projectLabel="ganttColumnList"
|
||||||
:lineData="columnList[0].tasks"
|
:lineTaskData="ganttColumnList[0].tasks"
|
||||||
:projectLabel="columnList"
|
|
||||||
:lineTaskData="columnList[0].tasks"
|
|
||||||
:levelList="taskPriority"></ProjectGantt>
|
:levelList="taskPriority"></ProjectGantt>
|
||||||
</div>
|
</div>
|
||||||
<!--项目设置-->
|
<!--项目设置-->
|
||||||
@ -527,7 +525,6 @@ export default {
|
|||||||
|
|
||||||
flowInfo: {},
|
flowInfo: {},
|
||||||
flowList: [],
|
flowList: [],
|
||||||
projectGanttShow: false,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -665,6 +662,26 @@ export default {
|
|||||||
return list;
|
return list;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ganttColumnList() {
|
||||||
|
const {projectId, cacheColumns} = this;
|
||||||
|
return cacheColumns.filter((row) => {
|
||||||
|
row.tasks = row.tasks.filter(task => {
|
||||||
|
return task.column_id == row.id && !task.complete_at;
|
||||||
|
}).sort((a, b) => {
|
||||||
|
if (a.sort != b.sort) {
|
||||||
|
return a.sort - b.sort;
|
||||||
|
}
|
||||||
|
return a.id - b.id;
|
||||||
|
});
|
||||||
|
return row.project_id == projectId && row.tasks.length > 0;
|
||||||
|
}).sort((a, b) => {
|
||||||
|
if (a.sort != b.sort) {
|
||||||
|
return a.sort - b.sort;
|
||||||
|
}
|
||||||
|
return a.id - b.id;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
myList() {
|
myList() {
|
||||||
const {allTask, taskCompleteTemps, sortField, sortType} = this;
|
const {allTask, taskCompleteTemps, sortField, sortType} = this;
|
||||||
let array = allTask.filter(task => this.myFilter(task));
|
let array = allTask.filter(task => this.myFilter(task));
|
||||||
@ -1380,6 +1397,38 @@ export default {
|
|||||||
expiresFormat(date) {
|
expiresFormat(date) {
|
||||||
return $A.countDownFormat(date, this.nowTime)
|
return $A.countDownFormat(date, this.nowTime)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
tabTypeChange(type) {
|
||||||
|
switch (type) {
|
||||||
|
case "card":
|
||||||
|
this.$store.dispatch('toggleProjectParameter', 'card');
|
||||||
|
if (this.projectParameter('card')) {
|
||||||
|
this.projectParameter('menu') ? this.$store.dispatch('toggleProjectParameter', 'menu') : '';
|
||||||
|
this.projectParameter('gantt') ? this.$store.dispatch('toggleProjectParameter', 'gantt') : '';
|
||||||
|
} else {
|
||||||
|
this.$store.dispatch('toggleProjectParameter', 'card');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "menu":
|
||||||
|
this.$store.dispatch('toggleProjectParameter', 'menu');
|
||||||
|
if (this.projectParameter('menu')) {
|
||||||
|
this.projectParameter('card') ? this.$store.dispatch('toggleProjectParameter', 'card') : '';
|
||||||
|
this.projectParameter('gantt') ? this.$store.dispatch('toggleProjectParameter', 'gantt') : '';
|
||||||
|
} else {
|
||||||
|
this.$store.dispatch('toggleProjectParameter', 'menu');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "gantt":
|
||||||
|
this.$store.dispatch('toggleProjectParameter', 'gantt');
|
||||||
|
if (this.projectParameter('gantt')) {
|
||||||
|
this.projectParameter('menu') ? this.$store.dispatch('toggleProjectParameter', 'menu') : '';
|
||||||
|
this.projectParameter('card') ? this.$store.dispatch('toggleProjectParameter', 'card') : '';
|
||||||
|
} else {
|
||||||
|
this.$store.dispatch('toggleProjectParameter', 'gantt');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -194,6 +194,13 @@
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: box-shadow 0.2s;
|
transition: box-shadow 0.2s;
|
||||||
|
.active {
|
||||||
|
color: $primary-color;
|
||||||
|
border-radius: 6px;
|
||||||
|
border: 1px solid $primary-color;
|
||||||
|
background-color: rgba($primary-color, 0.1);
|
||||||
|
transition: left 0.2s;
|
||||||
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
box-shadow: 0 0 10px #e6ecfa;
|
box-shadow: 0 0 10px #e6ecfa;
|
||||||
}
|
}
|
||||||
@ -205,11 +212,6 @@
|
|||||||
width: 33.3%;
|
width: 33.3%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
color: $primary-color;
|
|
||||||
border-radius: 6px;
|
|
||||||
border: 1px solid $primary-color;
|
|
||||||
background-color: rgba($primary-color, 0.1);
|
|
||||||
transition: left 0.2s;
|
|
||||||
}
|
}
|
||||||
> div {
|
> div {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@ -224,20 +226,6 @@
|
|||||||
> i {
|
> i {
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
&:first-child {
|
|
||||||
color: $primary-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.menu {
|
|
||||||
&:before {
|
|
||||||
left: 33.3%;
|
|
||||||
}
|
|
||||||
> div:first-child {
|
|
||||||
color: $primary-text-color;
|
|
||||||
}
|
|
||||||
> div:last-child {
|
|
||||||
color: $primary-color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user