This commit is contained in:
lcw
2025-08-29 19:32:41 +08:00
parent 8a1527b9b3
commit 1a16344cf4
11 changed files with 435 additions and 21014 deletions

View File

@ -126,8 +126,6 @@
import PageTitle from "@/components/aboutTable/PageTitle.vue";
// import { useExportToPDF } from './components/a.js';
import Search from "@/components/aboutTable/Search.vue";
import html2canvas from 'html2canvas';
import jsPDF from 'jspdf';
import MaleNightingalePicture from './components/maleNightingalePicture.vue'
import Histogram from './components/histogram.vue'
@ -207,17 +205,14 @@ const sortingRatio = (data) => {
// 提取所有number值
// 计算总数
const total = data.reduce((sum, item) => sum + item.number, 0);
// 找出第一大和第二大的值及其对应的name
const sortedData = [...data].sort((a, b) => b.number - a.number);
const dataValue = sortedData.map(item => {
return {
...item,
ratio: total > 0 ? (item.number / total * 100).toFixed(2) + '%' : '0%',
}
})
return dataValue
}
// 地域统计