소스 검색

修改测试关键字段未开始----数据将保留两位小数

plg 1 주 전
부모
커밋
74a8b89ce4

BIN
src/assets/menu/asy.png


+ 5 - 5
src/components/BingChart.vue

@@ -119,9 +119,9 @@ export default {
                 name:
                   pieData[0].value + pieData[1].value == 0
                     ? "0%"
-                    : parseInt(
+                    : (
                         (pieData[0].value / (pieData[0].value + pieData[1].value)) * 100
-                      ) +
+                      ).toFixed(2) +
                       "%" +
                       pieData[0].name,
                 itemStyle: { color: "#5470C6", fontSize: "20" },
@@ -131,10 +131,10 @@ export default {
                 name:
                   pieData[0].value + pieData[1].value == 0
                     ? "0%"
-                    : 100 -
-                      parseInt(
+                    : (100 -
+                     (
                         (pieData[0].value / (pieData[0].value + pieData[1].value)) * 100
-                      ) +
+                      ) ).toFixed(2)+
                       "%" +
                       pieData[1].name,
                 itemStyle: { color: "#FFAE00", fontSize: "20" },

+ 2 - 2
src/components/BingChart2.vue

@@ -95,8 +95,8 @@ export default {
             // name:100-parseInt(pieData[0].value/(pieData[0].value+ pieData[1].value)*100)   + "%"+pieData[1].name,itemStyle:{color:'#FFAE00'
             //pieData[0].value  :1
             data: [
-              { value: pieData[0].value==0?1:pieData[0].value-pieData[1].value, name:pieData[0].value==0?'100%心理健康': 100-parseFloat((pieData[1].value/(pieData[0].value)*100).toFixed(2))  +'%心理健康',itemStyle:{color:'#5470C6',fontSize:'20'}},
-              { value:pieData[1].value, name:pieData[0].value==0?'0%中重度焦虑':parseFloat(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'}},
+              { value:pieData[1].value, name:(pieData[0].value==0||pieData[1].value==0)?'0%中重度焦虑':(pieData[1].value/(pieData[0].value)*100).toFixed(2)   + "%"+pieData[1].name,itemStyle:{color:'#FFAE00',fontSize:'20'}},
             ],
           },
         ],

+ 1 - 1
src/components/ComparePlanUser.vue

@@ -65,7 +65,7 @@
                     src="../assets/img/home/isNo.png"
                     alt=""
                   />  
-                  <div style="color: #d52121">未开始</div>
+                  <div style="color: #d52121">未完成</div>
                 </div>
               </template>
             </el-table-column>

+ 111 - 115
src/components/PieChart2.vue

@@ -1,123 +1,119 @@
 <template>
-    <div class="pie-chart-content">
-      <div ref="myPieChart" :id="chartId" style="width: 100%;height: 200px;"></div>
-    </div>
-  </template>
-  
-  <script>
-  export default {
-    name: "pieChart",
-    components: {},
-    props: {
-      options: {
-        type: Array,
-        default: function () {
-          return []
-        },
-      },
-      chartId: {
-        type: String,
-        default: ''
-      },
-      chartName: {
-        type: String,
-        default: ''
+  <div class="pie-chart-content">
+    <div ref="myPieChart" :id="chartId" style="width: 100%; height: 200px"></div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "pieChart",
+  components: {},
+  props: {
+    options: {
+      type: Array,
+      default: function () {
+        return [];
       },
     },
-    data() {
-      return {
-        color: ['#FCEF9A', '#D54039', '#56743E', '#FF917C'],
-        pieData: [],
-      }
+    chartId: {
+      type: String,
+      default: "",
     },
-    // mounted() {
-    //   this.myPieEcharts(this.options);
-    // },
-    computed: {},
-    watch: {
-      options() {
-          this.myPieEcharts(this.options);
-      }
+    chartName: {
+      type: String,
+      default: "",
     },
-    methods: {
-      myPieEcharts(pieData) {
-        console.log('pieData', pieData)
-        let myChart = this.$echarts.init(document.getElementById(this.chartId));
-        console.log(myChart);
-        //配置图表
-        let option = {
-          title: {
-            text: this.chartName,
-            subtext: "百分比",
-            left: "center",
-            top: '60%'
-          },
-          tooltip: {
-            trigger: "item",
-          },
-          legend: {
-            orient: "vertical",
-            left: "left",
-            // top: "38%",
-            // bottom:0
-          },
-          series: [
-            {
-              name: "",
-              type: "pie",
-              radius: "40%",
-              center: ["50%", "40%"],
-              // data: [
-              //   { value: 1048, name: 'Search Engine' },
-              //   { value: 735, name: 'Direct' },
-              //   { value: 580, name: 'Email' },
-              //   { value: 484, name: 'Union Ads' },
-              //   { value: 300, name: 'Video Ads' }
-              // ],
-              data: pieData,
-              emphasis: {
-                itemStyle: {
-                  shadowBlur: 10,
-                  shadowOffsetX: 0,
-                  shadowColor: "rgba(0, 0, 0, 0.5)",
-                },
+  },
+  data() {
+    return {
+      color: ["#FCEF9A", "#D54039", "#56743E", "#FF917C"],
+      pieData: [],
+    };
+  },
+  // mounted() {
+  //   this.myPieEcharts(this.options);
+  // },
+  computed: {},
+  watch: {
+    options() {
+      this.myPieEcharts(this.options);
+    },
+  },
+  methods: {
+    myPieEcharts(pieData) {
+      console.log("pieData", pieData);
+      let myChart = this.$echarts.init(document.getElementById(this.chartId));
+      console.log(myChart);
+      //配置图表
+      let option = {
+        title: {
+          text: this.chartName,
+          subtext: "百分比",
+          left: "center",
+          top: "60%",
+        },
+        tooltip: {
+          trigger: "item",
+        },
+        legend: {
+          orient: "vertical",
+          left: "left",
+          // top: "38%",
+          // bottom:0
+        },
+        series: [
+          {
+            name: "",
+            type: "pie",
+            radius: "40%",
+            center: ["50%", "40%"],
+            // data: [
+            //   { value: 1048, name: 'Search Engine' },
+            //   { value: 735, name: 'Direct' },
+            //   { value: 580, name: 'Email' },
+            //   { value: 484, name: 'Union Ads' },
+            //   { value: 300, name: 'Video Ads' }
+            // ],
+            data: pieData,
+            emphasis: {
+              itemStyle: {
+                shadowBlur: 10,
+                shadowOffsetX: 0,
+                shadowColor: "rgba(0, 0, 0, 0.5)",
               },
             },
-          ],
-        };
-  
-        pieData && option && myChart.setOption(option);
-  
-        window.onresize = function () {
-          myChart.resize();
-        };
-      },
-      pieDataHandle(param) {
-  
-        this.pieData = [];
-  
-        // param.groupData.map((item,index) => {
-        //
-        //   this.lineData.push({
-        //     type: 'line',
-        //     name: item.name,
-        //     data: item.value,
-        //   });
-        //
-        // });
-        //
-        // this.myLineEcharts(param.category,this.lineData);
-  
-      }
-  
+          },
+        ],
+      };
+
+      pieData && option && myChart.setOption(option);
+
+      window.onresize = function () {
+        myChart.resize();
+      };
+    },
+    pieDataHandle(param) {
+      this.pieData = [];
+
+      // param.groupData.map((item,index) => {
+      //
+      //   this.lineData.push({
+      //     type: 'line',
+      //     name: item.name,
+      //     data: item.value,
+      //   });
+      //
+      // });
+      //
+      // this.myLineEcharts(param.category,this.lineData);
     },
-  }
-  </script>
-  
-  <style scoped>
-  .pie-chart-content {
-    width: 100%;
-    height: 100%;
-  }
-  </style>
-  
+  },
+};
+</script>
+
+<style scoped>
+.pie-chart-content {
+  width: 100%;
+  height: 100%;
+}
+</style>

+ 1 - 1
src/components/PlanUserStatus.vue

@@ -79,7 +79,7 @@
                         src="../assets/img/home/isNo.png"
                         alt=""
                       />&nbsp;&nbsp;
-                      <div style="color: #d52121">未开始</div>
+                      <div style="color: #d52121">未完成</div>
                     </div>
                   </template>
                 </el-table-column>

+ 1 - 1
src/components/Report.vue

@@ -87,7 +87,7 @@
                         src="../assets/img/home/isNo.png"
                         alt=""
                       />&nbsp;&nbsp;
-                      <div style="color: #d52121">未开始</div>
+                      <div style="color: #d52121">未完成</div>
                     </div>
                   </template>
                 </el-table-column>

+ 4 - 4
src/views/manage/manageMain.vue

@@ -313,7 +313,7 @@ export default {
         {
           id: "4",
           name: "报告分析",
-          icon: require("../../assets/menu/plan.png"),
+          icon: require("../../assets/menu/asy.png"),
           showItem: true,
           path: "/manage/recordListAll",
           child: [
@@ -413,7 +413,7 @@ export default {
           {
             id: "4",
             name: "报告分析",
-            icon: require("../../assets/menu/plan.png"),
+            icon: require("../../assets/menu/asy.png"),
             showItem: true,
             path: "/manage/recordListAll",
             child: [
@@ -503,7 +503,7 @@ export default {
           {
             id: "4",
             name: "报告分析",
-            icon: require("../../assets/menu/plan.png"),
+            icon: require("../../assets/menu/asy.png"),
             showItem: true,
             path: "/manage/recordListAll",
             child: [
@@ -581,7 +581,7 @@ export default {
           {
             id: "4",
             name: "报告分析",
-            icon: require("../../assets/menu/plan.png"),
+            icon: require("../../assets/menu/asy.png"),
             showItem: true,
             path: "/manage/recordListAll",
             child: [