瀏覽代碼

bug解决

cz 1 年之前
父節點
當前提交
4b24bec874
共有 2 個文件被更改,包括 23 次插入19 次删除
  1. 2 1
      src/components/headerBar/header.scss
  2. 21 18
      src/views/process/processApproval/index.vue

+ 2 - 1
src/components/headerBar/header.scss

@@ -57,7 +57,7 @@
 						height: 50px;
 						line-height: 50px;
 						padding: 0 50px;
-						font-size: 16px;
+						font-size: 15px;
 						cursor: pointer;
 					}
 
@@ -89,6 +89,7 @@
 				height: 500px;
 				overflow-y: auto;
 				padding: 0 20px;
+				// background: #f1f1f1;
 
 				&::-webkit-scrollbar {
 					width: 2px !important;

+ 21 - 18
src/views/process/processApproval/index.vue

@@ -114,7 +114,7 @@
           <div style="overflow: auto; height: calc(100vh - 200px)">
             <div style="padding-bottom:50px"
                  v-if="(userInfo.roles.includes('ceo') || userInfo.roles.includes('salesDirector') ||
-                 userInfo.roles.includes('financeOfficer') || userInfo.roles.includes('approve_ accountant')) && (route.query.processType==10 || route.query.processType==30) &&(chartData && chartData.length>0)">
+                 userInfo.roles.includes('financeOfficer') || userInfo.roles.includes('approve_ accountant')) && (route.query.processType==10 || route.query.processType==30) ">
               <div style="margin-bottom:10px;">
                 <TitleInfo :content="'利润预算波动'"></TitleInfo>
               </div>
@@ -757,23 +757,26 @@ onMounted(async () => {
   }
 
   $bus.on("getGrossData", (data) => {
-    // if (data && data.length > 1) {
-    //   myChart = echarts.init(chartDom.value);
-    //   window.addEventListener("resize", () => {
-    //     myChart.resize();
-    //   });
-    //   chartData.value = data.slice(1, data.length);
-    //   optionTwo.data.xAxis.data = chartData.value.map((item) => {
-    //     return item.createTime.slice(0, 10);
-    //   });
-    //   optionTwo.data.series[0].data = chartData.value.map((item) => {
-    //     return item.gross;
-    //   });
-    //   myChart.setOption(optionTwo.data);
-    //   myChart.resize();
-    // } else {
-    //   return;
-    // }
+    nextTick(() => {
+      if (data && data.length > 1) {
+        myChart = echarts.init(chartDom.value);
+        window.addEventListener("resize", () => {
+          myChart.resize();
+        });
+        chartData.value = data;
+        // chartData.value = data.slice(1, data.length);
+        optionTwo.data.xAxis.data = chartData.value.map((item) => {
+          return item.createTime.slice(0, 10);
+        });
+        optionTwo.data.series[0].data = chartData.value.map((item) => {
+          return item.gross;
+        });
+        myChart.setOption(optionTwo.data);
+        myChart.resize();
+      } else {
+        return;
+      }
+    });
   });
 });