lcw
This commit is contained in:
@ -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
|
||||
}
|
||||
// 地域统计
|
||||
|
||||
Reference in New Issue
Block a user