From eebfea3ed2cb86f0bbe4320cdfeadf703d26708c Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 13 Oct 2023 10:13:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=20top=20=E7=9A=84?= =?UTF-8?q?=E6=AF=9B=E5=88=A9KPI=E6=98=BE=E7=A4=BA;=0Bstyle:=20=E5=9B=BD?= =?UTF-8?q?=E5=86=85=E5=A4=96=E5=8D=A0=E6=AF=94=E5=9B=BE=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BulletWithSort.jsx | 2 +- src/components/Donut.jsx | 3 ++- src/views/Home.jsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/BulletWithSort.jsx b/src/components/BulletWithSort.jsx index 3821709..2a0746d 100644 --- a/src/components/BulletWithSort.jsx +++ b/src/components/BulletWithSort.jsx @@ -14,7 +14,7 @@ export default observer((props) => { const _max = Math.max(maxKPI, maxValue); const sortData = origin.sort(sortBy(measureField)).slice(-itemLength); // 顶格的值定在更远 - const _parseData = sortData?.map((ele) => ({ ...ele, [rangeField]: [0, Math.ceil(_max / 0.9)], [measureField]: [ele[measureField]], [targetField]: (ele?.targetField || 0) })); + const _parseData = sortData?.map((ele) => ({ ...ele, [rangeField]: [0, Math.ceil(_max / 0.9)], [measureField]: [ele[measureField]], [targetField]: (ele?.[targetField] || 0) })); return _parseData; }; diff --git a/src/components/Donut.jsx b/src/components/Donut.jsx index a18447a..0e5cc5c 100644 --- a/src/components/Donut.jsx +++ b/src/components/Donut.jsx @@ -13,7 +13,8 @@ export default observer((props) => { if (containerWidth < textWidth) { scale = Math.min(Math.sqrt(Math.abs(Math.pow(R, 2) / (Math.pow(textWidth / 2, 2) + Math.pow(textHeight, 2)))), 1); } - const textStyleStr = `width:${containerWidth}px;`; + // const textStyleStr = `width:${containerWidth}px;`; + const textStyleStr = `width:auto;`; return `
${text}
`; }; diff --git a/src/views/Home.jsx b/src/views/Home.jsx index 200ab4f..aa9f7e4 100644 --- a/src/views/Home.jsx +++ b/src/views/Home.jsx @@ -261,7 +261,7 @@ export default observer(() => {

{item.label}

- +
) : null