From a861653ee42734db156bc864fd69705b04d2a836 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 20 Oct 2023 13:51:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=80=91=E5=B8=83=E5=9B=BE=E6=B2=A1=E6=9C=89KP?= =?UTF-8?q?I=E5=80=BC=E6=97=B6,=20=E6=98=BE=E7=A4=BA=E5=8E=9F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StatisticCard2.jsx | 58 +++---------------------------- src/views/Home.jsx | 4 +-- 2 files changed, 7 insertions(+), 55 deletions(-) diff --git a/src/components/StatisticCard2.jsx b/src/components/StatisticCard2.jsx index 849f3d8..ad32813 100644 --- a/src/components/StatisticCard2.jsx +++ b/src/components/StatisticCard2.jsx @@ -1,7 +1,7 @@ import { useContext, useState } from 'react'; import { observer } from 'mobx-react'; import { StatisticCard } from '@ant-design/pro-components'; -import { RingProgress, Progress, Bullet, } from '@ant-design/plots'; +import { RingProgress, Progress, Bullet } from '@ant-design/plots'; import RcResizeObserver from 'rc-resize-observer'; import { stores_Context } from '../config'; import { ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons'; @@ -16,45 +16,25 @@ export default observer((props) => { const VSIcon = () => ((props?.VSrate || -1) < 0 ? : ); // console.log(props, ';;;;'); const [responsive, setResponsive] = useState(false); + const showMulti = traditional.value && biz.value; const bulletData = [ { title: '', // ranges: [0, kpiVal || (traditional.value + biz.value + 100 )], - ranges: [0, Math.ceil(originVal*1.1)], + ranges: [0, Math.ceil(originVal * 1.1)], measures: [traditional.value, biz.value], target: kpiVal || 0, }, ]; - // console.log(bulletData, 'bbbbbbbbb'); - - const RingProgressConfigBlue = { - height: 60, - width: 60, - autoFit: false, - color: ['#5B8FF9', '#E8EDF3'], - label: false, - }; - const RingProgressConfigGreen = { - height: 50, - width: 50, - autoFit: false, - // color: ['#f6bd16', '#E8EDF3'], - color: ['#61ddaa', '#E8EDF3'], // #7cb305 - // innerRadius: 0.90, - }; const bulletConfig = { - // data, measureField: 'measures', rangeField: 'ranges', targetField: 'target', xField: 'title', - // autoFit: false, - // width: 20, height: 60, - // renderer: 'svg', color: { - range: [ '#E8EDF3', '#FFF3E1'], + range: ['#E8EDF3', '#FFF3E1'], // range: ['#FFbcb8', '#FFe0b0', '#bfeec8'], measure: ['#5B8FF9', '#61DDAA'], target: kpiVal ? '#FF9845' : '#5B8FF9', @@ -92,36 +72,8 @@ export default observer((props) => { value: props.valueSuffix ? `${props.value} ${props.valueSuffix}` : props.value, prefix: , }} - chart={} - /> - {false && <> - {/* {props.childrenVisible && <> */} - - , - }} - chart={} - chartPlacement="left" - /> - , - }} - chart={百分比} - chartPlacement="left" + chart={showMulti ? : false} /> - } ); diff --git a/src/views/Home.jsx b/src/views/Home.jsx index 0c174c9..39f45c4 100644 --- a/src/views/Home.jsx +++ b/src/views/Home.jsx @@ -107,7 +107,7 @@ export default observer(() => { }, }, label: { - formatter: (v) => (summaryData.kpi.value === 0 ? dataFieldAlias.SumML?.formatter(v.SumML) || v.SumML : ((v.SumML / summaryData.kpi.value) * 100).toFixed(2) + '%'), + formatter: (v) => ((summaryData.kpi?.value || 0) === 0 ? dataFieldAlias.SumML?.formatter(v.SumML) || v.SumML : ((v.SumML / summaryData.kpi.value) * 100).toFixed(2) + '%'), }, }; @@ -243,7 +243,7 @@ export default observer(() => {

- 英语区目标客户 + 英语区目标客户 (仅传统订单)