فهرست منبع

fix:进度查询条形图调整,设备管理看板无数据调整

zhangjingyuan 2 سال پیش
والد
کامیت
0d12f5583a

+ 16 - 2
src/views/system/jbdHome/board/component/getPieView.vue

@@ -1,9 +1,13 @@
 <template>
   <div class="pieView">
-    <div style="height: 14%;line-height: 30px;text-align: left;padding-left: 10px;color: white;">{{info.config.title||""}}</div>   
-    <div style="width:100%;height:86%;display: inline-block; overflow: hidden;">
+    <div style="height: 14%;line-height: 30px;text-align: left;padding-left: 10px;color: white;" >{{info.config.title||""}}</div>   
+    <div style="width:100%;height:86%;display: inline-block; overflow: hidden;" v-show="showChart">
       <div :id="info.config.idSelector" style="width:100%;height:95%;overflow: hidden;"> </div>
     </div>
+    <div style="background: #061237; width: 100%;height: 70%;display: flex;justify-content: cne;justify-content: center;align-items: center;" 
+    v-if="!showChart">
+      <div style="color:#c7c7c7;">目前无数据</div>
+    </div>
   </div>
 </template>
 
@@ -12,6 +16,7 @@ import * as echarts from "echarts";
 export default {
   data(){
     return{
+      showChart:true,
     }
   },
   props:{
@@ -36,6 +41,15 @@ export default {
   },
   methods:{
     getMiddleLeft(){ 
+      let inData = this.info.data;
+      console.log(inData)
+      let num = 0;
+      for(let i in inData){
+        num += Number(inData[i].value);
+      }
+      if(num == 0){
+        this.showChart = false;
+      }
       let chartDom = document.getElementById(this.info.config.idSelector);
       const radius = window.innerWidth > 1600 ? '55%' : '45%';
       var myChart = echarts.init(chartDom);

+ 3 - 6
src/views/system/jbdHome/board/equipmentBoard.vue

@@ -397,15 +397,12 @@ export default {
           this_.weiHuSheBeiData.config.idSelector = "mainWeiHu";
           //设备数核查
           let objHeCha = {};
-          let zero = 0;
-          if(data[0].checkNoEquipments== 0 &&data[0].checkEquipments== 0 ){
-            zero = 1;
-          }
+
           objHeCha.name = "本月计划核查数";
-          objHeCha.value = zero==1? zero: data[0].checkNoEquipments;
+          objHeCha.value = data[0].checkNoEquipments;
           this_.sheBeiHeChaData.data.push(objHeCha);
           objHeCha = {};
-          objHeCha.value =zero==1? zero:data[0].checkEquipments;
+          objHeCha.value =data[0].checkEquipments;
           objHeCha.name = "本月已核查数";
           this_.sheBeiHeChaData.data.push(objHeCha);
           this_.sheBeiHeChaData.color = ["#5470c6", "#38a838"];

+ 21 - 11
src/views/system/jbdScan/goods/neishenzhuangtai.vue

@@ -418,10 +418,15 @@ export default {
     getLoadEchartsTwo() {
       var chartDom = document.getElementById("in-echarts");
       const setEchartWH = {
-        //设置控制图表大小变量
-        width: 400,
-        height: 300,
-      };
+        // 设置控制图表大小变量
+        width: 500,
+        height: this.source.length < 7 ? 350 : (this.source.length - 1) * 30 + 100
+      }
+      // const setEchartWH = {
+      //   //设置控制图表大小变量
+      //   width: 400,
+      //   height: 300,
+      // };
 
       var myChart = echarts.init(chartDom, null, setEchartWH);
       var option;
@@ -464,7 +469,7 @@ export default {
               // Map the "product" column to Y axis
               y: "product",
             },
-            barWidth: 30,
+            barWidth: 15,
           },
         ],
       };
@@ -474,12 +479,16 @@ export default {
     //cma指定数据到坐标轴的映射
     getLoadCmaEchartsX() {
       var chartDom = document.getElementById("in-CMAecharts");
+      // const setEchartWH = {
+      //   //设置控制图表大小变量
+      //   width: 400,
+      //   height: 300,
+      // };
       const setEchartWH = {
-        //设置控制图表大小变量
-        width: 400,
-        height: 300,
-      };
-
+      // 设置控制图表大小变量
+          width: 500,
+           height: this.source.length < 7 ? 350 : (this.source.length - 1) * 30 + 100
+      }
       var myChart = echarts.init(chartDom, null, setEchartWH);
       var option;
 
@@ -520,7 +529,7 @@ export default {
               // Map the "product" column to Y axis
               y: "product",
             },
-            barWidth: 30,
+            barWidth: 15,
           },
         ],
       };
@@ -949,6 +958,7 @@ export default {
     .department {
       width: 400px;
       height: 300px;
+      margin-left: 60px;
     }
     #department {
       width: 400px;