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

fix:

parent 9b8e7018
...@@ -120,7 +120,7 @@ const BidParticulars: React.FC<BidParticularsProps> = ({cardTitle}) => { ...@@ -120,7 +120,7 @@ const BidParticulars: React.FC<BidParticularsProps> = ({cardTitle}) => {
<Table <Table
columns={tableColumn} columns={tableColumn}
expandable={{ 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', rowExpandable: record => record.name !== 'Not Expandable',
expandIcon: ({ expanded, onExpand, record }) => expandIcon: ({ expanded, onExpand, record }) =>
expanded ? ( expanded ? (
...@@ -131,7 +131,8 @@ const BidParticulars: React.FC<BidParticularsProps> = ({cardTitle}) => { ...@@ -131,7 +131,8 @@ const BidParticulars: React.FC<BidParticularsProps> = ({cardTitle}) => {
onExpand: (expanded, record) => { onExpand: (expanded, record) => {
console.log('通过商品Id 查询商品信息显示在嵌套中', record, expanded) console.log('通过商品Id 查询商品信息显示在嵌套中', record, expanded)
if(!record?.commodityId && expanded) { if(!record?.commodityId && expanded) {
return message.error('您没有关联商品') // return message.error('您没有关联商品')
return null
} }
if(expanded) { if(expanded) {
renderDescription(record) renderDescription(record)
......
...@@ -7,11 +7,12 @@ import style from './index.less' ...@@ -7,11 +7,12 @@ import style from './index.less'
import { CaretDownOutlined, CaretUpOutlined, ExclamationCircleFilled, FileFilled } from '@ant-design/icons'; import { CaretDownOutlined, CaretUpOutlined, ExclamationCircleFilled, FileFilled } from '@ant-design/icons';
import { import {
Chart, Chart,
Interval,
Coordinate, Coordinate,
Legend, Legend,
View, View,
} from 'bizcharts'; } from "bizcharts";
import Interval from 'bizcharts/lib/geometry/Interval' import { Annotation } from 'bizcharts/lib'
import moment from 'moment'; import moment from 'moment';
import { BidInStateTexts, BidOutStateTexts, PURCHASE_TYPE, TenderInStateTexts, TenderOutStateTexts } from '@/constants/procurement'; import { BidInStateTexts, BidOutStateTexts, PURCHASE_TYPE, TenderInStateTexts, TenderOutStateTexts } from '@/constants/procurement';
...@@ -357,7 +358,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => { ...@@ -357,7 +358,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
name: 'createTime', name: 'createTime',
render: (text, record) => <Row justify='space-between'> render: (text, record) => <Row justify='space-between'>
<Col style={{margin: "0 16px"}}> <Col style={{margin: "0 16px"}}>
<CircleChart sumPrice={sumPrice} alreadyPay={alreadyPay} /> <CircleChart data={myData} content={myContent} />
</Col> </Col>
<Col> <Col>
<div><span className={style['card-list_title']}>中标金额(含税):</span></div> <div><span className={style['card-list_title']}>中标金额(含税):</span></div>
...@@ -377,7 +378,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => { ...@@ -377,7 +378,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
name: 'winTenderAnnounceFile', name: 'winTenderAnnounceFile',
render: (t, r) => (<div> 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>) </div>)
}, },
...@@ -392,7 +393,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => { ...@@ -392,7 +393,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
name: 'winTenderNoticeFile', name: 'winTenderNoticeFile',
render: (t, r) => (<div> 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>) </div>)
}, },
...@@ -455,32 +456,52 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => { ...@@ -455,32 +456,52 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type}) => {
} }
// 圆形环状金额显示 // 圆形环状金额显示
const CircleChart = props => { const alreadyRate: any = (alreadyPay / sumPrice).toFixed(2)
const { sumPrice = 100, alreadyPay = 10 } = props const discontentRate: any = 1 - alreadyRate
const myData: any = [
const userData = [ { type: '中标金额', percent: Number(alreadyRate) },
{ type: '总金额', value: sumPrice-alreadyPay, percent: Math.round((sumPrice-alreadyPay) / sumPrice)/ 100.00 }, { type: '未中金额', percent: Number(discontentRate) },
{ type: '已支付', value: alreadyPay, percent: Math.round(alreadyPay / sumPrice)/ 100.00 }
]; ];
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} /> <Legend visible={false} />
{/* 绘制图形 */} {/* 绘制图形 */}
<View data={userData}> <View
<Coordinate type="theta" innerRadius={0.75} /> data={data}
scale={{
percent: {
formatter: (val) => {
return (val * 100).toFixed(2) + "%";
},
},
}}
>
<Coordinate type="theta" innerRadius={0.5} />
<Interval <Interval
position="percent" position="percent"
adjust="stack" adjust="stack"
color={['type', ['#ffc400', '#6c9ceb']]} color={['type', ['#6c9ceb', '#ffc400']]}
tooltip={false} 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> </View>
</Chart> </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