mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
perf: 优化任务时间冲突提示
This commit is contained in:
parent
12c74aef7a
commit
07d583f73f
@ -1159,6 +1159,7 @@ class ProjectController extends AbstractController
|
|||||||
$list = ProjectTask::with(['taskUser'])
|
$list = ProjectTask::with(['taskUser'])
|
||||||
->select([
|
->select([
|
||||||
'projects.name as project_name',
|
'projects.name as project_name',
|
||||||
|
'project_tasks.project_id',
|
||||||
'project_tasks.id',
|
'project_tasks.id',
|
||||||
'project_tasks.name',
|
'project_tasks.name',
|
||||||
'project_tasks.start_at',
|
'project_tasks.start_at',
|
||||||
|
|||||||
@ -11,13 +11,15 @@
|
|||||||
<ListItem v-for="(items, userid) in tipsTask" :key="userid">
|
<ListItem v-for="(items, userid) in tipsTask" :key="userid">
|
||||||
<div class="list-content">
|
<div class="list-content">
|
||||||
<UserAvatar :userid="userid" :size="28" :show-icon="true" :show-name="true"/>
|
<UserAvatar :userid="userid" :size="28" :show-icon="true" :show-name="true"/>
|
||||||
<div class="list-task" v-for="(item, key) in items" :key="key">
|
<template v-for="data in formatItems(items)">
|
||||||
<div class="list-task-info">
|
<div class="list-task label">
|
||||||
<span>[{{ item.project_name }}] </span>
|
<div class="list-task-name" :title="data.project_name">{{ data.project_name }}</div>
|
||||||
<span :title="item.name">{{ item.name }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="list-task-date">{{ getCutTime(item) }}</div>
|
<div class="list-task" v-for="(item, key) in data.list" :key="key">
|
||||||
</div>
|
<div class="list-task-name" :title="item.name">{{ item.name }}</div>
|
||||||
|
<div class="list-task-date">{{ getCutTime(item) }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
@ -87,7 +89,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.show = true;
|
this.show = true;
|
||||||
let taskObj = {}
|
const taskObj = {}
|
||||||
userids.map(userid => {
|
userids.map(userid => {
|
||||||
data.data.map(h => {
|
data.data.map(h => {
|
||||||
if ((h.task_user || []).map(k => k.owner ? k.userid : 0).indexOf(userid) !== -1) {
|
if ((h.task_user || []).map(k => k.owner ? k.userid : 0).indexOf(userid) !== -1) {
|
||||||
@ -102,6 +104,22 @@ export default {
|
|||||||
resolve(true)
|
resolve(true)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
formatItems(items) {
|
||||||
|
return Array.from(
|
||||||
|
items.reduce((map, item) => {
|
||||||
|
if (!map.has(item.project_id)) {
|
||||||
|
map.set(item.project_id, {
|
||||||
|
project_id: item.project_id,
|
||||||
|
project_name: item.project_name,
|
||||||
|
list: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
map.get(item.project_id).list.push(item);
|
||||||
|
return map;
|
||||||
|
}, new Map()).values()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,20 +16,20 @@
|
|||||||
margin-left: 34px;
|
margin-left: 34px;
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
&.label {
|
||||||
|
color: #a7abb5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-task-info {
|
.list-task-name {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
padding-right: 12px;
|
padding-right: 12px;
|
||||||
span:first-child {
|
|
||||||
color: #A7ABB5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-task-date {
|
.list-task-date {
|
||||||
//float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user