Compare commits

..

No commits in common. "45451723124b514a3a207fd28ae0cc5cf3c2f0c2" and "bb849641af289b51ab939187475c25c6e9389a2d" have entirely different histories.

3 changed files with 34 additions and 56 deletions

View File

@ -43,10 +43,12 @@ const Page = ({ title = '标题' }) => {
// hoverAnimation: true,
data: plandata,
label: {
show:false,
},
labelLine: {
show: false
normal: {
show: true,
position: 'outside',
formatter: '{c}',
}
},
itemStyle:{
color: function (colors) {

View File

@ -56,10 +56,11 @@ const Page = ({ title = '标题' }) => {
// hoverAnimation: true,
data: plandata,
label: {
show:false,
normal: {
show: true,
position: 'outside',
formatter: '{c}',
},
labelLine: {
show: false
},
itemStyle:{
color: function (colors) {

View File

@ -18,57 +18,38 @@ let obj =
const Page = ({ title = '标题' }) => {
const [echart2, setEchart2] = useState(Object())
const [inspectordata, setInspectorData] = useState([{}])
const [plandata, setPlanData] = useState([])
const [plandata, setPlanData] = useState(Object())
const [problemdata, setProblemData] = useState(Object())
const [sumTotal, setSum] = useState(0)
const getPlanOption = useMemo((name, data) => {
return {
legend: {
show: true,
data: plandata?.map(item=>item.name),
data: Object.values(obj),
type: 'scroll'
},
tooltip: {},
polar: {
// radius: [0, '80%']
},
angleAxis: {
type: 'category',
data: plandata?.map(item=>item.name),
radius: [0, '80%']
},
radiusAxis: {
min: 0,
max: 20,
interval: 2,
// 刻度
axisTick:{
show:false
},
//刻度数值
axisLabel:{
show:false
},
// 线
max: Math.max.apply(null, Object.values(plandata)),
axisLine:{
show:false
},
},
angleAxis: {
type: 'category',
data: Object.values(obj),
// startAngle: 75,
},
series: [
{
name: '案件类型',
stack: 'a',
type: 'pie',
radius: [0, 140],
center: ['50%', '50%'],
roseType: 'area',
stillShowZeroSum:false,
label: {
show:false,
},
labelLine: {
show: false
},
type: 'bar',
coordinateSystem: 'polar',
itemStyle: {
normal: {
color: function (colors) {
@ -83,11 +64,13 @@ const Page = ({ title = '标题' }) => {
}
},
},
data: plandata
data: Object.values(plandata)
}
]
}
}, [plandata])
console.log(getPlanOption);
const onOk = (event, index) => {
if (event !== null) {
let params = {
@ -99,23 +82,15 @@ const Page = ({ title = '标题' }) => {
}
}
const getInfo = (params) => {
let obj1 = []
let sum = 0
httppost(apiurl.szzf.ajtj.info + 1, params).then(res => {
const arr = Object.values(obj).map(item1=>{
let obj1=res.data.find(item => obj[item.type] == item1)
if(obj1?.count){
sum =sum+1
return { value: obj1?.count, name: item1 }
}else{
return { value: 0, name: item1 }
}
res.data.map(item => {
obj1.push({ value: item.count, name: obj[item.type] })
sum = sum + item.count
})
if(sum == 0){
setPlanData([])
}else{
setPlanData(arr)
}
// debugger;
setPlanData(obj1)
setSum(sum)
})