瀏覽代碼

Merge branch 'nan' of sckj/mz-cloud into master

NanMing 2 年之前
父節點
當前提交
5f9cedbf5c

+ 3 - 15
ruoyi-ui/src/components/xxtjEcharts/EchartsBox3/index.vue

@@ -13,10 +13,6 @@
       <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 class="echarts-radio" v-if="title=='养老床位统计'">
-      <el-radio label="a" key="a" v-model="gb">公办</el-radio>  
-      <el-radio label="b" key="b">民办</el-radio> 
-    </div>
     <div :id="echartsId" style="width: 1400px; height: 500px" ref="charts"></div>
   </div>
 </template>
@@ -147,7 +143,7 @@ export default {
     setTable(xAxis, yAxis) {
       // x轴
       let arrX = []
-      let arrY = [[], [], []];
+      let arrY = [[], [], [], []];
       let temdata = [];
       let zt = 0;
       for (let i = 0; i < this.newKeys.length; i++) {
@@ -227,7 +223,7 @@ export default {
       } else {
         for (let i = 0; i < yAxis.length; i++) {
           let colors = [{ color: '#288DEF' }, { color: '#efd428' }, { color: '#ef2895' }];
-          let names = ["总数", "公办", "民办"];
+          let names = ["总数", "公办", "民办", "公办民营"];
           seriesdata.push({
             type,
             data: yAxis[i],
@@ -248,7 +244,6 @@ export default {
             colorBy: 'series'
           })
         }
-
       }
 
       var myChart = this.$echarts.init(document.getElementById(id))
@@ -332,7 +327,7 @@ export default {
         series: seriesdata
       }
       }
-      
+
       if (this.ruzhulv === 'yes') {
         option.yAxis.name = ''
       }
@@ -543,13 +538,6 @@ export default {
         }
       }
 
-      if (this.title == '养老床位统计') {
-        option.series[0].label.formatter = '{c}%',
-        option.series[0].data[0].value = '23',
-        option.series[0].data[1].value = '100',
-        option.series[0].data[2].value = '9'
-      }
-
       myChart.setOption(option)
     },
     resetRadio(val) {

+ 63 - 123
ruoyi-ui/src/components/xxtjEcharts/EchartsBox3/indexO.vue

@@ -13,6 +13,10 @@
       <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 class="echarts-radio" v-if="title=='养老床位统计'">
+      <el-radio label="a" key="a" v-model="gb">公办</el-radio>
+      <el-radio label="b" key="b">民办</el-radio>
+    </div>
     <div :id="echartsId" style="width: 1400px; height: 500px" ref="charts"></div>
   </div>
 </template>
@@ -20,7 +24,7 @@
 <script>import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
 
 export default {
-  name: 'EchartsBox3',
+  name: 'EchartsBox7',
   props: {
     echartsId: {
       type: [String, Number, Object],
@@ -108,6 +112,7 @@ export default {
       // radioLabel: [],
       x: [],
       y: [],
+      gb: "a",
       // 消防设施表2
       deepNewTableList: [],
       deepNewKeys: [],
@@ -119,12 +124,8 @@ export default {
   computed: {
     // 单选框的名字
     radioLabel() {
-      return this.newKeys.filter((item) => item.type === 'select')
+      return this.newKeys.filter((item) => item.data)
     },
-    // 按分类统计,横向表格的 分类名
-    // labelArr() {
-    //   return this.newKeys.filter((item) => item.type === 'select').map((item) => item.label)
-    // },
     // 饼图全部的名字
     all() {
       return this.radioLabel[0].label
@@ -142,63 +143,46 @@ 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=[];
-      let zt=0;
-      for (let i = 0; i <this.newKeys.length ; i++) {
-        if (this.newKeys[i].prop==yAxis)
-        {
-
+      let arrY = [[], [], []];
+      let temdata = [];
+      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]);
+          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]);
-
+          } else arrY.push(item[yAxis]);
         }
       })
       this.x = arrX
@@ -211,7 +195,6 @@ export default {
     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)
@@ -269,7 +252,9 @@ export default {
       }
 
       var myChart = this.$echarts.init(document.getElementById(id))
-      var option = {
+      var option;
+      if (this.title === '养老床位统计') {
+        option = {
         // color: ['#288DEF'],
         title: {},
         tooltip: {
@@ -279,80 +264,45 @@ 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,
+          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
+      }
+      } else {
+        option = {
+        // color: ['#288DEF'],
+        title: {},
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'shadow'
+          }
+        },
+        legend: {},
         xAxis: {
           type: 'category',
           show: true,
@@ -381,6 +331,8 @@ export default {
         },
         series: seriesdata
       }
+      }
+
       if (this.ruzhulv === 'yes') {
         option.yAxis.name = ''
       }
@@ -424,22 +376,6 @@ export default {
                 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',
@@ -607,6 +543,13 @@ export default {
         }
       }
 
+      if (this.title == '养老床位统计') {
+        option.series[0].label.formatter = '{c}%',
+        option.series[0].data[0].value = '23',
+        option.series[0].data[1].value = '100',
+        option.series[0].data[2].value = '9'
+      }
+
       myChart.setOption(option)
     },
     resetRadio(val) {
@@ -615,11 +558,8 @@ export default {
       }
     }
   },
-  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) {

+ 2 - 0
ruoyi-ui/src/main.js

@@ -92,6 +92,7 @@ import EchartsBox3 from '@/components/xxtjEcharts/EchartsBox3'
 import EchartsBox4 from '@/components/xxtjEcharts/EchartsBox4'
 import EchartsBox5 from '@/components/xxtjEcharts/EchartsBox5'
 import EchartsBox6 from '@/components/xxtjEcharts/EchartsBox6'
+import EchartsBox7 from '@/components/xxtjEcharts/EchartsBox7'
 import ylbttjEcharts from '@/components/xxtjEcharts/ylbttjEcharts'
 import rzlEcharts from '@/components/xxtjEcharts/rzlEcharts'
 import xxtjTree from '@/components/xxtjTree/index.vue'
@@ -179,6 +180,7 @@ Vue.component('Echarts-box3', EchartsBox3)
 Vue.component('Echarts-box4', EchartsBox4)
 Vue.component('Echarts-box5', EchartsBox5)
 Vue.component('Echarts-box6', EchartsBox6)
+Vue.component('Echarts-box7', EchartsBox7)
 Vue.component('Echarts-mdtj', EchartsBoxMdtj)
 
 Vue.component('ylbttj-Echarts', ylbttjEcharts)

+ 23 - 22
ruoyi-ui/src/views/search/xxtj/cyrytj/yljg/index.vue

@@ -189,28 +189,27 @@ export default {
       this.getTableList()
     },
 	  keys() {
-		  let arr = [];
-		  if (this.activeName2 !== '3') {
-			  this.formData[this.formDataidx].keys.forEach((item) => {
-				  if (item.type === 'fixed') {
-					  arr.push(item);
-				  } else if (item.type === 'select') {
-					  var temitem = JSON.parse(JSON.stringify(item));
-					  temitem.data = [
-						  { label: '总数', prop: 'dataA', type: 'select', width: '100' },
-						  { label: '公办', prop: 'dataG', type: 'select', width: '100' },
-						  { label: '民办', prop: 'dataM', type: 'select', width: '100' },
-					  ];
-					  arr.push(temitem);
+		  let arr = []
+		  let unit = ["总数", "公办", "民办","公办民营"]
+		  let number = 4
+		  let num = 0
+		  this.formData[this.formDataidx].keys.forEach((item) => {
+			  if (item.type === 'fixed') {
+				  arr.push(item)
+			  } else if (item.type === 'select') {
+				  if (num % number === 0) {
+					  var temitem = JSON.parse(JSON.stringify(item))
+					  temitem.data = []
+					  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' })
 				  }
-			  });
-			  this.formData[this.formDataidx].keys = arr;
-			  this.formData[this.formDataidx].vales.forEach((item, index) => {
-				  item.dataA = (index + 1) * 4;
-				  item.dataG = (index + 1) * 2;
-				  item.dataM = (index + 1) * 2;
-			  });
-		  }
+				  num++
+			  }
+		  })
+		  this.formData[this.formDataidx].keys = arr;
+
 	  },
     // 获取表格数据
     async getTableList() {
@@ -225,7 +224,9 @@ export default {
       if (retdata.code == 200) {
         var data = this.$DBRetToObjA(retdata.data)
         this.formData[this.formDataidx] = data[0];
-				this.keys()
+				if(this.formDataidx !== 3){
+					this.keys()
+				}
       }
     }
   },

+ 2 - 2
ruoyi-ui/src/views/search/xxtj/ylcwtj/sqylfwjghss/index.vue

@@ -209,8 +209,8 @@ export default {
 
     keys() {
       let arr = []
-      let unit = ["总数", "公办", "民办"]
-      let number = 3
+	    let unit = ["总数", "公办", "民办","公办民营"]
+	    let number = 4
       let num = 0
       this.formData[this.formDataidx].keys.forEach((item) => {
         if (item.type === 'fixed') {

+ 2 - 2
ruoyi-ui/src/views/search/xxtj/ylcwtj/yljg/index.vue

@@ -213,8 +213,8 @@ export default {
 
     keys() {
       let arr = []
-      let unit = ["总数", "公办", "民办"]
-      let number = 3
+      let unit = ["总数", "公办", "民办","公办民营"]
+      let number = 4
       let num = 0
       this.formData[this.formDataidx].keys.forEach((item) => {
         if (item.type === 'fixed') {