From cea821e59281eeda798851ebfcb546188ae1af29 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 18 Nov 2025 11:13:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20base=20=E5=8F=91=E8=B5=B7=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wf/myticket.vue | 44 ++++++++++++++++++++++++++++----------- src/views/wf/workflow.vue | 8 +++++++ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/views/wf/myticket.vue b/src/views/wf/myticket.vue index 9578e821..c6873ab2 100644 --- a/src/views/wf/myticket.vue +++ b/src/views/wf/myticket.vue @@ -15,13 +15,19 @@ @change="handleQuery" clearable style="margin-left: 2px" + > + + - {{ item.name }} +
+

{{ group.category }}

+ + {{ item.name }} + +
@@ -209,14 +220,23 @@ export default { methods: { getWfOptions() { let permissions = this.$TOOL.data.get("PERMISSIONS"); + const groups = {}; this.$API.wf.workflow.list.req({ page: 0 }).then((res) => { - let wfOptions = []; res.forEach((item) => { if(item.key && permissions.includes(item.key)) { - wfOptions.push(item) + let cate = item.cate; + if (!cate){cate="未分组"} + if (!groups[cate]) { + groups[cate] = []; + } + groups[cate].push(item); } }) - this.wfOptions = wfOptions; + // 转换为数组形式,便于模板遍历 + this.wfOptions = Object.keys(groups).map(category => ({ + category, + items: groups[category] + })); }); }, reStart(row) { diff --git a/src/views/wf/workflow.vue b/src/views/wf/workflow.vue index 1d62807d..a133cfae 100644 --- a/src/views/wf/workflow.vue +++ b/src/views/wf/workflow.vue @@ -38,6 +38,11 @@ prop="name" width="220" > + + + +