From f931567f560ca30ea816836baf37668175f7b32c Mon Sep 17 00:00:00 2001 From: kuaifan Date: Mon, 21 Apr 2025 20:14:31 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=B7=B2=E5=BD=92?= =?UTF-8?q?=E6=A1=A3/=E5=B7=B2=E5=88=A0=E9=99=A4=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=94=AF=E6=8C=81=E6=8C=89=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/manage/components/TaskArchived.vue | 57 ++++++++++++++----- .../pages/manage/components/TaskDeleted.vue | 57 ++++++++++++++----- 2 files changed, 84 insertions(+), 30 deletions(-) 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: {