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, // hoverAnimation: true,
data: plandata, data: plandata,
label: { label: {
show:false, normal: {
}, show: true,
labelLine: { position: 'outside',
show: false formatter: '{c}',
}
}, },
itemStyle:{ itemStyle:{
color: function (colors) { color: function (colors) {

View File

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

View File

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