From 1bb41a4cf9943f0ec10e4d757addc04b7d5b365a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 29 十一月 2022 22:40:14 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/tabviews/home/index.jsx              |   28 ++++++-
 src/tabviews/home/defaulthome/index.jsx  |   21 +++--
 src/tabviews/home/defaulthome/index.scss |  157 ++++++++++++++++++++++----------------
 3 files changed, 127 insertions(+), 79 deletions(-)

diff --git a/src/tabviews/home/defaulthome/index.jsx b/src/tabviews/home/defaulthome/index.jsx
index 9358fd9..67ec6dd 100644
--- a/src/tabviews/home/defaulthome/index.jsx
+++ b/src/tabviews/home/defaulthome/index.jsx
@@ -1,10 +1,8 @@
 import React, {Component} from 'react'
 import { Chart } from '@antv/g2'
-import { Tabs, Progress } from 'antd'
+import { Progress } from 'antd'
 import { InfoCircleOutlined, CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons'
 import './index.scss'
-
-const { TabPane } = Tabs
 
 class DefaultHome extends Component {
   componentDidMount () {
@@ -17,6 +15,8 @@
       { year: '2018 骞�', sales: 38 },
       { year: '2019 骞�', sales: 61 },
       { year: '2020 骞�', sales: 45 },
+      { year: '2021 骞�', sales: 55 },
+      { year: '2022 骞�', sales: 49 },
     ]
     const chart = new Chart({
       container: 'home_page_id',
@@ -222,12 +222,15 @@
             </div>
           </div>
         </div>
-        <Tabs defaultActiveKey="1">
-          <TabPane tab="缁翠慨鎬绘暟" key="1">
-            <div className="sale-trend ant-col ant-col-xs-16">
+        <div className="home-board">
+          <div className="mk-home-title">
+            <span>缁翠慨鎬绘暟</span>
+          </div>
+          <div className="mk-home-body">
+            <div className="sale-trend ant-col-left">
               <div id="home_page_id"></div>
             </div>
-            <div className="ant-col ant-col-xs-8">
+            <div className="ant-col-right">
               <div className="antd-sales-rank">
                 <h4 className="antd-ranking-title">浜у搧鎺掑悕</h4>
                 <ul className="antd-ranking-list">
@@ -274,8 +277,8 @@
                 </ul>
               </div>
             </div>
-          </TabPane>
-        </Tabs>
+          </div>
+        </div>
       </div>
     )
   }
diff --git a/src/tabviews/home/defaulthome/index.scss b/src/tabviews/home/defaulthome/index.scss
index 93c83b7..9dbe6e6 100644
--- a/src/tabviews/home/defaulthome/index.scss
+++ b/src/tabviews/home/defaulthome/index.scss
@@ -53,6 +53,9 @@
                     right: 0;
                     line-height: 1;
                     cursor: default;
+                    .anticon {
+                      color: orange;
+                    }
                   }
                 }
                 .antd-total {
@@ -124,73 +127,95 @@
       }
     }
   }
