Skip to content
Snippets Groups Projects
Commit 9c365f00 authored by 1437862981's avatar 1437862981
Browse files

问题修改

parent 7911709f
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ const StatisticsChart: React.FC<StatisticsChartProps> = ({ searchTime }) => { ...@@ -40,7 +40,7 @@ const StatisticsChart: React.FC<StatisticsChartProps> = ({ searchTime }) => {
}, },
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
console.log(res);
return res?.data?.data?.records?.[0]?.total; return res?.data?.data?.records?.[0]?.total;
} }
...@@ -53,11 +53,14 @@ const StatisticsChart: React.FC<StatisticsChartProps> = ({ searchTime }) => { ...@@ -53,11 +53,14 @@ const StatisticsChart: React.FC<StatisticsChartProps> = ({ searchTime }) => {
let isUsingValue = true; let isUsingValue = true;
const data = useMemo(() => { const data = useMemo(() => {
const gczt = charData?.find((item) => item.name === 'gczt')?.num; const gczt = charData?.find((item) => item.name === 'gczt')?.num??0;
const gcnj = charData?.find((item) => item.name === 'gcnj')?.num; const gcnj = charData?.find((item) => item.name === 'gcnj')?.num??0;
const zxlj = charData?.find((item) => item.name === 'zxlj')?.num; const zxlj = charData?.find((item) => item.name === 'zxlj')?.num??0;
const gclj = charData?.find((item) => item.name === 'gclj')?.num; const gclj = charData?.find((item) => item.name === 'gclj')?.num??0
const cclj = charData?.find((item) => item.name === 'cclj')?.num; const cclj = charData?.find((item) => item.name === 'cclj')?.num??0;
console.log(gczt);
return [ return [
{ {
name: '工程渣土', name: '工程渣土',
...@@ -86,7 +89,7 @@ const StatisticsChart: React.FC<StatisticsChartProps> = ({ searchTime }) => { ...@@ -86,7 +89,7 @@ const StatisticsChart: React.FC<StatisticsChartProps> = ({ searchTime }) => {
{ {
name: '拆除垃圾', name: '拆除垃圾',
value: cclj, value: cclj,
percentage: (((cclj / total)) * 100).toFixed(2), percentage: ((cclj / total) * 100).toFixed(2),
color: '#00FFB3', color: '#00FFB3',
}, },
]; ];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment