Просмотр исходного кода

fix(首页): 修复首页样式

xieyonghong 3 лет назад
Родитель
Сommit
fd8f8f3727

+ 1 - 1
src/components/DashBoard/topCard.tsx

@@ -17,7 +17,7 @@ interface FooterItem {
 
 interface CardItemProps {
   span: number;
-  title: string;
+  title: string | React.ReactNode;
   value: any;
   footer: false | FooterItem[];
   showValue?: boolean;

+ 0 - 1
src/pages/home/components/Pie.tsx

@@ -17,7 +17,6 @@ const Pie = (props: Props) => {
           type: 'pie',
           radius: ['100%', '50%'],
           center: ['50%', '50%'],
-          width: 80,
           label: {
             show: false,
           },

+ 6 - 6
src/pages/home/components/Statistics.tsx

@@ -25,13 +25,13 @@ const Statistics = (props: StatisticsProps) => {
           <div className={'home-guide-item'} key={item.name}>
             <div className={'item-english'}>{item.name}</div>
             <div className={'item-title'}>{item.value}</div>
-            <div className={`item-index`}>
-              {typeof item.children === 'string' ? (
+            {typeof item.children === 'string' ? (
+              <div className={`item-index`}>
                 <img src={item.children || defaultImage} />
-              ) : (
-                item.children
-              )}
-            </div>
+              </div>
+            ) : (
+              <div className={'item-index-echarts'}>{item.children}</div>
+            )}
           </div>
         ))}
       </div>

+ 15 - 1
src/pages/home/components/index.less

@@ -43,6 +43,14 @@
     right: 10%;
     bottom: 0;
   }
+
+  .item-index-echarts {
+    .item-index;
+
+    right: 12px;
+    bottom: 5%;
+    width: 50%;
+  }
 }
 
 .home-title {
@@ -78,8 +86,8 @@
 .home-body {
   .home-base;
 
-  height: 500px;
   margin-bottom: @margin;
+  padding-bottom: 26.5%;
   overflow: hidden;
 
   .home-body-img {
@@ -87,7 +95,13 @@
     top: 0;
     left: 0;
     z-index: 1;
+    width: 100%;
     height: 100%;
+
+    > img {
+      width: 100%;
+      height: 100%;
+    }
   }
 }