import { Modal } from 'antd'; import React, { useEffect, useRef } from 'react'; import * as echarts from 'echarts'; export type ListFormProps = { onClose: (flag?: boolean, formVals?: unknown) => void; open: boolean; values?: Partial; matching?: any; }; const listEdit: React.FC = (props) => { const { open, values, matching } = props; const mapRef = useRef(null); useEffect(() => { console.log(matching); if (matching && open) { const myCharts = echarts.init(mapRef.current); const { educationMatch, maxSimilarity, salaryMatch, areaMatch } = matching; // educationMatch // maxSimilarity // salaryMatch // areaMatch myCharts.setOption({ radar: { shape: 'circle', indicator: [ { name: '学历', max: 1 }, { name: '薪资', max: 1 }, { name: '区域', max: 1 }, { name: '内容', max: 1 }, ], }, series: [ { name: '综合匹配度', type: 'radar', data: [ { value: [educationMatch, salaryMatch, areaMatch, maxSimilarity], name: 'Allocated Budget', }, ], }, ], }); } }, [matching]); return ( props.onClose()} maskClosable={true} >
); }; export default listEdit;