From 869d6eb1b4a737917ed2144c91824b18422342f3 Mon Sep 17 00:00:00 2001 From: yy2205 <2238220225@qq.com> Date: Mon, 21 Apr 2025 09:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=99=8D=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sta/index.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/views/sta/index.vue b/src/views/sta/index.vue index 75c61a5..857b286 100644 --- a/src/views/sta/index.vue +++ b/src/views/sta/index.vue @@ -26,11 +26,11 @@ + :data="data1" show-summary max-height="650" + default-expand-all + row-key="orgname" + :tree-props="{ children: 'children' }" + :default-sort="{ prop: 'sum', order: 'descending' }"> @@ -39,7 +39,7 @@ - + @@ -198,10 +198,13 @@ const dataProcessing = (data) => { const child = { ...current }; delete child.orgname; acc[key].children.push(child); + acc[key].children.sort((a, b) => b.sum - a.sum); return acc; }, {}); + let value = Object.values(result) + value.sort((a, b) => b.sum - a.sum); - return Object.values(result); + return value; } onMounted(()=>{ changeRadio(3)