mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
perf: 优化已归档/已删除任务列表支持按状态检索
This commit is contained in:
parent
8545e0692c
commit
f931567f56
@ -23,9 +23,18 @@
|
|||||||
<div class="search-content">
|
<div class="search-content">
|
||||||
<Select v-model="keys.status" :placeholder="$L('全部')">
|
<Select v-model="keys.status" :placeholder="$L('全部')">
|
||||||
<Option value="">{{$L('全部')}}</Option>
|
<Option value="">{{$L('全部')}}</Option>
|
||||||
<Option v-for="flow in flows" :key="flow.id" :value="flow.id" :label="flow.name">
|
<template v-if="flows.type==='group'">
|
||||||
<div class="tag-dot" :class="flow.status">{{flow.name}}</div>
|
<OptionGroup v-for="group in flows.groups" :label="group.label">
|
||||||
</Option>
|
<Option v-for="item in group.items" :value="item.id" :label="item.name">
|
||||||
|
<div class="tag-dot" :class="item.status">{{item.name}}</div>
|
||||||
|
</Option>
|
||||||
|
</OptionGroup>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<Option v-for="item in flows.items" :value="item.id" :label="item.name">
|
||||||
|
<div class="tag-dot" :class="item.status">{{item.name}}</div>
|
||||||
|
</Option>
|
||||||
|
</template>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -323,7 +332,18 @@ export default {
|
|||||||
...mapState(['cacheTasks']),
|
...mapState(['cacheTasks']),
|
||||||
|
|
||||||
flows({flowList}) {
|
flows({flowList}) {
|
||||||
const list = [
|
const flowItems = [];
|
||||||
|
flowList.forEach(item1 => {
|
||||||
|
item1.project_flow_item.forEach(item2 => {
|
||||||
|
const label = flowList.length > 1 ? item1.name + ' - ' + item2.name : item2.name;
|
||||||
|
flowItems.push({
|
||||||
|
...item2,
|
||||||
|
id: 'flow-' + item2.id,
|
||||||
|
label,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
const stateItem = [
|
||||||
{
|
{
|
||||||
id: 'completed',
|
id: 'completed',
|
||||||
name: this.$L('已完成'),
|
name: this.$L('已完成'),
|
||||||
@ -337,17 +357,24 @@ export default {
|
|||||||
label: this.$L('未完成'),
|
label: this.$L('未完成'),
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
flowList.forEach(item1 => {
|
if (flowItems.length > 0) {
|
||||||
item1.project_flow_item.forEach(item2 => {
|
return {
|
||||||
const label = flowList.length > 1 ? item1.name + ' - ' + item2.name : item2.name;
|
type: 'group',
|
||||||
list.push({
|
groups: [
|
||||||
...item2,
|
{
|
||||||
id: 'flow-' + item2.id,
|
label: this.$L('按工作流'),
|
||||||
label,
|
items: flowItems
|
||||||
})
|
}, {
|
||||||
})
|
label: this.$L('按状态'),
|
||||||
});
|
items: stateItem
|
||||||
return list;
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
type: 'normal',
|
||||||
|
items: stateItem
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@ -23,9 +23,18 @@
|
|||||||
<div class="search-content">
|
<div class="search-content">
|
||||||
<Select v-model="keys.status" :placeholder="$L('全部')">
|
<Select v-model="keys.status" :placeholder="$L('全部')">
|
||||||
<Option value="">{{$L('全部')}}</Option>
|
<Option value="">{{$L('全部')}}</Option>
|
||||||
<Option v-for="flow in flows" :key="flow.id" :value="flow.id" :label="flow.name">
|
<template v-if="flows.type==='group'">
|
||||||
<div class="tag-dot" :class="flow.status">{{flow.name}}</div>
|
<OptionGroup v-for="group in flows.groups" :label="group.label">
|
||||||
</Option>
|
<Option v-for="item in group.items" :value="item.id" :label="item.name">
|
||||||
|
<div class="tag-dot" :class="item.status">{{item.name}}</div>
|
||||||
|
</Option>
|
||||||
|
</OptionGroup>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<Option v-for="item in flows.items" :value="item.id" :label="item.name">
|
||||||
|
<div class="tag-dot" :class="item.status">{{item.name}}</div>
|
||||||
|
</Option>
|
||||||
|
</template>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -230,7 +239,18 @@ export default {
|
|||||||
...mapState(['cacheTasks']),
|
...mapState(['cacheTasks']),
|
||||||
|
|
||||||
flows({flowList}) {
|
flows({flowList}) {
|
||||||
const list = [
|
const flowItems = [];
|
||||||
|
flowList.forEach(item1 => {
|
||||||
|
item1.project_flow_item.forEach(item2 => {
|
||||||
|
const label = flowList.length > 1 ? item1.name + ' - ' + item2.name : item2.name;
|
||||||
|
flowItems.push({
|
||||||
|
...item2,
|
||||||
|
id: 'flow-' + item2.id,
|
||||||
|
label,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
const stateItem = [
|
||||||
{
|
{
|
||||||
id: 'completed',
|
id: 'completed',
|
||||||
name: this.$L('已完成'),
|
name: this.$L('已完成'),
|
||||||
@ -244,17 +264,24 @@ export default {
|
|||||||
label: this.$L('未完成'),
|
label: this.$L('未完成'),
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
flowList.forEach(item1 => {
|
if (flowItems.length > 0) {
|
||||||
item1.project_flow_item.forEach(item2 => {
|
return {
|
||||||
const label = flowList.length > 1 ? item1.name + ' - ' + item2.name : item2.name;
|
type: 'group',
|
||||||
list.push({
|
groups: [
|
||||||
...item2,
|
{
|
||||||
id: 'flow-' + item2.id,
|
label: this.$L('按工作流'),
|
||||||
label,
|
items: flowItems
|
||||||
})
|
}, {
|
||||||
})
|
label: this.$L('按状态'),
|
||||||
});
|
items: stateItem
|
||||||
return list;
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
type: 'normal',
|
||||||
|
items: stateItem
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user