Merge branch 'master' of http://10.0.41.100:3000/lishenfeng/tsg-web
commit
bcb3d1c9e2
|
|
@ -95,7 +95,7 @@ const Page = () => {
|
||||||
<Table
|
<Table
|
||||||
title={() => (
|
title={() => (
|
||||||
<>
|
<>
|
||||||
<h2 style={{ textAlign: "center" }}>小玉潭水库{searchVal?.year}年日平均水位年报表</h2>
|
<h2 style={{ textAlign: "center" }}>檀树岗水库{searchVal?.year}年日平均水位年报表</h2>
|
||||||
<div style={{ textAlign: "right" }}>单位:m</div>
|
<div style={{ textAlign: "right" }}>单位:m</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ const Page = () => {
|
||||||
<Table
|
<Table
|
||||||
title={() => (
|
title={() => (
|
||||||
<>
|
<>
|
||||||
<h2 style={{ textAlign: "center" }}>小玉潭水库{searchVal?.year}年日降雨年报表</h2>
|
<h2 style={{ textAlign: "center" }}>檀树岗水库{searchVal?.year}年日降雨年报表</h2>
|
||||||
<div style={{ textAlign: "right" }}>单位:mm</div>
|
<div style={{ textAlign: "right" }}>单位:mm</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,10 @@ const Page = ({ title = '标题' }) => {
|
||||||
// hoverAnimation: true,
|
// hoverAnimation: true,
|
||||||
data: plandata,
|
data: plandata,
|
||||||
label: {
|
label: {
|
||||||
normal: {
|
show:false,
|
||||||
show: true,
|
},
|
||||||
position: 'outside',
|
labelLine: {
|
||||||
formatter: '{c}',
|
show: false
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
itemStyle:{
|
itemStyle:{
|
||||||
color: function (colors) {
|
color: function (colors) {
|
||||||
|
|
|
||||||
|
|
@ -56,12 +56,11 @@ const Page = ({ title = '标题' }) => {
|
||||||
// hoverAnimation: true,
|
// hoverAnimation: true,
|
||||||
data: plandata,
|
data: plandata,
|
||||||
label: {
|
label: {
|
||||||
normal: {
|
show:false,
|
||||||
show: true,
|
},
|
||||||
position: 'outside',
|
labelLine: {
|
||||||
formatter: '{c}',
|
show: false
|
||||||
},
|
},
|
||||||
},
|
|
||||||
itemStyle:{
|
itemStyle:{
|
||||||
color: function (colors) {
|
color: function (colors) {
|
||||||
var colorList = [
|
var colorList = [
|
||||||
|
|
|
||||||
|
|
@ -18,38 +18,58 @@ 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(Object())
|
const [plandata, setPlanData] = useState([])
|
||||||
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: {
|
||||||
data: Object.values(obj),
|
show: true,
|
||||||
|
data: plandata?.map(item=>item.name),
|
||||||
type: 'scroll'
|
type: 'scroll'
|
||||||
},
|
},
|
||||||
tooltip: {},
|
tooltip: {},
|
||||||
polar: {
|
polar: {
|
||||||
radius: [0, '80%']
|
// radius: [0, '80%']
|
||||||
},
|
|
||||||
radiusAxis: {
|
|
||||||
min: 0,
|
|
||||||
max: Math.max.apply(null, Object.values(plandata)),
|
|
||||||
axisLine:{
|
|
||||||
show:false
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
},
|
||||||
angleAxis: {
|
angleAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: Object.values(obj),
|
data: plandata?.map(item=>item.name),
|
||||||
// startAngle: 75,
|
|
||||||
|
},
|
||||||
|
radiusAxis: {
|
||||||
|
min: 0,
|
||||||
|
max: 20,
|
||||||
|
interval: 2,
|
||||||
|
// 刻度
|
||||||
|
axisTick:{
|
||||||
|
show:false
|
||||||
|
},
|
||||||
|
//刻度数值
|
||||||
|
axisLabel:{
|
||||||
|
show:false
|
||||||
|
},
|
||||||
|
// 线
|
||||||
|
axisLine:{
|
||||||
|
show:false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '案件类型',
|
name: '案件类型',
|
||||||
type: 'bar',
|
stack: 'a',
|
||||||
coordinateSystem: 'polar',
|
type: 'pie',
|
||||||
|
radius: [0, 140],
|
||||||
|
center: ['50%', '50%'],
|
||||||
|
roseType: 'area',
|
||||||
|
stillShowZeroSum:false,
|
||||||
|
label: {
|
||||||
|
show:false,
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
normal: {
|
normal: {
|
||||||
color: function (colors) {
|
color: function (colors) {
|
||||||
|
|
@ -64,13 +84,11 @@ const Page = ({ title = '标题' }) => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: Object.values(plandata)
|
data: plandata
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}, [plandata])
|
}, [plandata])
|
||||||
console.log(getPlanOption);
|
|
||||||
|
|
||||||
const onOk = (event, index) => {
|
const onOk = (event, index) => {
|
||||||
if (event !== null) {
|
if (event !== null) {
|
||||||
let params = {
|
let params = {
|
||||||
|
|
@ -82,15 +100,23 @@ 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 => {
|
||||||
res.data.map(item => {
|
const arr = Object.values(obj).map(item1=>{
|
||||||
obj1.push({ value: item.count, name: obj[item.type] })
|
let obj1=res.data.find(item => obj[item.type] == item1)
|
||||||
sum = sum + item.count
|
if(obj1?.count){
|
||||||
|
sum =sum+1
|
||||||
|
return { value: obj1?.count, name: item1 }
|
||||||
|
}else{
|
||||||
|
return { value: 0, name: item1 }
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// debugger;
|
if(sum == 0){
|
||||||
setPlanData(obj1)
|
setPlanData([])
|
||||||
|
}else{
|
||||||
|
setPlanData(arr)
|
||||||
|
}
|
||||||
|
|
||||||
setSum(sum)
|
setSum(sum)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue