import React from 'react'; import './ProgressVariants.css'; const R = 42; const CIRC = 2 * Math.PI * R; const COLORS = { success: '#2E7D0A', warning: '#8C5A00', error: '#CF1322', normal: '#2F54EB' }; export default function ProgressVariants({ type = 'line', percent = 0, status = 'normal', showInfo = true }) { const color = COLORS[status] || COLORS.normal; if (type === 'line') { return (
{showInfo ? {status === 'success' ? '完成' : percent + '%'} : null}
); } const isDash = type === 'dashboard'; const arcLen = isDash ? CIRC * 0.75 : CIRC; return (
{showInfo ? {percent}% : null}
); }