Browse Source

Merge branch 'develop' of http://120.55.44.4:10080/xujunjie/gt_client_pad into develop

ZhaoJun 1 year ago
parent
commit
b10b7b1465
2 changed files with 24 additions and 20 deletions
  1. 1 0
      src/pages/Home/index.less
  2. 23 20
      src/pages/SmartReport/index.js

+ 1 - 0
src/pages/Home/index.less

@@ -70,6 +70,7 @@
     color: #3b3b3b;
     line-height: 0.5rem;
     text-align: center;
+    letter-spacing: 0.04rem;
     font-family: PangMenZhengDao-3, PangMenZhengDao-3;
   }
 }

+ 23 - 20
src/pages/SmartReport/index.js

@@ -147,12 +147,7 @@ const SmartReport = () => {
   }, []);
 
   const initData = () => {
-    const legend = {
-      orient: 'vertical',
-      left: 'left',
-      top: 'center',
-    };
-    const eqOption = getPieOption(data.eqData, legend);
+    const eqOption = getPieOption(data.eqData, true);
     if (eqChartRef.current) eqChartRef.current.setOption(eqOption);
 
     const taskOption = getPieOption(data.taskData);
@@ -161,7 +156,7 @@ const SmartReport = () => {
     const workOption = getPieOption(data.workOrderData);
     if (workChartRef.current) workChartRef.current.setOption(workOption);
 
-    const workScoreOption = getPieOption(data.workScoreData, legend);
+    const workScoreOption = getPieOption(data.workScoreData, true);
     if (workScoreChartRef.current)
       workScoreChartRef.current.setOption(workScoreOption);
   };
@@ -386,7 +381,7 @@ const SmartReport = () => {
                 <div
                   ref={eqDomRef}
                   style={{
-                    height: '4rem',
+                    height: '8rem',
                     width: 'calc(100% - 1.2rem)',
                     margin: '0 0 0 0.8rem',
                   }}
@@ -413,7 +408,7 @@ const SmartReport = () => {
                 <div
                   ref={workScoreDomRef}
                   style={{
-                    height: '4rem',
+                    height: '8rem',
                     width: 'calc(100% - 1.2rem)',
                     margin: '0 0 0 0.8rem',
                   }}
@@ -507,7 +502,7 @@ const SmartReport = () => {
   );
 };
 export default SmartReport;
-const getPieOption = (chartData, legend = {}) => {
+const getPieOption = (chartData, isLeft = false) => {
   const option = {
     color: [
       '#5470c6',
@@ -523,19 +518,27 @@ const getPieOption = (chartData, legend = {}) => {
     tooltip: {
       trigger: 'item',
     },
-    legend: {
-      orient: 'horizontal',
-      // left: 'left',
-      textStyle: {
-        color: '#000000',
-        fontSize: 18,
-      },
-      ...legend,
-    },
+    legend: isLeft
+      ? {
+          orient: 'vertical',
+          left: 'left',
+          top: 'center',
+        }
+      : {
+          orient: 'horizontal',
+          // left: 'left',
+          itemWidth: 10,
+          itemHeight: 8,
+          textStyle: {
+            color: '#000000',
+            fontSize: 12,
+          },
+        },
     series: [
       {
         type: 'pie',
-        radius: '60%',
+        top: isLeft ? 0 : '10%',
+        radius: isLeft ? '60%' : '50%',
         data: chartData,
         emphasis: {
           itemStyle: {