Commit f53e4ff3 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:

parent 9b8e7018
......@@ -120,7 +120,7 @@ const BidParticulars: React.FC<BidParticularsProps> = ({cardTitle}) => {
<Table
columns={tableColumn}
expandable={{
expandedRowRender: record => <p style={{ margin: 0 }}>{ record.description || <Spin size="small" style={{margin: '15px auto', width: '100%'}} />}</p>,
expandedRowRender: record => <p style={{ margin: 0 }}>{ record?.commodityId ? (record.description || <Spin size="small" style={{margin: '15px auto', width: '100%'}} />) : null}</p>,
rowExpandable: record => record.name !== 'Not Expandable',
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
......@@ -131,7 +131,8 @@ const BidParticulars: React.FC<BidParticularsProps> = ({cardTitle}) => {
onExpand: (expanded, record) => {
console.log('通过商品Id 查询商品信息显示在嵌套中', record, expanded)
if(!record?.commodityId && expanded) {
return message.error('您没有关联商品')
// return message.error('您没有关联商品')
return null
}
if(expanded) {
renderDescription(record)
......
......@@ -7,11 +7,12 @@ import style from './index.less'
import { CaretDownOutlined, CaretUpOutlined, ExclamationCircleFilled, FileFilled } from '@ant-design/icons';
import {
Chart,
Interval,
Coordinate,
Legend,
View,
} from 'bizcharts';
import Interval from 'bizcharts/lib/geometry/Interval'
} from "bizcharts";
import { Annotation } from 'bizcharts/lib'
import moment from 'moment';
import { BidInStateTexts, BidOutStateTexts, PURCHASE_TYPE, TenderInStateTexts, TenderOutStateTexts } from '@/constants/procurement';
......@@ -357,7 +358,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
name: 'createTime',
render: (text, record) => <Row justify='space-between'>
<Col style={{margin: "0 16px"}}>
<CircleChart sumPrice={sumPrice} alreadyPay={alreadyPay} />
<CircleChart data={myData} content={myContent} />
</Col>
<Col>
<div><span className={style['card-list_title']}>中标金额(含税):</span></div>
......@@ -377,7 +378,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
name: 'winTenderAnnounceFile',
render: (t, r) => (<div>
{
data['winTenderAnnounceFile'].map((_item, _i) => <p><a key={`announce${_i}`} target="_blank" href={_item.url}><FileFilled /> {_item.payNode}</a></p>)
data['winTenderAnnounceFile'].map((_item, _i) => <p><a key={`announce${_i}`} target="_blank" href={_item.url}><FileFilled /> {_item.name}</a></p>)
}
</div>)
},
......@@ -392,7 +393,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
name: 'winTenderNoticeFile',
render: (t, r) => (<div>
{
data['winTenderNoticeFile'].map((_item, _i) => <p><a key={`notice${_i}`} target="_blank" href={_item.url}><FileFilled /> {_item.payNode}</a></p>)
data['winTenderNoticeFile'].map((_item, _i) => <p><a key={`notice${_i}`} target="_blank" href={_item.url}><FileFilled /> {_item.name}</a></p>)
}
</div>)
},
......@@ -455,32 +456,52 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
}
// 圆形环状金额显示
const CircleChart = props => {
const { sumPrice = 100, alreadyPay = 10 } = props
const userData = [
{ type: '总金额', value: sumPrice-alreadyPay, percent: Math.round((sumPrice-alreadyPay) / sumPrice)/ 100.00 },
{ type: '已支付', value: alreadyPay, percent: Math.round(alreadyPay / sumPrice)/ 100.00 }
const alreadyRate: any = (alreadyPay / sumPrice).toFixed(2)
const discontentRate: any = 1 - alreadyRate
const myData: any = [
{ type: '中标金额', percent: Number(alreadyRate) },
{ type: '未中金额', percent: Number(discontentRate) },
];
const myContent: any = {
percent: `${alreadyRate * 100}%`,
};
return <Chart placeholder={false} height={64} width={64} style={{position: "relative"}} autoFit>
const CircleChart = ({ data = [], content = {}, intervalConfig = {} }: any) => {
return (
<Chart placeholder={false} height={100} width={100} style={{position: "relative"}} autoFit>
<Legend visible={false} />
{/* 绘制图形 */}
<View data={userData}>
<Coordinate type="theta" innerRadius={0.75} />
<View
data={data}
scale={{
percent: {
formatter: (val) => {
return (val * 100).toFixed(2) + "%";
},
},
}}
>
<Coordinate type="theta" innerRadius={0.5} />
<Interval
position="percent"
adjust="stack"
color={['type', ['#ffc400', '#6c9ceb']]}
tooltip={false}
color={['type', ['#6c9ceb', '#ffc400']]}
size={16}
{...intervalConfig}
/>
<Annotation.Text
position={["50%", "48%"]}
content={content.percent}
style={{
lineHeight: 240,
fontSize: 14,
fill: "#000",
textAlign: "center",
}}
/>
<p style={{position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)"}}>
{
sumPrice <= 0 ? "0%" : (Math.round(alreadyPay / sumPrice * 10000) / 100.00)+"%"
}
</p>
</View>
</Chart>
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment