Browse Source

修改报告图表显示错误问题

plg 1 month ago
parent
commit
3ebb5f7216
2 changed files with 8 additions and 6 deletions
  1. 3 4
      src/components/BingChart2.vue
  2. 5 2
      src/components/PlanReport.vue

+ 3 - 4
src/components/BingChart2.vue

@@ -42,7 +42,6 @@ export default {
   },
   },
   methods: {
   methods: {
     myPieEcharts(pieData) {
     myPieEcharts(pieData) {
-
       let myChart = this.$echarts.init(document.getElementById(this.chartId));
       let myChart = this.$echarts.init(document.getElementById(this.chartId));
       let option = {
       let option = {
         title: {
         title: {
@@ -64,7 +63,7 @@ export default {
           formatter:function(params){
           formatter:function(params){
             console.log('自定义参数')
             console.log('自定义参数')
             console.log(params)
             console.log(params)
-            let val = params.marker+params.name+'<br/>'+params.value+'人';
+            let val = params.marker+params.name+'<br/>'+params.data.really+'人';
             return val
             return val
           }
           }
         },
         },
@@ -95,8 +94,8 @@ export default {
             // name:100-parseInt(pieData[0].value/(pieData[0].value+ pieData[1].value)*100)   + "%"+pieData[1].name,itemStyle:{color:'#FFAE00'
             // name:100-parseInt(pieData[0].value/(pieData[0].value+ pieData[1].value)*100)   + "%"+pieData[1].name,itemStyle:{color:'#FFAE00'
             //pieData[0].value  :1
             //pieData[0].value  :1
             data: [
             data: [
-              { value: (pieData[0].value==0||pieData[1].value==0)?1:pieData[0].value-pieData[1].value, name:pieData[0].value==0||pieData[1].value==0?'100%心理健康': (100-pieData[1].value/(pieData[0].value)*100).toFixed(2)  +'%心理健康',itemStyle:{color:'#5470C6',fontSize:'20'}},
-              { value:pieData[1].value, name:(pieData[0].value==0||pieData[1].value==0)?`0%${pieData[1].name}`:(pieData[1].value/(pieData[0].value)*100).toFixed(2)   + "%"+pieData[1].name,itemStyle:{color:'#FFAE00',fontSize:'20'}},
+              { value: (pieData[0].value==0||pieData[1].value==0)?1:pieData[0].value-pieData[1].value, name:pieData[0].value==0||pieData[1].value==0?'100%心理健康': (100-pieData[1].value/(pieData[0].value)*100).toFixed(2)  +'%心理健康',itemStyle:{color:'#5470C6',fontSize:'20'},really:pieData[0].value-pieData[1].value},
+              { value:pieData[1].value, name:(pieData[0].value==0||pieData[1].value==0)?`0%${pieData[1].name}`:(pieData[1].value/(pieData[0].value)*100).toFixed(2)   + "%"+pieData[1].name,itemStyle:{color:'#FFAE00',fontSize:'20'},really:pieData[1].value},
             ],
             ],
           },
           },
         ],
         ],

+ 5 - 2
src/components/PlanReport.vue

@@ -418,7 +418,7 @@
                     class="sex_class1"
                     class="sex_class1"
                     style="background-color: #5470c6; text-align: center; color: #ffffff"
                     style="background-color: #5470c6; text-align: center; color: #ffffff"
                   >
                   >
-                    {{ subAll }}人</span
+                    {{ subAll-subSingle }}人</span
                   >
                   >
                   <span
                   <span
                     class="sex_class1"
                     class="sex_class1"
@@ -1373,7 +1373,7 @@ export default {
         if (res && res.code == 200) {
         if (res && res.code == 200) {
           this.subDimeList = res.data;
           this.subDimeList = res.data;
           //调用性别的选项
           //调用性别的选项
-
+          this.tabName=res.data[0].paramValue
           this.getSubOption(this.tabName);
           this.getSubOption(this.tabName);
         } else {
         } else {
           this.$message.error(res.msg);
           this.$message.error(res.msg);
@@ -1386,6 +1386,8 @@ export default {
         if (res && res.code == 200) {
         if (res && res.code == 200) {
           this.subOption = res.data;
           this.subOption = res.data;
           this.subValue = res.data[0];
           this.subValue = res.data[0];
+
+          //选中子维度
           let params = {
           let params = {
             dimensionName: this.dime,
             dimensionName: this.dime,
             orgList: this.orgName,
             orgList: this.orgName,
@@ -1423,6 +1425,7 @@ export default {
                 name: `中重度${this.dime == "躯体化" ? "压力" : this.dime}`,
                 name: `中重度${this.dime == "躯体化" ? "压力" : this.dime}`,
               },
               },
             ];
             ];
+      
             // {{ subValue }}&nbsp;&nbsp;&nbsp;&nbsp;中重度{{ dime}}
             // {{ subValue }}&nbsp;&nbsp;&nbsp;&nbsp;中重度{{ dime}}
             this.queryStudentData();
             this.queryStudentData();
             //调用接口开始查询选择的列表
             //调用接口开始查询选择的列表