| | |
| | | <template> |
| | | <div class="centre"> |
| | | <div style="display:flex;justify-content: center;align-items: center;"> |
| | | <h4>今日统计</h4> |
| | | </div> |
| | | <div class="top"> |
| | | <div class="add"> |
| | | <div class="img"> |
| | |
| | | <div class="day">今日待检 {{ TobeToday }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex;justify-content: center;align-items: center;"> |
| | | <h4>近一月统计</h4> |
| | | </div> |
| | | <div class="data-view"> |
| | | <div id="main" style="width:95%;height:330px"></div> |
| | |
| | | |
| | | created() { |
| | | this.getList(); |
| | | |
| | | }, |
| | | watch: { |
| | | $route(to, from) { |
| | | window.location.reload(); //监测到路由发生跳转时刷新一次页面 |
| | | // this.$router.go(0); |
| | | }, |
| | | }, |
| | | |
| | | |
| | | methods: { |
| | | |
| | | |
| | | getList() { |
| | | this.loading = true; |
| | | // 查询今日登记 |
| | |
| | | getChart().then((response) => { |
| | | response.data.forEach(item => { |
| | | this.LineChart.push(item.date) |
| | | this.personYYNum.push(item.tdcoun); |
| | | this.reportNum.push(item.grcoun); |
| | | this.reportNum.push(item.tdcoun); |
| | | this.personYYNum.push(item.grcoun); |
| | | this.teamYYNum.push(item.bgcoun); |
| | | |
| | | }); |
| | |
| | | yAxis: { |
| | | type: 'value', |
| | | min: 0, |
| | | max: 50, |
| | | interval: 5 |
| | | max: 400, |
| | | interval: 20 |
| | | }, |
| | | series: [ |
| | | { |
| | |
| | | ] |
| | | |
| | | }) |
| | | let sizeFun = function () { |
| | | let sizeFun = ()=> { |
| | | myChart.resize() |
| | | } |
| | | window.addEventListener("resize", sizeFun) |
| | |
| | | // 饼状图 |
| | | getPieChart().then((response) => { |
| | | if (response.data) { |
| | | |
| | | if (response.data.tjdj.length === 0) { |
| | | |
| | | if(response.data.tjdj == 0){ |
| | | this.PieChart = [] |
| | | this.PieChart = [ |
| | | { |
| | | "name": "体检登记人数分布", |
| | | "count": 1, |
| | | "value": 10 |
| | | }, |
| | | |
| | | ] |
| | | { |
| | | "name": "体检登记人数分布", |
| | | "count": 1, |
| | | "value": 10 |
| | | }, |
| | | |
| | | ] |
| | | }else if (response.data.tjdj.length === 0) { |
| | | |
| | | this.PieChart = [] |
| | | this.PieChart = [ |
| | | { |
| | | "name": "体检登记人数分布", |
| | | "count": 1, |
| | | "value": 10 |
| | | }, |
| | | |
| | | ] |
| | | } else { |
| | | this.PieChart = response.data.tjdj |
| | | this.PieChart.forEach(item => { |
| | |
| | | type: 'pie', |
| | | radius: ['16%', '54%'], |
| | | center: ["50%", "43%"], |
| | | avoidLabelOveralap:false, |
| | | startAngle:180, |
| | | minAngle:10, |
| | | data: this.PieChart, |
| | | emphasis: { |
| | | itemStyle: { |
| | |
| | | }] |
| | | }) |
| | | |
| | | if (response.data.tjyc.length === 0) { |
| | | if(response.data.tjyc == 0){ |
| | | this.PieChart2 = [] |
| | | this.PieChart2 = [ |
| | | { |
| | | "name": "体检结果异常人数分布", |
| | | "count": 1, |
| | | "value": 10 |
| | | }, |
| | | |
| | | ] |
| | | { |
| | | "name": "体检结果异常人数分布", |
| | | "count": 1, |
| | | "value": 0 |
| | | }, |
| | | |
| | | ] |
| | | }else if (response.data.tjyc.length === 0) { |
| | | this.PieChart2 = [] |
| | | this.PieChart2 = [ |
| | | { |
| | | "name": "体检结果异常人数分布", |
| | | "count": 1, |
| | | "value": 0 |
| | | }, |
| | | |
| | | ] |
| | | } else { |
| | | this.PieChart2 = response.data.tjyc |
| | | this.PieChart2.reverse() |
| | |
| | | type: 'pie', |
| | | radius: ['16%', '54%'], |
| | | center: ["50%", "43%"], |
| | | avoidLabelOveralap:false, |
| | | startAngle:180, |
| | | minAngle:10, |
| | | data: this.PieChart2, |
| | | emphasis: { |
| | | itemStyle: { |
| | |
| | | } |
| | | }] |
| | | }) |
| | | } |
| | | |
| | | |
| | | window.onresize = function () { |
| | | window.onresize = () =>{ |
| | | myChart2.resize() |
| | | myChart3.resize() |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | this.loading = false; |
| | | }); |
| | | |
| | |
| | | |
| | | <style> |
| | | .centre { |
| | | height: 820px; |
| | | min-height: 820px; |
| | | margin: 15px 15px; |
| | | background-color: #f3f3f3; |
| | | padding: 10px 10px 10px 10px; |
| | | } |
| | | |
| | | .top { |
| | |
| | | |
| | | .data-view { |
| | | margin: 0 15px; |
| | | height: 323px !important |
| | | } |
| | | |
| | | #main { |
| | |
| | | .view { |
| | | margin: 0px 15px; |
| | | padding-top: 15px; |
| | | height: 350px; |
| | | min-height: 350px; |
| | | display: flex; |
| | | } |
| | | |