|
|
@ -1,13 +1,14 @@ |
|
|
|
import React, { useEffect, useRef } from 'react'; |
|
|
|
import './style.less' |
|
|
|
import * as echarts from 'echarts'; |
|
|
|
export default function LeftItem() { |
|
|
|
export default function LeftItem({datas}) { |
|
|
|
const seasonChartRef = useRef(null); |
|
|
|
// console.log(props.datas,'hhh')
|
|
|
|
useEffect(() => { |
|
|
|
let chartInstance = echarts.init(seasonChartRef.current); |
|
|
|
const option = { |
|
|
|
title: { |
|
|
|
text: '75%', |
|
|
|
text: `${(datas.processed*100/datas.total).toFixed(2)}%`, |
|
|
|
top:'35%', |
|
|
|
textStyle: { |
|
|
|
fontSize: "1.375rem", |
|
|
@ -69,7 +70,7 @@ export default function LeftItem() { |
|
|
|
type: 'bar', |
|
|
|
data: [{ |
|
|
|
name: '已处理', |
|
|
|
value: 75, |
|
|
|
value: (datas.processed/datas.total).toFixed(2)*100, |
|
|
|
itemStyle: { |
|
|
|
normal: { |
|
|
|
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ { |
|
|
@ -115,8 +116,8 @@ export default function LeftItem() { |
|
|
|
return ( |
|
|
|
<div className='guanli-left-item'> |
|
|
|
<div className='guanli-left-item-left'> |
|
|
|
<span>莲塘镇</span> |
|
|
|
<div>244 <span>个</span></div> |
|
|
|
<span>{datas.name}</span> |
|
|
|
<div>{datas.total} <span>个</span></div> |
|
|
|
</div> |
|
|
|
<div className='guanli-left-item-right'> |
|
|
|
<span></span> |
|
|
|