diff --git a/resources/assets/js/pages/manage/components/TaskArchived.vue b/resources/assets/js/pages/manage/components/TaskArchived.vue
index f37a7e02a..3987f35b2 100644
--- a/resources/assets/js/pages/manage/components/TaskArchived.vue
+++ b/resources/assets/js/pages/manage/components/TaskArchived.vue
@@ -23,9 +23,18 @@
@@ -323,7 +332,18 @@ export default {
...mapState(['cacheTasks']),
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',
name: this.$L('已完成'),
@@ -337,17 +357,24 @@ export default {
label: this.$L('未完成'),
}
];
- flowList.forEach(item1 => {
- item1.project_flow_item.forEach(item2 => {
- const label = flowList.length > 1 ? item1.name + ' - ' + item2.name : item2.name;
- list.push({
- ...item2,
- id: 'flow-' + item2.id,
- label,
- })
- })
- });
- return list;
+ if (flowItems.length > 0) {
+ return {
+ type: 'group',
+ groups: [
+ {
+ label: this.$L('按工作流'),
+ items: flowItems
+ }, {
+ label: this.$L('按状态'),
+ items: stateItem
+ }
+ ],
+ }
+ }
+ return {
+ type: 'normal',
+ items: stateItem
+ };
}
},
watch: {
diff --git a/resources/assets/js/pages/manage/components/TaskDeleted.vue b/resources/assets/js/pages/manage/components/TaskDeleted.vue
index abb82eeff..f6ae6776f 100644
--- a/resources/assets/js/pages/manage/components/TaskDeleted.vue
+++ b/resources/assets/js/pages/manage/components/TaskDeleted.vue
@@ -23,9 +23,18 @@
@@ -230,7 +239,18 @@ export default {
...mapState(['cacheTasks']),
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',
name: this.$L('已完成'),
@@ -244,17 +264,24 @@ export default {
label: this.$L('未完成'),
}
];
- flowList.forEach(item1 => {
- item1.project_flow_item.forEach(item2 => {
- const label = flowList.length > 1 ? item1.name + ' - ' + item2.name : item2.name;
- list.push({
- ...item2,
- id: 'flow-' + item2.id,
- label,
- })
- })
- });
- return list;
+ if (flowItems.length > 0) {
+ return {
+ type: 'group',
+ groups: [
+ {
+ label: this.$L('按工作流'),
+ items: flowItems
+ }, {
+ label: this.$L('按状态'),
+ items: stateItem
+ }
+ ],
+ }
+ }
+ return {
+ type: 'normal',
+ items: stateItem
+ };
}
},
watch: {