瀏覽代碼

统计公办民办调整

nanMing 2 年之前
父節點
當前提交
d436d23a7f

+ 54 - 161
ruoyi-ui/src/components/xxtjEcharts/EchartsBox3/index.vue

@@ -10,7 +10,8 @@
       <slot></slot>
     </div>
     <div class="echarts-radio" v-if="isPie">
-      <el-radio @change="changRadio(item)" v-model="radio" :label="item.prop" v-for="item in radioLabel" :key="item.prop">{{ item.label }}</el-radio>
+      <el-radio @change="changRadio(item)" v-model="radio" :label="item.prop" v-for="item in radioLabel"
+        :key="item.prop">{{ item.label }}</el-radio>
     </div>
     <div :id="echartsId" style="width: 1400px; height: 500px" ref="charts"></div>
   </div>
@@ -92,9 +93,9 @@ export default {
       default: 'no'
     },
     // 是否是入住率
-    ruzhulv:{
-      type:String,
-      default:'no'
+    ruzhulv: {
+      type: String,
+      default: 'no'
     }
   },
   data() {
@@ -119,16 +120,12 @@ export default {
     radioLabel() {
       return this.newKeys.filter((item) => item.type === 'select')
     },
-    // 按分类统计,横向表格的 分类名
-    // labelArr() {
-    //   return this.newKeys.filter((item) => item.type === 'select').map((item) => item.label)
-    // },
     // 饼图全部的名字
     all() {
       return this.radioLabel[0].label
     },
     allNum() {
-      return this.newTableList[0]?this.newTableList[0].total:0;
+      return this.newTableList[0] ? this.newTableList[0].total : 0;
     },
     hengzhuYData() {
       let array = this.radioLabel.slice(1)
@@ -140,28 +137,21 @@ export default {
     }
   },
   methods: {
-    // 改变newKeys中的数据
-    // setKeys() {
-    //   let arrLabel = this.newKeys.filter((item) => item.type === 'select')
-    //   this.radioLabel = arrLabel
-    // },
     // 改变table中X轴的数据的数据格式 参数是 x轴对应的数据名字,y轴对应的数据名字
     setTable(xAxis, yAxis) {
       // x轴
       let arrX = []
-      let arrY = [[],[],[]];
-      let temdata=[];
-      console.log(this.newTableList,"sssss")
-      console.log(this.newKeys,"sssss");
-      let zt=0;
-      for (let i = 0; i <this.newKeys.length ; i++) {
-        if (this.newKeys[i].prop==yAxis)
-        {
+      let arrY = [[], [], []];
+      let temdata = [];
+      console.log(this.newTableList, "sssss")
+      console.log(this.newKeys, "sssss");
+      let zt = 0;
+      for (let i = 0; i < this.newKeys.length; i++) {
+        if (this.newKeys[i].prop == yAxis) {
 
-          if (this.newKeys[i].data)
-          {
-            temdata=this.newKeys[i].data;
-            zt=1;
+          if (this.newKeys[i].data) {
+            temdata = this.newKeys[i].data;
+            zt = 1;
           }
         }
       }
@@ -174,9 +164,8 @@ export default {
         if (this.xStr === 'year') {
 
           arrX.unshift(item[xAxis])
-          if (zt==1)
-          {
-            for (let i = 0; i <temdata.length ; i++) {
+          if (zt == 1) {
+            for (let i = 0; i < temdata.length; i++) {
               arrY[i].unshift(item[temdata[i].prop])
             }
 
@@ -192,9 +181,8 @@ export default {
         if (this.xStr === 'ssqh') {
 
           arrX.push(item[xAxis])
-          if (zt==1)
-          {
-            for (let i = 0; i <temdata.length ; i++) {
+          if (zt == 1) {
+            for (let i = 0; i < temdata.length; i++) {
               arrY[i].push(item[temdata[i].prop])
             }
 
@@ -221,14 +209,12 @@ export default {
     echartsInit(id, type, unit, xAxis, yData, isX, isY) {
       // 是否显示xy轴
       let yAxis = yData;
-      let seriesdata=[];
-
+      let seriesdata = [];
 
       if (type === 'pie' || this.hengzhu === 'yes') {
-
         let array = this.radioLabel.slice(1)
         yAxis = array.map((item, index) => {
-          return { name: item.label, value: this.newTableList[0]?this.newTableList[0][item.prop]:0 }
+          return { name: item.label, value: this.newTableList[0] ? this.newTableList[0][item.prop] : 0 }
         })
         seriesdata.push({
           type,
@@ -241,26 +227,21 @@ export default {
           radius: ['50%', '75%'],
           hoverAnimation: true,
           avoidLabelOverlap: false,
-
           itemStyle: {
             normal: { color: '#288DEF' }
-
           },
           colorBy: 'series'
         })
-      }
-      else
-      {
-        for (let i = 0; i <yAxis.length ; i++) {
-          let colors=[{ color: '#288DEF' },{ color: '#efd428' },{ color: '#ef2895' }];
-          let names=["总数","公办","民办"];
+      } else {
+        for (let i = 0; i < yAxis.length; i++) {
+          let colors = [{ color: '#288DEF' }, { color: '#efd428' }, { color: '#ef2895' }];
+          let names = ["总数", "公办", "民办"];
           seriesdata.push({
             type,
             data: yAxis[i],
-           // barWidth: '40%',
-            name:names[i],
-            barGap:'100%',
-            symbol:'emptydiamond',
+            name: names[i],
+            barGap: '100%',
+            symbol: 'emptydiamond',
             showBackground: true,
             backgroundStyle: {
               color: 'rgba(180, 180, 180, 0.2)'
@@ -268,20 +249,16 @@ export default {
             radius: ['50%', '75%'],
             hoverAnimation: true,
             avoidLabelOverlap: false,
-
             itemStyle: {
               normal: colors[i]
-
             },
             colorBy: 'series'
           })
         }
-
       }
 
       var myChart = this.$echarts.init(document.getElementById(id))
       var option = {
-        // color: ['#288DEF'],
         title: {},
         tooltip: {
           trigger: 'axis',
@@ -290,80 +267,6 @@ export default {
           }
         },
         legend: {},
-        toolbox:{
-          show : true,                                 //是否显示工具栏组件
-          zlevel:0,                                   //所属图形的Canvas分层,zlevel 大的 Canvas 会放在 zlevel 小的 Canvas 的上面
-          z:2,                                         //所属组件的z分层,z值小的图形会被z值大的图形覆盖
-          orient:"vertical",                        //工具栏 icon 的布局朝向'horizontal' 'vertical'
-          left:"right",                              //组件离容器左侧的距离,'left', 'center', 'right','20%'
-          top:"center",                                   //组件离容器上侧的距离,'top', 'middle', 'bottom','20%'
-          right:"auto",                               //组件离容器右侧的距离,'20%'
-          bottom:"auto",                              //组件离容器下侧的距离,'20%'
-          width:"auto",                               //图例宽度
-          height:"auto",                              //图例高度
-
-          itemSize:15,                                 //工具栏 icon 的大小
-          itemGap:10,                                  //工具栏 icon 每项之间的间隔
-          showTitle:true,                             //是否在鼠标 hover 的时候显示每个工具 icon 的标题
-          feature : {
-            mark : {                                 // '辅助线开关'
-              show: true
-            },
-            dataView : {                            //数据视图工具,可以展现当前图表所用的数据,编辑后可以动态更新
-              show: true,                         //是否显示该工具。
-              title:"数据视图",
-              readOnly: false,                    //是否不可编辑(只读)
-              lang: ['数据视图', '关闭', '刷新'],  //数据视图上有三个话术,默认是['数据视图', '关闭', '刷新']
-              backgroundColor:"#fff",             //数据视图浮层背景色。
-              textareaColor:"#fff",               //数据视图浮层文本输入区背景色
-              textareaBorderColor:"#333",         //数据视图浮层文本输入区边框颜色
-              textColor:"#000",                    //文本颜色。
-              buttonColor:"#c23531",              //按钮颜色。
-              buttonTextColor:"#fff",             //按钮文本颜色。
-              optionToContent: function (opt) {
-                var axisData = opt.xAxis[0].data;//x轴作为条件,y轴需改成yAxis[0].data;
-                var series = opt.series;
-                var tdHeads = '<td  style="padding:0 10px">名称</td>';
-                series.forEach(function (item) {
-                  tdHeads += '<td style="padding: 0 10px">'+item.name+'</td>';
-                });
-                var table = '<table border="1" style="margin-left:20px;border-collapse:collapse;font-size:14px;text-align:center;background-color:#f8f4f4"><tbody><tr>'+tdHeads+'</tr>';
-                var tdBodys = '';
-                for (var i = 0, l = axisData.length; i < l; i++) {
-                  for (var j = 0; j < series.length; j++) {
-                    if(typeof(series[j].data[i]) == 'object'){
-                      tdBodys += '<td>'+series[j].data[i].value+'</td>';
-                    }else{
-                      tdBodys += '<td>'+ series[j].data[i]+'</td>';
-                    }
-                  }
-                  table += '<tr><td style="padding: 0 10px">'+axisData[i]+'</td>'+ tdBodys +'</tr>';
-                  tdBodys = '';
-                }
-                table += '</tbody></table>';
-                return table;
-              }
-            },
-            magicType: {                            //动态类型切换
-              show: true,
-              title:"切换",                       //各个类型的标题文本,可以分别配置。
-              type: ['line', 'bar', 'stack', 'tiled'],              //启用的动态类型,包括'line'(切换为折线图), 'bar'(切换为柱状图), 'stack'(切换为堆叠模式), 'tiled'(切换为平铺模式)
-            },
-            restore : {                             //配置项还原。
-              show: true,                         //是否显示该工具。
-              title:"还原",
-            },
-            saveAsImage : {                         //保存为图片。
-              show: true,                         //是否显示该工具。
-              type:"png",                         //保存的图片格式。支持 'png' 和 'jpeg'。
-              name:"pic1",                        //保存的文件名称,默认使用 title.text 作为名称
-              backgroundColor:"#ffffff",        //保存的图片背景色,默认使用 backgroundColor,如果backgroundColor不存在的话会取白色
-              title:"保存为图片",
-              pixelRatio:1                        //保存图片的分辨率比例,默认跟容器相同大小,如果需要保存更高分辨率的,可以设置为大于 1 的值,例如 2
-            },
-
-          },
-        },
         xAxis: {
           type: 'category',
           show: true,
@@ -392,7 +295,7 @@ export default {
         },
         series: seriesdata
       }
-      if(this.ruzhulv === 'yes'){
+      if (this.ruzhulv === 'yes') {
         option.yAxis.name = ''
       }
       if (type === 'bar' || type === 'line') {
@@ -424,33 +327,17 @@ export default {
           },
           fontSize: 16
         }
-        ;(option.series[0].labelLine = {
-          length: 0,
-          length2: 0,
-          maxSurfaceAngle: 80
-        }),
-            (option.series[0].itemStyle = {
-              color: function (params) {
-                var colorList = ['#4B9BDB', '#44BEA3', '#8FB435', '#FEB019', '#19D4AE', '#FA6E86', '#FFB980', '#0067A6', '#C4B4E4', '#D87A80', '#9CBBFF', '#D26900', '	#BBFFFF']
-                return colorList[params.dataIndex]
-              }
-            })
-        // option.title = {
-        //   title: true,
-        //   text: this.all,
-        //   subtext: this.allNum + this.danwei,
-        //   top: 170,
-        //   left: 700,
-        //   textAlign: 'center',
-        //   textStyle: {
-        //     fontSize: '30',
-        //     fontWeight: 'bold',
-        //     color: '#86AFDE'
-        //   },
-        //   subtextStyle: {
-        //     fontSize: '30',
-        //     color: '#FFBA44'
-        //   }
+          (option.series[0].labelLine = {
+            length: 0,
+            length2: 0,
+            maxSurfaceAngle: 80
+          }),
+          (option.series[0].itemStyle = {
+            color: function (params) {
+              var colorList = ['#4B9BDB', '#44BEA3', '#8FB435', '#FEB019', '#19D4AE', '#FA6E86', '#FFB980', '#0067A6', '#C4B4E4', '#D87A80', '#9CBBFF', '#D26900', '	#BBFFFF']
+              return colorList[params.dataIndex]
+            }
+          })
         option.graphic = {
           type: 'group',
           left: 'center',
@@ -525,7 +412,7 @@ export default {
               itemSize: '',
               rotate: -30
             },
-            formatter: function (value, index) {}
+            formatter: function (value, index) { }
           }
         }
         option.yAxis = {
@@ -626,7 +513,7 @@ export default {
       }
     }
   },
-  created() {},
+  created() { },
   mounted() {
     this.$bus.$on('reset-radio', this.resetRadio)
     // this.setTable(this.xStr, this.yName)
@@ -646,17 +533,17 @@ export default {
       this.xfssbXZHOU = array
     },
     tableList(newVal) {
-      if (newVal&&newVal.length>0) {
+      if (newVal && newVal.length > 0) {
         this.newTableList = newVal
         this.deepNewTableList = this.deepCopy(this.newTableList)
         let valueARR = Object.values(this.deepNewTableList[0])
         valueARR.splice(0, 2)
         this.xfssbYZHOU = valueARR
         this.total = this.deepNewTableList[0].total
-      }else {
-        this.newTableList=[]
-        this.xfssbYZHOU=[];
-        this.total=0;
+      } else {
+        this.newTableList = []
+        this.xfssbYZHOU = [];
+        this.total = 0;
       }
       this.setTable(this.xStr, this.yName)
       this.echartsInit(this.echartsId, this.type, this.danwei, this.x, this.y, this.isX, this.isY)
@@ -674,28 +561,34 @@ export default {
   padding: 20px;
   width: 75%;
 }
+
 .echarts-title {
   display: flex;
   justify-content: space-between;
 }
+
 .echarts-title div:nth-child(1) {
   display: flex;
   align-items: center;
   font-size: 12px;
 }
+
 .black-box {
   width: 12px;
   height: 12px;
   background: #000;
 }
+
 .echarts-title div:nth-child(1) span:nth-child(2) {
   margin-left: 10px;
 }
+
 .echarts-text,
 .echarts-radio,
 .xxtj-table {
   margin-top: 15px;
 }
+
 .xxtj-table,
 .echarts,
 .ssqh {

+ 699 - 0
ruoyi-ui/src/components/xxtjEcharts/EchartsBox3/indexOld.vue

@@ -0,0 +1,699 @@
+<template>
+  <div class="echarts">
+    <div class="echarts-title">
+      <div>
+        <span class="black-box"></span>
+        <span>{{ title }}</span>
+      </div>
+
+      <!-- 插入下拉多选框或者日期选择框 -->
+      <slot></slot>
+    </div>
+    <div class="echarts-radio" v-if="isPie">
+      <el-radio @change="changRadio(item)" v-model="radio" :label="item.prop" v-for="item in radioLabel"
+        :key="item.prop">{{ item.label }}</el-radio>
+    </div>
+    <div :id="echartsId" style="width: 1400px; height: 500px" ref="charts"></div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'EchartsBox3',
+  props: {
+    echartsId: {
+      type: [String, Number, Object],
+      default: 'main'
+    },
+    tableList: {
+      type: Array,
+      default: () => [1, 2, 3, 4, 5]
+    },
+    labelKeys: {
+      type: Array,
+      default: () => [1]
+    },
+    unit: {
+      type: String,
+      default: '家'
+    },
+    type: {
+      type: String,
+      default: 'line'
+    },
+    isPie: {
+      type: Boolean,
+      default: true
+    },
+    // 判断x轴的是year 还是 szqh
+    xStr: {
+      type: String,
+      default: 'year'
+    },
+    title: {
+      type: String,
+      default: ''
+    },
+    isX: {
+      type: String,
+      default: 'category'
+    },
+    isY: {
+      type: String,
+      default: 'value'
+    },
+    isfftj: {
+      type: Boolean,
+      default: false
+    },
+    isTwoBar: {
+      type: String,
+      default: 'no'
+    },
+    // 老人留守统计使用的
+    yName: {
+      type: String,
+      default: 'total'
+    },
+    radioName: {
+      type: String,
+      default: 'total'
+    },
+    danwei: {
+      type: String,
+      default: '家'
+    },
+    hengzhu: {
+      type: String,
+      default: 'no'
+    },
+    // 消防设施配备情况表2
+    xfsspbqk: {
+      type: String,
+      default: 'no'
+    },
+    // 是否是入住率
+    ruzhulv: {
+      type: String,
+      default: 'no'
+    }
+  },
+  data() {
+    return {
+      radio: 'total',
+      newKeys: [],
+      newTableList: [],
+      newUnit: '',
+      // radioLabel: [],
+      x: [],
+      y: [],
+      // 消防设施表2
+      deepNewTableList: [],
+      deepNewKeys: [],
+      xfssbXZHOU: [],
+      xfssbYZHOU: [],
+      total: ''
+    }
+  },
+  computed: {
+    // 单选框的名字
+    radioLabel() {
+      return this.newKeys.filter((item) => item.type === 'select')
+    },
+    // 按分类统计,横向表格的 分类名
+    // labelArr() {
+    //   return this.newKeys.filter((item) => item.type === 'select').map((item) => item.label)
+    // },
+    // 饼图全部的名字
+    all() {
+      return this.radioLabel[0].label
+    },
+    allNum() {
+      return this.newTableList[0] ? this.newTableList[0].total : 0;
+    },
+    hengzhuYData() {
+      let array = this.radioLabel.slice(1)
+      let newArr = []
+      array.forEach((item) => {
+        newArr.unshift(item.label)
+      })
+      return newArr
+    }
+  },
+  methods: {
+    // 改变newKeys中的数据
+    // setKeys() {
+    //   let arrLabel = this.newKeys.filter((item) => item.type === 'select')
+    //   this.radioLabel = arrLabel
+    // },
+    // 改变table中X轴的数据的数据格式 参数是 x轴对应的数据名字,y轴对应的数据名字
+    setTable(xAxis, yAxis) {
+      // x轴
+      let arrX = []
+      let arrY = [[], [], []];
+      let temdata = [];
+      console.log(this.newTableList, "sssss")
+      console.log(this.newKeys, "sssss");
+      let zt = 0;
+      for (let i = 0; i < this.newKeys.length; i++) {
+        if (this.newKeys[i].prop == yAxis) {
+
+          if (this.newKeys[i].data) {
+            temdata = this.newKeys[i].data;
+            zt = 1;
+          }
+        }
+      }
+
+      this.newTableList.forEach((item) => {
+        if (this.xStr === 'hjqh') {
+          arrX.push(item[xAxis])
+          arrY.push(item[yAxis])
+        }
+        if (this.xStr === 'year') {
+
+          arrX.unshift(item[xAxis])
+          if (zt == 1) {
+            for (let i = 0; i < temdata.length; i++) {
+              arrY[i].unshift(item[temdata[i].prop])
+            }
+
+          }
+          else
+            arrY.unshift(item[yAxis]);
+        }
+        if (this.hengzhu === 'yes') {
+
+          arrX.unshift(item[xAxis])
+          arrY.unshift(item[yAxis])
+        }
+        if (this.xStr === 'ssqh') {
+
+          arrX.push(item[xAxis])
+          if (zt == 1) {
+            for (let i = 0; i < temdata.length; i++) {
+              arrY[i].push(item[temdata[i].prop])
+            }
+
+          }
+          else
+            arrY.push(item[yAxis]);
+
+        }
+      })
+      this.x = arrX
+      this.y = arrY
+      if (this.isfftj === true) {
+        this.x = this.newKeys.filter((item) => item.type === 'select').map((item) => item.label)
+      }
+    },
+    // 单选框改变事件
+    changRadio(item) {
+      this.$emit('change-radio', this.radio)
+      this.setTable(this.xStr, item.prop)
+
+      this.echartsInit(this.echartsId, this.type, this.danwei, this.x, this.y, this.isX, this.isY)
+    },
+    // echarts 参数为:每个图表id,图表类型,单位,x轴数据,y轴数据,isX和isY是否是横向(value和category)
+    echartsInit(id, type, unit, xAxis, yData, isX, isY) {
+      // 是否显示xy轴
+      let yAxis = yData;
+      let seriesdata = [];
+
+      if (type === 'pie' || this.hengzhu === 'yes') {
+        let array = this.radioLabel.slice(1)
+        yAxis = array.map((item, index) => {
+          return { name: item.label, value: this.newTableList[0] ? this.newTableList[0][item.prop] : 0 }
+        })
+        seriesdata.push({
+          type,
+          data: yAxis,
+          barWidth: '40%',
+          showBackground: true,
+          backgroundStyle: {
+            color: 'rgba(180, 180, 180, 0.2)'
+          },
+          radius: ['50%', '75%'],
+          hoverAnimation: true,
+          avoidLabelOverlap: false,
+          itemStyle: {
+            normal: { color: '#288DEF' }
+          },
+          colorBy: 'series'
+        })
+      } else {
+        for (let i = 0; i < yAxis.length; i++) {
+          let colors = [{ color: '#288DEF' }, { color: '#efd428' }, { color: '#ef2895' }];
+          let names = ["总数", "公办", "民办"];
+          seriesdata.push({
+            type,
+            data: yAxis[i],
+            // barWidth: '40%',
+            name: names[i],
+            barGap: '100%',
+            symbol: 'emptydiamond',
+            showBackground: true,
+            backgroundStyle: {
+              color: 'rgba(180, 180, 180, 0.2)'
+            },
+            radius: ['50%', '75%'],
+            hoverAnimation: true,
+            avoidLabelOverlap: false,
+            itemStyle: {
+              normal: colors[i]
+            },
+            colorBy: 'series'
+          })
+        }
+
+      }
+
+      var myChart = this.$echarts.init(document.getElementById(id))
+      var option = {
+        // color: ['#288DEF'],
+        title: {},
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'shadow'
+          }
+        },
+        legend: {},
+        toolbox: {
+          show: true,                                 //是否显示工具栏组件
+          zlevel: 0,                                   //所属图形的Canvas分层,zlevel 大的 Canvas 会放在 zlevel 小的 Canvas 的上面
+          z: 2,                                         //所属组件的z分层,z值小的图形会被z值大的图形覆盖
+          orient: "vertical",                        //工具栏 icon 的布局朝向'horizontal' 'vertical'
+          left: "right",                              //组件离容器左侧的距离,'left', 'center', 'right','20%'
+          top: "center",                                   //组件离容器上侧的距离,'top', 'middle', 'bottom','20%'
+          right: "auto",                               //组件离容器右侧的距离,'20%'
+          bottom: "auto",                              //组件离容器下侧的距离,'20%'
+          width: "auto",                               //图例宽度
+          height: "auto",                              //图例高度
+
+          itemSize: 15,                                 //工具栏 icon 的大小
+          itemGap: 10,                                  //工具栏 icon 每项之间的间隔
+          showTitle: true,                             //是否在鼠标 hover 的时候显示每个工具 icon 的标题
+          feature: {
+            mark: {                                 // '辅助线开关'
+              show: true
+            },
+            dataView: {                            //数据视图工具,可以展现当前图表所用的数据,编辑后可以动态更新
+              show: true,                         //是否显示该工具。
+              title: "数据视图",
+              readOnly: false,                    //是否不可编辑(只读)
+              lang: ['数据视图', '关闭', '刷新'],  //数据视图上有三个话术,默认是['数据视图', '关闭', '刷新']
+              backgroundColor: "#fff",             //数据视图浮层背景色。
+              textareaColor: "#fff",               //数据视图浮层文本输入区背景色
+              textareaBorderColor: "#333",         //数据视图浮层文本输入区边框颜色
+              textColor: "#000",                    //文本颜色。
+              buttonColor: "#c23531",              //按钮颜色。
+              buttonTextColor: "#fff",             //按钮文本颜色。
+              optionToContent: function (opt) {
+                var axisData = opt.xAxis[0].data;//x轴作为条件,y轴需改成yAxis[0].data;
+                var series = opt.series;
+                var tdHeads = '<td  style="padding:0 10px">名称</td>';
+                series.forEach(function (item) {
+                  tdHeads += '<td style="padding: 0 10px">' + item.name + '</td>';
+                });
+                var table = '<table border="1" style="margin-left:20px;border-collapse:collapse;font-size:14px;text-align:center;background-color:#f8f4f4"><tbody><tr>' + tdHeads + '</tr>';
+                var tdBodys = '';
+                for (var i = 0, l = axisData.length; i < l; i++) {
+                  for (var j = 0; j < series.length; j++) {
+                    if (typeof (series[j].data[i]) == 'object') {
+                      tdBodys += '<td>' + series[j].data[i].value + '</td>';
+                    } else {
+                      tdBodys += '<td>' + series[j].data[i] + '</td>';
+                    }
+                  }
+                  table += '<tr><td style="padding: 0 10px">' + axisData[i] + '</td>' + tdBodys + '</tr>';
+                  tdBodys = '';
+                }
+                table += '</tbody></table>';
+                return table;
+              }
+            },
+            magicType: {                            //动态类型切换
+              show: true,
+              title: "切换",                       //各个类型的标题文本,可以分别配置。
+              type: ['line', 'bar', 'stack', 'tiled'],              //启用的动态类型,包括'line'(切换为折线图), 'bar'(切换为柱状图), 'stack'(切换为堆叠模式), 'tiled'(切换为平铺模式)
+            },
+            restore: {                             //配置项还原。
+              show: true,                         //是否显示该工具。
+              title: "还原",
+            },
+            saveAsImage: {                         //保存为图片。
+              show: true,                         //是否显示该工具。
+              type: "png",                         //保存的图片格式。支持 'png' 和 'jpeg'。
+              name: "pic1",                        //保存的文件名称,默认使用 title.text 作为名称
+              backgroundColor: "#ffffff",        //保存的图片背景色,默认使用 backgroundColor,如果backgroundColor不存在的话会取白色
+              title: "保存为图片",
+              pixelRatio: 1                        //保存图片的分辨率比例,默认跟容器相同大小,如果需要保存更高分辨率的,可以设置为大于 1 的值,例如 2
+            },
+
+          },
+        },
+        xAxis: {
+          type: 'category',
+          show: true,
+          data: xAxis,
+          axisLabel: {
+            interval: 0,
+            textStyle: {
+              color: '#000',
+              fontSize: '10',
+              itemSize: '',
+              rotate: -30
+            }
+          }
+        },
+        yAxis: {
+          type: 'value',
+          scale: true,
+          // inverse: true,
+          show: true,
+          name: '单位:' + unit,
+          nameTextStyle: {
+            color: '#000',
+            nameLocation: 'start'
+          },
+          data: xAxis
+        },
+        series: seriesdata
+      }
+      if (this.ruzhulv === 'yes') {
+        option.yAxis.name = ''
+      }
+      if (type === 'bar' || type === 'line') {
+        option.series[0].label = {
+          show: true,
+          color: '#000',
+          position: 'top',
+          distance: 15,
+          align: 'center',
+          verticalAlign: 'middle',
+          rotate: 0,
+          formatter: '{c}',
+          fontSize: 12,
+          rich: {
+            name: {}
+          }
+        }
+      }
+      if (type === 'pie') {
+        option.series[0].avoidLabelOverlap = true
+        option.series[0].label = {
+          show: true,
+          alignTo: 'edge',
+          minMargin: 5,
+          edgeDistance: 0,
+          lineHeight: 15,
+          formatter: function (params) {
+            return `${params.name}:${params.value}(${params.percent}%)`
+          },
+          fontSize: 16
+        }
+          ; (option.series[0].labelLine = {
+            length: 0,
+            length2: 0,
+            maxSurfaceAngle: 80
+          }),
+            (option.series[0].itemStyle = {
+              color: function (params) {
+                var colorList = ['#4B9BDB', '#44BEA3', '#8FB435', '#FEB019', '#19D4AE', '#FA6E86', '#FFB980', '#0067A6', '#C4B4E4', '#D87A80', '#9CBBFF', '#D26900', '	#BBFFFF']
+                return colorList[params.dataIndex]
+              }
+            })
+        // option.title = {
+        //   title: true,
+        //   text: this.all,
+        //   subtext: this.allNum + this.danwei,
+        //   top: 170,
+        //   left: 700,
+        //   textAlign: 'center',
+        //   textStyle: {
+        //     fontSize: '30',
+        //     fontWeight: 'bold',
+        //     color: '#86AFDE'
+        //   },
+        //   subtextStyle: {
+        //     fontSize: '30',
+        //     color: '#FFBA44'
+        //   }
+        option.graphic = {
+          type: 'group',
+          left: 'center',
+          top: 'center',
+          children: [
+            {
+              //图形中间⽂字
+              type: 'text',
+              left: 'center',
+              top: 'center',
+              style: {
+                text: this.all + '\n',
+                textAlign: 'center',
+                fill: '#492dcb',
+                fontSize: 30,
+                fontWeight: 'bold'
+              }
+            },
+            {
+              //图形中间⽂字
+              type: 'text',
+              left: 'center',
+              top: 'center',
+              style: {
+                text: '\n\n' + this.allNum + this.danwei,
+                textAlign: 'center',
+                fill: '#fad360',
+                fontSize: 30,
+                fontWeight: 'bold'
+              }
+            }
+          ]
+        }
+        option.xAxis = {
+          type: 'category',
+          show: false,
+          data: xAxis,
+          axisLabel: {
+            interval: 0,
+            textStyle: {
+              color: '#000',
+              fontSize: '10',
+              itemSize: '',
+              rotate: -30
+            }
+          }
+        }
+        option.yAxis = {
+          type: 'value',
+          scale: true,
+          // inverse: true,
+          show: false,
+          name: '单位:' + unit,
+          nameTextStyle: {
+            color: '#000',
+            nameLocation: 'start'
+          },
+          data: xAxis
+        }
+      }
+
+      if (this.hengzhu === 'yes') {
+        option.xAxis = {
+          type: 'value',
+          show: false,
+          // data: xAxis,
+          axisLabel: {
+            interval: 0,
+            textStyle: {
+              color: '#000',
+              fontSize: 40,
+              itemSize: '',
+              rotate: -30
+            },
+            formatter: function (value, index) { }
+          }
+        }
+        option.yAxis = {
+          type: 'category',
+          scale: true,
+          // inverse: true,
+          show: true,
+          nameTextStyle: {
+            color: '#000',
+            nameLocation: 'start'
+          },
+          axisLine: {
+            show: false //隐藏x轴线
+          },
+          axisTic: {
+            show: false //隐藏x轴刻度
+          },
+          axisLabel: {
+            interval: 0,
+            textStyle: {
+              color: '#000',
+              fontSize: 20,
+              itemSize: '',
+              rotate: -30
+            }
+          },
+          data: this.hengzhuYData
+        }
+        option.title = {
+          title: true,
+          text: `${this.all}:${this.allNum}(${this.danwei})`,
+          textStyle: {
+            fontSize: '20',
+            fontWeight: 'bold',
+            color: '#86AFDE'
+          },
+          top: 35
+        }
+        option.series[0].label = {
+          show: true,
+          position: 'right',
+          formatter: {},
+          fontSize: 16
+        }
+      }
+      if (this.xfsspbqk === 'yes') {
+        option.xAxis = {
+          type: 'category',
+          show: true,
+          data: this.xfssbXZHOU,
+          axisLabel: {
+            interval: 0,
+            textStyle: {
+              color: '#000',
+              fontSize: '10',
+              itemSize: '',
+              rotate: -30
+            }
+          }
+        }
+        option.series[0] = {
+          type,
+          data: this.xfssbYZHOU,
+          barWidth: '40%',
+          showBackground: true,
+          backgroundStyle: {
+            color: 'rgba(180, 180, 180, 0.2)'
+          },
+          radius: ['50%', '75%'],
+          hoverAnimation: true,
+          avoidLabelOverlap: false,
+          itemStyle: {
+            normal: { color: '#288DEF' }
+          },
+          colorBy: 'series',
+          label: {
+            show: true,
+            color: '#000',
+            position: 'top',
+            distance: 15,
+            align: 'center',
+            verticalAlign: 'middle',
+            rotate: 0,
+            formatter: '{c}',
+            fontSize: 12,
+            rich: {
+              name: {}
+            }
+          }
+        }
+      }
+
+      myChart.setOption(option)
+    },
+    resetRadio(val) {
+      if (val) {
+        this.radio = 'total'
+      }
+    }
+  },
+  created() { },
+  mounted() {
+    this.$bus.$on('reset-radio', this.resetRadio)
+    // this.setTable(this.xStr, this.yName)
+    // this.echartsInit(this.echartsId, this.type, this.danwei, this.x, this.y, this.isX, this.isY)
+  },
+  watch: {
+    unit(newVal) {
+      this.newUnit = newVal
+    },
+    labelKeys(newVal) {
+      this.newKeys = newVal
+      this.deepNewKeys = this.deepCopy(this.newKeys)
+      this.deepNewKeys.splice(0, 2)
+      let array = this.deepNewKeys.map((item) => {
+        return item.label
+      })
+      this.xfssbXZHOU = array
+    },
+    tableList(newVal) {
+      if (newVal && newVal.length > 0) {
+        this.newTableList = newVal
+        this.deepNewTableList = this.deepCopy(this.newTableList)
+        let valueARR = Object.values(this.deepNewTableList[0])
+        valueARR.splice(0, 2)
+        this.xfssbYZHOU = valueARR
+        this.total = this.deepNewTableList[0].total
+      } else {
+        this.newTableList = []
+        this.xfssbYZHOU = [];
+        this.total = 0;
+      }
+      this.setTable(this.xStr, this.yName)
+      this.echartsInit(this.echartsId, this.type, this.danwei, this.x, this.y, this.isX, this.isY)
+    },
+    // 监听子组件中radio的变化
+    radio(newVal) {
+      this.radio = newVal
+    }
+  }
+}
+</script>
+
+<style scoped>
+.echarts {
+  padding: 20px;
+  width: 75%;
+}
+
+.echarts-title {
+  display: flex;
+  justify-content: space-between;
+}
+
+.echarts-title div:nth-child(1) {
+  display: flex;
+  align-items: center;
+  font-size: 12px;
+}
+
+.black-box {
+  width: 12px;
+  height: 12px;
+  background: #000;
+}
+
+.echarts-title div:nth-child(1) span:nth-child(2) {
+  margin-left: 10px;
+}
+
+.echarts-text,
+.echarts-radio,
+.xxtj-table {
+  margin-top: 15px;
+}
+
+.xxtj-table,
+.echarts,
+.ssqh {
+  border: 1px solid #dfe4ed;
+}
+</style>

+ 119 - 0
ruoyi-ui/src/views/search/xxtj/yljgtj/eBox.vue

@@ -0,0 +1,119 @@
+<template>
+  <div>
+    <div :id="eId" style="height: 500px; width: 1200px;"></div>
+  </div>
+</template>
+  
+<script>
+export default {
+  name: 'EchartsWrap',
+  props: {
+    /*echarts相关start*/
+    eId: {
+      type: [String, Number, Object],
+      default: 'echarts-wrap'
+    },
+    eData: {
+      type: Array,
+      default: () => [1, 2, 3, 4, 5]
+    },
+    ekeys: {
+      type: Array,
+      default: () => [1]
+    },
+    type: {
+      type: String,
+      default: 'line'
+    },
+    /*echarts相关end*/
+  },
+  data() {
+    return {
+      // 父组件传过来值的副本
+      copy_eData: [],
+      copy_ekeys: [],
+
+      // X轴数据
+      xData: [],
+      // 要展示的数据
+      seriesData: [],
+      labelName: ['公办', '民办', '全部']
+    }
+  },
+  computed: {},
+  methods: {
+    echartsInit(id, type, xData, data) {
+      var myChart = this.$echarts.init(document.getElementById(id))
+      var options = {
+        title: {},
+        tooltip: {
+          trigger: 'item',
+          axisPointer: {
+            type: 'shadow'
+          }
+        },
+        legend: {},
+        xAxis: {
+          type: 'category',
+          data: xData,
+        },
+        yAxis: {},
+        series: this.seriesData
+      }
+      myChart.setOption(options)
+    },
+    dataTransform(labelName, xName = 'year', type = 'line', lx) {
+      // labelName: 并行的数据条数及名称
+      // xName:x轴数组来源的字段  
+      // type: 图标类型
+      // 数据没有分公办民办
+
+      let xData = [], dataArr = []
+      labelName.forEach((name, i) => {
+        dataArr.push({ name: name, type: type, data: [i + 1, i + 2, i + 3, i + 4, i + 5], value: i })
+      })
+      console.log(dataArr, 'dataArr');
+      this.copy_eData.forEach((item) => {
+        xData.push(item[xName])
+        // dataArr.forEach((ite) => {
+        //   item[lx] == ite.name ? ite.data.push(item) : false
+        // })
+      })
+
+      this.xData = xData
+      this.seriesData = dataArr
+    }
+  },
+  watch: {
+    eData: {
+      deep: true,
+      handler(newVal) {
+        if (newVal && newVal.length > 0) {
+          this.copy_eData = newVal
+        } else {
+          this.copy_eData = []
+        }
+        console.log('copy_eData', this.copy_eData);
+        this.dataTransform(this.labelName)
+        this.echartsInit(this.eId, this.type, this.xData, this.seriesData)
+      }
+    },
+    ekeys: {
+      deep: true,
+      handler(newVal) {
+        if (newVal && newVal.length > 0) {
+          this.copy_ekeys = newVal
+        } else {
+          this.copy_ekeys = []
+        }
+        console.log('copy_ekeys', this.copy_ekeys);
+      }
+    },
+  }
+}
+
+</script>
+  
+<style scoped lang="less">
+
+</style>

+ 0 - 107
ruoyi-ui/src/views/search/xxtj/yljgtj/echartsWrap.vue

@@ -1,107 +0,0 @@
-<template>
-  <div>
-    <div :id="eId" style="height: 500px; width: 1200px;"></div>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'EchartsWrap',
-  props: {
-    /*echarts相关start*/
-    eId: {
-      type: [String, Number, Object],
-      default: 'main'
-    },
-    eData: {
-      type: Array,
-      default: () => [1, 2, 3, 4, 5]
-    },
-    xArr: {
-      type: Array,
-      default: () => [1]
-    },
-    type: {
-      type: String,
-      default: 'line'
-    },
-    /*echarts相关end*/
-  },
-  data() {
-    return {
-      // 父组件传过来值的副本
-      copy_eData: [],
-      copy_xArr: [],
-    }
-  },
-  // mounted() {
-
-  // },
-  computed: {},
-  methods: {
-    echartsInit(id, type, xArr, data) {
-      var myChart = this.$echarts.init(document.getElementById(id))
-      var options = {
-        title: {},
-        tooltip: {
-          trigger: 'item',
-          axisPointer: {
-            type: 'shadow'
-          }
-        },
-        legend: {},
-        xAxis: {
-          type: 'category',
-          data: xArr,
-        },
-        yAxis: {},
-        series: [
-          {
-            name: '公办',
-            type: type,
-            data: [1, 2, 3, 4]
-          },
-          {
-            name: '民办',
-            type: type,
-            data: [5.3, 6, 7, 8]
-          },
-          {
-            name: '全部',
-            type: type,
-            data: [2, 3, 7, 8]
-          }
-        ]
-      }
-      myChart.setOption(options)
-    }
-  },
-  watch: {
-    eData: {
-      deep: true,
-      handler(newVal) {
-        if (newVal && newVal.length > 0) {
-          this.copy_eData = newVal
-        } else {
-          this.copy_eData = []
-        }
-
-        console.log('copy_eData', this.copy_eData);
-        this.echartsInit(this.eId, this.type, this.copy_xArr, this.copy_eData)
-      }
-    },
-    xArr(newVal) {
-      if (newVal && newVal.length > 0) {
-        this.copy_xArr = newVal
-      } else {
-        this.copy_xArr = []
-      }
-      console.log('copy_xArr', this.copy_xArr);
-    },
-  }
-}
-</script>
-
-<style scoped lang="less">
-
-</style>

+ 78 - 170
ruoyi-ui/src/views/search/xxtj/yljgtj/index.vue

@@ -8,50 +8,40 @@
             <div class="echarts-box">
               <div class="ssqh">
                 <p class="sxzd">行政区划</p>
-                <dept-tree  :isTj="true" :isLoad="treeliadzt[3*index+1]"  :ref="'dztree'+(3*index+1)"   :userId="user.userData.dept.parentId" @handleNodeClick="NodeClick(activeName1,activeName2,$event)"> </dept-tree>
+                <dept-tree :isTj="true" :isLoad="treeliadzt[3 * index + 1]" :ref="'dztree' + (3 * index + 1)"
+                  :userId="user.userData.dept.parentId" @handleNodeClick="NodeClick(activeName1, activeName2, $event)">
+                </dept-tree>
               </div>
               <Echarts-box3 v-if="index !== 1 && index !== 8" v-loading="loading" :title="
                 index === 0
                   ? '养老机构备案情况统计-月度'
-                  : index === 1
-                  ? '养老机构法人类型统计-月度'
                   : index === 2
-                  ? '特困救助供养机构统计-月度'
-                  : index === 3
-                  ? '光荣院统计-月度'
-                  : index === 4
-                  ? '街道(乡镇)区域性养老中心-月度'
-                  : index === 5
-                  ? '养老机构兴办主体统计-月度'
-                  : index === 6
-                  ? '养老机构入住率统计-月度'
-                  : index === 7
-                  ? '医疗服务方式-月度'
-                  : '养老机构单位性质统计-月度'
-              " :echartsId="'one' + dict.value" :tableList="formData[3*index+1].vales"
-                :labelKeys="formData[3*index+1].keys" type="line" :ruzhulv="index===6?'yes':'no'" :unit="formData[3*index+1].unit">
+                    ? '特困救助供养机构统计-月度'
+                    : index === 3
+                      ? '光荣院统计-月度'
+                      : index === 4
+                        ? '街道(乡镇)区域性养老中心-月度'
+                        : index === 5
+                          ? '养老机构兴办主体统计-月度'
+                          : index === 6
+                            ? '养老机构入住率统计-月度'
+                            : index === 7
+                              ? '医疗服务方式-月度'
+                              : false
+              " :echartsId="'one' + dict.value" :tableList="formData[3 * index + 1].vales"
+                :labelKeys="formData[3 * index + 1].keys" type="line" :ruzhulv="index === 6 ? 'yes' : 'no'"
+                :unit="formData[3 * index + 1].unit">
                 <Echarts-select @change-year="getNewYear"></Echarts-select>
               </Echarts-box3>
-              <Echarts-box v-if="index == 1 || index == 8" v-loading="loading" :title="
-                index === 0
-                  ? '养老机构备案情况统计-月度'
-                  : index === 1
+              <Echarts-box v-else v-loading="loading" :title="
+                index === 1
                   ? '养老机构法人类型统计-月度'
-                  : index === 2
-                  ? '特困救助供养机构统计-月度'
-                  : index === 3
-                  ? '光荣院统计-月度'
-                  : index === 4
-                  ? '街道(乡镇)区域性养老中心-月度'
-                  : index === 5
-                  ? '养老机构兴办主体统计-月度'
-                  : index === 6
-                  ? '养老机构入住率统计-月度'
-                  : index === 7
-                  ? '医疗服务方式-月度'
-                  : '养老机构单位性质统计-月度'
-              " :echartsId="'one' + dict.value" :tableList="formData[3*index+1].vales"
-                            :labelKeys="formData[3*index+1].keys" type="line" :ruzhulv="index===6?'yes':'no'" :unit="formData[3*index+1].unit">
+                  : index === 8
+                    ? '养老机构单位性质统计-月度'
+                    : false
+              " :echartsId="'one' + dict.value" :tableList="formData[3 * index + 1].vales"
+                :labelKeys="formData[3 * index + 1].keys" type="line" :ruzhulv="index === 6 ? 'yes' : 'no'"
+                :unit="formData[3 * index + 1].unit">
                 <Echarts-select @change-year="getNewYear"></Echarts-select>
               </Echarts-box>
             </div>
@@ -59,19 +49,18 @@
             <!-- table区域 -->
             <div class="xxtj-table">
               <div class="flex-box1">
-                <span>{{index === 6 ? '' :dw}}</span>
+                <span>{{ index === 6 ? '' : dw }}</span>
                 <el-button type="primary" icon="el-icon-download" size="mini"
-                  @click="handleExport(formData[3*index+1],dict.label,'养老机构')">
+                  @click="handleExport(formData[3 * index + 1], dict.label, '养老机构')">
                   导出</el-button>
               </div>
-              <el-table v-loading="loading" :data="formData[3*index+1].vales" style="width: 100%" stripe>
+              <el-table v-loading="loading" :data="formData[3 * index + 1].vales" style="width: 100%" stripe>
                 <el-table-column type="index" label="序号" align="center"> </el-table-column>
                 <!-- 判断一下v-if="!item.label === '未备案'" -->
-                <el-table-column align="center" v-for="item in formData[3*index+1].keys" :key="item.prop"
+                <el-table-column align="center" v-for="item in formData[3 * index + 1].keys" :key="item.prop"
                   :prop="item.prop" :label="item.label" :width="item.width">
-                  <el-table-column v-for="ite in item.data" :key="ite.prop + item.prop" :prop="ite.prop"
-                                                                                               :label="ite.label" width="80"> </el-table-column>
-
+                  <el-table-column align="center" v-for="ite in item.data" :key="ite.prop + item.prop" :prop="ite.prop"
+                    :label="ite.label"> </el-table-column>
                 </el-table-column>
               </el-table>
             </div>
@@ -80,50 +69,38 @@
             <div class="echarts-box">
               <div class="ssqh">
                 <p class="sxzd">行政区划</p>
-                <dept-tree :isTj="true" :isLoad="treeliadzt[3*index+2]"  :ref="'dztree'+(3*index+2)"  :userId="user.userData.dept.parentId" @handleNodeClick="NodeClick(activeName1,activeName2,$event)"> </dept-tree>
+                <dept-tree :isTj="true" :isLoad="treeliadzt[3 * index + 2]" :ref="'dztree' + (3 * index + 2)"
+                  :userId="user.userData.dept.parentId" @handleNodeClick="NodeClick(activeName1, activeName2, $event)">
+                </dept-tree>
               </div>
-              <Echarts-box3  v-if="index !== 1 && index !== 8" danwei="家" v-loading="loading" :title="
+              <Echarts-box3 v-if="index !== 1 && index !== 8" danwei="家" v-loading="loading" :title="
                 index === 0
                   ? '养老机构备案情况统计-行政区划'
-                  : index === 1
-                  ? '养老机构法人类型统计-行政区划'
                   : index === 2
-                  ? '特困救助供养机构统计-行政区划'
-                  : index === 3
-                  ? '光荣院统计-行政区划'
-                  : index === 4
-                  ? '街道(乡镇)区域性养老中心-行政区划'
-                  : index === 5
-                  ? '养老机构兴办主体统计-行政区划'
-                  : index === 6
-                  ? '养老机构入住率统计-行政区划'
-                  : index === 7
-                  ? '医疗服务方式-行政区划'
-                  : '养老机构单位性质统计-行政区划'
-              " :echartsId="'two' + dict.value" type="bar" xStr="ssqh" :tableList="formData[3*index+2].vales"
-                :labelKeys="formData[3*index+2].keys">
+                    ? '特困救助供养机构统计-行政区划'
+                    : index === 3
+                      ? '光荣院统计-行政区划'
+                      : index === 4
+                        ? '街道(乡镇)区域性养老中心-行政区划'
+                        : index === 5
+                          ? '养老机构兴办主体统计-行政区划'
+                          : index === 6
+                            ? '养老机构入住率统计-行政区划'
+                            : index === 7
+                              ? '医疗服务方式-行政区划'
+                              : false
+              " :echartsId="'two' + dict.value" type="bar" xStr="ssqh" :tableList="formData[3 * index + 2].vales"
+                :labelKeys="formData[3 * index + 2].keys">
                 <Echarts-date @change-dateYear="changDateYear" @change-dateMonth="changeDateMonth"></Echarts-date>
               </Echarts-box3>
-              <Echarts-box  v-if="index == 1 || index == 8" danwei="家" v-loading="loading" :title="
-                index === 0
-                  ? '养老机构备案情况统计-行政区划'
-                  : index === 1
+              <Echarts-box v-if="index == 1 || index == 8" danwei="家" v-loading="loading" :title="
+                index === 1
                   ? '养老机构法人类型统计-行政区划'
-                  : index === 2
-                  ? '特困救助供养机构统计-行政区划'
-                  : index === 3
-                  ? '光荣院统计-行政区划'
-                  : index === 4
-                  ? '街道(乡镇)区域性养老中心-行政区划'
-                  : index === 5
-                  ? '养老机构兴办主体统计-行政区划'
-                  : index === 6
-                  ? '养老机构入住率统计-行政区划'
-                  : index === 7
-                  ? '医疗服务方式-行政区划'
-                  : '养老机构单位性质统计-行政区划'
-              " :echartsId="'two' + dict.value" type="bar" xStr="ssqh" :tableList="formData[3*index+2].vales"
-                             :labelKeys="formData[3*index+2].keys">
+                  : index === 8
+                    ? '养老机构单位性质统计-行政区划'
+                    : false
+              " :echartsId="'two' + dict.value" type="bar" xStr="ssqh" :tableList="formData[3 * index + 2].vales"
+                :labelKeys="formData[3 * index + 2].keys">
                 <Echarts-date @change-dateYear="changDateYear" @change-dateMonth="changeDateMonth"></Echarts-date>
               </Echarts-box>
             </div>
@@ -131,18 +108,17 @@
             <!-- table区域 -->
             <div class="xxtj-table">
               <div class="flex-box1">
-                <span>{{index === 6 ? '' :dw}}</span>
+                <span>{{ index === 6 ? '' : dw }}</span>
                 <el-button type="primary" icon="el-icon-download" size="mini"
-                  @click="handleExport(formData[3*index+2],dict.label,'养老机构')">
+                  @click="handleExport(formData[3 * index + 2], dict.label, '养老机构')">
                   导出</el-button>
               </div>
-              <el-table v-loading="loading" :data="formData[3*index+2].vales" style="width: 100%" stripe>
+              <el-table v-loading="loading" :data="formData[3 * index + 2].vales" style="width: 100%" stripe>
                 <el-table-column type="index" label="序号" align="center"></el-table-column>
-                <el-table-column align="center" v-for="item in formData[3*index+2].keys" :key="item.prop"
+                <el-table-column align="center" v-for="item in formData[3 * index + 2].keys" :key="item.prop"
                   :prop="item.prop" :label="item.label" :width="item.width">
-                  <el-table-column v-for="ite in item.data" :key="ite.prop + item.prop" :prop="ite.prop"
-                                                                                                  :label="ite.label" width="80"> </el-table-column>
-
+                  <el-table-column align="center" v-for="ite in item.data" :key="ite.prop + item.prop" :prop="ite.prop"
+                    :label="ite.label"> </el-table-column>
                 </el-table-column>
               </el-table>
             </div>
@@ -151,17 +127,18 @@
             <div class="echarts-box">
               <div class="ssqh">
                 <p class="sxzd">行政区划</p>
-
-                <dept-tree :isTj="true" :isLoad="treeliadzt[3*index+3]"  :ref="'dztree'+(3*index+3)" :userId="user.userData.dept.parentId" @handleNodeClick="NodeClick(activeName1,activeName2,$event)"> </dept-tree>
+                <dept-tree :isTj="true" :isLoad="treeliadzt[3 * index + 3]" :ref="'dztree' + (3 * index + 3)"
+                  :userId="user.userData.dept.parentId" @handleNodeClick="NodeClick(activeName1, activeName2, $event)">
+                </dept-tree>
               </div>
               <Echarts-box v-if="index !== 6" danwei="家" v-loading="loading"
                 :title="index === 0 ? '养老机构备案情况统计' : index === 1 ? '养老机构法人类型统计' : index === 2 ? '' : index === 3 ? '' : index === 4 ? '' : index === 5 ? '养老机构兴办主体统计' : index === 6 ? '养老机构入住率统计' : index === 7 ? '医疗服务方式' : '养老机构单位性质统计'"
-                :echartsId="'three' + dict.value" type="pie" :isPie="false" :tableList="formData[3*index+3].vales"
-                :labelKeys="formData[3*index+3].keys">
+                :echartsId="'three' + dict.value" type="pie" :isPie="false" :tableList="formData[3 * index + 3].vales"
+                :labelKeys="formData[3 * index + 3].keys">
               </Echarts-box>
               <rzl-Echarts :isPie="false" v-if="index === 6" v-loading="loading" title="养老机构入住率统计"
-                :echartsId="'six' + dict.value" :tableList="formData[3*index+3].vales"
-                :labelKeys="formData[3*index+3].keys" type="pie" :unit="formData[3*index+3].unit"></rzl-Echarts>
+                :echartsId="'six' + dict.value" :tableList="formData[3 * index + 3].vales"
+                :labelKeys="formData[3 * index + 3].keys" type="pie" :unit="formData[3 * index + 3].unit"></rzl-Echarts>
             </div>
             <div class="left-bottom-text">
               <!-- <span>注:本功能统计截止当天的数量及占比</span> -->
@@ -190,18 +167,7 @@ export default {
   data() {
     return {
       ydtitle: '',
-      dw:'单位:家',
-      // ydtitle: {
-      //   0: '养老机构备案情况统计-月度',
-      //   1: '养老机构法人类型统计-月度',
-      //   2: '特困救助供养机构统计-月度',
-      //   3: '光荣院统计-月度',
-      //   4: '街道(乡镇)区域性养老中心-月度',
-      //   5: '养老机构兴办主体统计-月度',
-      //   6: '养老机构入住率统计-月度',
-      //   7: '医疗服务方式-月度',
-      //   8: '养老机构单位性质统计-月度'
-      // },
+      dw: '单位:家',
       loading: true,
       // 外侧tabs绑定的name
       activeName1: '1',
@@ -308,28 +274,10 @@ export default {
         this.getTableList();
         this.tabisini[this.formDataidx] = true;
       }
-
     },
 
-
-
     // 节点单击事件
-    handleNodeClick(data) {
-      this.queryParams.para2 = data.code
-
-      // this.$nextTick(() => {
-      //   this.$refs.echartsBoxRef.radio = 'total'
-      //   console.log(this.$refs.echartsBoxRef.radio, '父组件中的radio')
-      // })
-      // this.handleQuery()
-      this.getTableList()
-    },
-
     NodeClick(idxa, idxb, data) {
-      // alert(idxa);
-      // alert(idxb);
-      // alert(event.code);
-      // this[method](event);
       this.queryParams.para2 = data.code;
       this.getTableList();
     },
@@ -342,10 +290,9 @@ export default {
     // 获取表格数据
     keys() {
       let arr = []
-
-      if (this.activeName1 === '1' && (this.activeName2 === '1' || this.activeName2 === '2')) {
-       // let unit = this.formData[this.formDataidx].unit.split(',')
-        let unit =["总数","公办","民办"]
+      if (this.activeName1 !== '2' && this.activeName1 !== '9' && (this.activeName2 === '1' || this.activeName2 === '2')) {
+        // let unit = this.formData[this.formDataidx].unit.split(',')
+        let unit = ["总数", "公办", "民办"]
         let number = 3
         let num = 0
         this.formData[this.formDataidx].keys.forEach((item, index) => {
@@ -355,10 +302,10 @@ export default {
             if (num % number === 0) {
               var temitem = JSON.parse(JSON.stringify(item))
               temitem.data = []
-              temitem.data.push({ ...item, label: unit[num % number],width:'100' })
+              temitem.data.push({ ...item, label: unit[num % number], width: '100' })
               arr.push(temitem)
             } else {
-              arr[arr.length - 1].data.push({ ...item, label: unit[num % number],width:'100' })
+              arr[arr.length - 1].data.push({ ...item, label: unit[num % number], width: '100' })
             }
             num++
           }
@@ -367,62 +314,22 @@ export default {
       }
     },
     async getTableList() {
-      // var para = {}
-      // para.dictType = 'yljg_zhtj'
-      // para.outType = '0'
-      // para.para1 = '1'
-      // para.para2 = '277f45bc79f040839848fba510be1c6d'
-
       this.loading = true
       let retdata = await getstatisticaldata(this.queryParams)
       this.loading = false
       if (retdata.code == 200) {
         var data = this.$DBRetToObjA(retdata.data)
-
-
         this.formData[this.formDataidx] = data[0];
         this.keys();
-
       }
     }
-  },
-  mounted() {
-    this.$nextTick(() => {
-
-
-      // this.$refs.videoPlayer1.$children[0].$refs.tabs[0].style.display = 'none';
-      // console.log(this.$refs.tabs.$children[0].$refs);
-      // console.log(this.$refs.tabs.$children[0].$refs.tabs);
-
-    });
-
-
-    //console.log( this.$refs.dztree1,'bbb2');
-
-
-  },
-  beforeUpdate() {
-
-
-
-
-  },
-  updated() {
-
-
   },
   created() {
-
     for (let i = 0; i < 100; i++) {
-      this.formData[i] =
-      {
-        unit: null, vales: null, keys: null
-      }
+      this.formData[i] = { unit: null, vales: null, keys: null }
     }
     this.getTableList();
     this.treeliadzt[1] = true;
-
-
   }
 }
 </script>
@@ -490,6 +397,7 @@ export default {
 .left-bottom-text {
   color: #000000a6;
 }
+
 .sxzd {
   font-weight: 600;
   margin: 10px 15px;