From 4c9fdc87987140e8b2c3f0dfc2f6608cdb6be774 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 21 十月 2026 17:39:24 +0800
Subject: [PATCH] 青岛维护
---
src/views/statistics/organ.vue | 61 ++++++++++++++++++++----------
1 files changed, 41 insertions(+), 20 deletions(-)
diff --git a/src/views/statistics/organ.vue b/src/views/statistics/organ.vue
index 9c420ae..794c741 100644
--- a/src/views/statistics/organ.vue
+++ b/src/views/statistics/organ.vue
@@ -68,7 +68,7 @@
style="float: right; margin-left: 10px;"
type="primary"
icon="el-icon-zoom-in"
- @click="showOrganDetail = true"
+ @click="viewAllOrganDetail"
>
鏌ョ湅鍣ㄥ畼鏄庣粏
</el-button>
@@ -139,7 +139,7 @@
import FilterPanel from '@/components/charts/FilterPanel.vue';
import EChartsWrapper from '@/components/charts/EChartsWrapper.vue';
import OrganDetail from './components/OrganDetail.vue';
-import { organ, organMoon, organType } from '@/api/businessApi';
+import { organ, organMoon, organType, organTotals } from '@/api/businessApi';
import { toTotalsList, toMonth, toNum } from '@/utils/totals';
import statisticsMode from '@/utils/statisticsMode';
import { COLORS, PALETTE, axisTooltip, grid, xAxis, yAxis, legend, barSeries } from '@/utils/chartStyle';
@@ -263,10 +263,11 @@
this.loading = true;
try {
const q = this.buildQuery();
- const [moonRes, typeRes, organRes] = await Promise.all([
+ const [moonRes, typeRes, organRes, totalsRes] = await Promise.all([
organMoon(q),
organType(q),
- organ(q)
+ organ(q),
+ organTotals(q)
]);
// 鑾峰彇/绉绘瓒嬪娍
@@ -301,8 +302,8 @@
const start = (this.query.page - 1) * this.query.limit;
this.tableData = all.slice(start, start + this.query.limit);
- // 鏇存柊姒傝
- this.updateOverviewData(all);
+ // 鏇存柊姒傝锛堟�昏幏鍙�/绉绘/绉绘鐜�/寮冪敤锛屾潵鑷� /organTotals锛�
+ this.updateOverviewData(toTotalsList(totalsRes)[0] || {});
// 鏇存柊鍥捐〃
this.updateCharts();
@@ -314,17 +315,17 @@
}
},
- // 鏇存柊姒傝鏁版嵁
- updateOverviewData(data) {
- const totalAcquisition = data.reduce((sum, item) => sum + toNum(item.acquisitionCount), 0);
- const totalTransplant = data.reduce((sum, item) => sum + toNum(item.transplantCount), 0);
- const totalAbandon = data.reduce((sum, item) => sum + toNum(item.abandonCount), 0);
- const transplantRate = totalAcquisition > 0 ? ((totalTransplant / totalAcquisition) * 100).toFixed(1) : 0;
+ // 鏇存柊姒傝鏁版嵁锛堟潵鑷� /organTotals 鐨勬�昏幏鍙�/鎬荤Щ妞�/鎬诲純鐢紝绉绘鐜�=绉绘/鑾峰彇锛�
+ updateOverviewData(totals) {
+ const totalGet = toNum(totals.totalGet);
+ const totalTransplant = toNum(totals.totalTransplant);
+ const totalDiscard = toNum(totals.totalDiscard);
+ const transplantRate = totalGet > 0 ? ((totalTransplant / totalGet) * 100).toFixed(1) : 0;
- this.overviewData[0].value = totalAcquisition;
+ this.overviewData[0].value = totalGet;
this.overviewData[1].value = totalTransplant;
this.overviewData[2].value = `${transplantRate}%`;
- this.overviewData[3].value = totalAbandon;
+ this.overviewData[3].value = totalDiscard;
},
// 鏇存柊鍥捐〃
@@ -424,13 +425,33 @@
this.$message.info('瀵煎嚭鍔熻兘寮�鍙戜腑...');
},
- // 鏌ョ湅鍣ㄥ畼璇︽儏
+ // 鏌ョ湅鍣ㄥ畼璇︽儏锛堟煇涓�琛岋細骞翠唤 + 鍣ㄥ畼 + 鍦板尯锛屾椂闂磋寖鍥寸簿纭埌澶╋級
viewOrganDetail(row) {
- this.detailQuery = {
- year: row.year,
- organType: row.organName,
- region: row.region
- };
+ const q = {};
+ if (row.year) {
+ q.startTime = `${row.year}-01-01`;
+ q.endTime = `${row.year}-12-31`;
+ }
+ if (row.organName) q.organName = row.organName;
+ if (row.region) q.area = row.region;
+ this.detailQuery = q;
+ this.showOrganDetail = true;
+ },
+
+ // 鏌ョ湅鍏ㄩ儴鍣ㄥ畼鏄庣粏锛堟寜褰撳墠绛涢�夋潯浠讹紝鏃堕棿鑼冨洿绮剧‘鍒板ぉ锛�
+ viewAllOrganDetail() {
+ const q = {};
+ if (this.query.region && this.query.region.length) {
+ q.area = this.query.region.join(',');
+ }
+ if (this.query.yearRange && this.query.yearRange.length === 2) {
+ q.startTime = `${this.query.yearRange[0]}-01-01`;
+ q.endTime = `${this.query.yearRange[1]}-12-31`;
+ }
+ if (this.query.organType) {
+ q.organName = this.query.organType;
+ }
+ this.detailQuery = q;
this.showOrganDetail = true;
}
}
--
Gitblit v1.9.3