qinxianzhangyao
2024-06-27 f68fa3bc5fc0a286c88d82ee6eb95e8ad6be0d16
src/views/index.vue
@@ -72,10 +72,18 @@
  created() {
    this.getList();
  },
  watch: {
        $route(to, from) {
            window.location.reload(); //监测到路由发生跳转时刷新一次页面
            // this.$router.go(0);
        },
    },
  methods: {
    getList() {
      this.loading = true;
      // 查询今日登记
@@ -180,17 +188,28 @@
      // 饼状图
      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 => {
@@ -223,6 +242,9 @@
                type: 'pie',
                radius: ['16%', '54%'],
                center: ["50%", "43%"],
                avoidLabelOveralap:false,
                startAngle:180,
                minAngle:10,
                data: this.PieChart,
                emphasis: {
                  itemStyle: {
@@ -234,16 +256,26 @@
              }]
          })
          if (response.data.tjyc.length === 0) {
          if(response.data.tjyc == 0){
            this.PieChart2 = []
            this.PieChart2 = [
                {
                  "name": "体检结果异常人数分布",
                  "count": 1,
                  "value": 10
                },
              ]
              {
                "name": "体检结果异常人数分布",
                "count": 1,
                "value": 10
              },
            ]
          }else if (response.data.tjyc.length === 0) {
            this.PieChart2 = []
            this.PieChart2 = [
              {
                "name": "体检结果异常人数分布",
                "count": 1,
                "value": 10
              },
            ]
          } else {
            this.PieChart2 = response.data.tjyc
            this.PieChart2.reverse()
@@ -275,6 +307,9 @@
                type: 'pie',
                radius: ['16%', '54%'],
                center: ["50%", "43%"],
                avoidLabelOveralap:false,
                startAngle:180,
                minAngle:10,
                data: this.PieChart2,
                emphasis: {
                  itemStyle: {
@@ -358,6 +393,7 @@
.data-view {
  margin: 0 15px;
  height: 323px !important
}
#main {