-  .ant-tabs {
-    box-sizing: border-box;
-    margin: 0;
-    padding: 0;
-    color: rgba(0, 0, 0, 0.65);
-    font-size: 14px;
-    font-variant: tabular-nums;
-    line-height: 1.5;
-    list-style: none;
-    font-feature-settings: "tnum";
-    position: relative;
-    background: #fff;
-    border-radius: 2px;
-    transition: all .3s;
-    .sale-trend {
-      min-height: 400px;
-      padding: 10px 20px;
-      margin-bottom: 20px;
-    }
-    .antd-sales-rank {
-      padding: 35px 32px 32px 72px;
-      .antd-ranking-title {
-        font-size: 16px;
+
+  .home-board {
+    background: #ffffff;
+    .mk-home-title {
+      border-bottom: 1px solid #e8e8e8;
+      margin: 0 0 16px 0;
+      span {
+        position: relative;
+        display: inline-block;
+        padding: 12px 16px;
+        color: #1890ff;
       }
-      .antd-ranking-list {
-        margin: 20px 0 0;
-        padding: 0;
-        list-style: none;
-        li {
-          display: flex;
-          align-items: center;
-          margin-top: 16px;
-          zoom: 1;
-          .antd-ranking-active {
-            display: inline-block;
-            width: 20px;
-            height: 20px;
-            margin-top: 1.5px;
-            margin-right: 16px;
-            font-weight: 600;
-            font-size: 12px;
-            line-height: 20px;
-            text-align: center;
-            color: #fff;
-            background-color: #314659;
-            border-radius: 20px;
-          }
-          .antd-ranking-number {
-            display: inline-block;
-            width: 20px;
-            height: 20px;
-            margin-top: 1.5px;
-            margin-right: 16px;
-            font-weight: 600;
-            font-size: 14px;
-            line-height: 20px;
-            text-align: center;
-          }
-          .antd-ranking-title {
-            flex: 1 1;
-            margin-right: 8px;
-            overflow: hidden;
-            white-space: nowrap;
-            text-overflow: ellipsis;
-            color: rgba(0,0,0,.65);
-            font-size: 14px;
-            line-height: 22px;
+      span::after {
+        position: absolute;
+        content: ' ';
+        display: block;
+        width: 100%;
+        height: 2px;
+        background: #1890ff;
+        left: 0;
+        bottom: -1px;
+      }
+    }
+
+    .mk-home-body {
+      .ant-col-left {
+        display: inline-block;
+        width: 66%;
+        vertical-align: top;
+      }
+      .ant-col-right {
+        display: inline-block;
+        width: 34%;
+        vertical-align: top;
+      }
+      .sale-trend {
+        min-height: 400px;
+        padding: 10px 20px;
+        margin-bottom: 20px;
+      }
+      .antd-sales-rank {
+        padding: 35px 32px 32px 72px;
+        .antd-ranking-title {
+          font-size: 16px;
+        }
+        .antd-ranking-list {
+          margin: 20px 0 0;
+          padding: 0;
+          list-style: none;
+          li {
+            display: flex;
+            align-items: center;
+            margin-top: 16px;
+            zoom: 1;
+            .antd-ranking-active {
+              display: inline-block;
+              width: 20px;
+              height: 20px;
+              margin-top: 1.5px;
+              margin-right: 16px;
+              font-weight: 600;
+              font-size: 12px;
+              line-height: 20px;
+              text-align: center;
+              color: #fff;
+              background-color: #314659;
+              border-radius: 20px;
+            }
+            .antd-ranking-number {
+              display: inline-block;
+              width: 20px;
+              height: 20px;
+              margin-top: 1.5px;
+              margin-right: 16px;
+              font-weight: 600;
+              font-size: 14px;
+              line-height: 20px;
+              text-align: center;
+            }
+            .antd-ranking-title {
+              flex: 1 1;
+              margin-right: 8px;
+              overflow: hidden;
+              white-space: nowrap;
+              text-overflow: ellipsis;
+              color: rgba(0,0,0,.65);
+              font-size: 14px;
+              line-height: 22px;
+            }
           }
         }
       }
diff --git a/src/tabviews/home/index.jsx b/src/tabviews/home/index.jsx
index f79eb7e..23338d0 100644
--- a/src/tabviews/home/index.jsx
+++ b/src/tabviews/home/index.jsx
@@ -72,10 +72,28 @@
     Api.getCacheConfig(_param).then(result => {
       if (result.status) {
         if (result.LongParam) {
-          this.setState({
-            loading: false,
-            view: 'custom'
-          })
+          let config = ''
+
+          try { // 閰嶇疆淇℃伅瑙f瀽
+            config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
+          } catch (e) {
+            console.warn('Parse Failure')
+            config = ''
+          }
+
+          if (!config || !config.enabled) {
+            this.setState({
+              loading: false,
+              waitMenu: false,
+              waitAction: false,
+              view: 'default'
+            })
+          } else {
+            this.setState({
+              loading: false,
+              view: 'custom'
+            })
+          }
         } else {
           this.setState({
             loading: false,
@@ -87,6 +105,8 @@
       } else {
         this.setState({
           loading: false,
+          waitMenu: false,
+          waitAction: false,
           view: 'default'
         })
         notification.warning({

--
Gitblit v1.8.0