Browse Source

fix: revert react antd style

Sendya 6 years ago
parent
commit
d2d3f3bd79

+ 32 - 27
src/components/Charts/Bar.vue

@@ -14,43 +14,48 @@
 </template>
 
 <script>
-const data = []
-for (let i = 0; i < 12; i += 1) {
-  data.push({
-    x: `${i + 1}月`,
-    y: Math.floor(Math.random() * 1000) + 200
-  })
-}
-const tooltip = [
-  'x*y',
-  (x, y) => ({
-    name: x,
-    value: y
-  })
-]
-const scale = [{
-  dataKey: 'x',
-  min: 2
-}, {
-  dataKey: 'y',
-  title: '时间',
-  min: 1,
-  max: 22
-}]
-
 export default {
   name: 'Bar',
   props: {
     title: {
       type: String,
       default: ''
+    },
+    data: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    scale: {
+      type: Array,
+      default: () => {
+        return [{
+          dataKey: 'x',
+          min: 2
+        }, {
+          dataKey: 'y',
+          title: '时间',
+          min: 1,
+          max: 22
+        }]
+      }
+    },
+    tooltip: {
+      type: Array,
+      default: () => {
+        return [
+          'x*y',
+          (x, y) => ({
+            name: x,
+            value: y
+          })
+        ]
+      }
     }
   },
   data () {
     return {
-      data,
-      scale,
-      tooltip
     }
   }
 }

+ 0 - 2
src/components/SettingDrawer/SettingDrawer.vue

@@ -6,8 +6,6 @@
       @close="onClose"
       :closable="false"
       :visible="visible"
-      :getContainer="() => $refs.settingDrawer"
-      :style="{}"
     >
       <div class="setting-drawer-index-content">
 

+ 0 - 6
src/components/global.less

@@ -1,12 +1,6 @@
 @import './index.less';
 
-html {
-  overflow: auto;
-}
-
 body {
-  // 打开滚动条固定显示
-  overflow-y: scroll;
 
   &.colorWeak {
     filter: invert(80%);

+ 0 - 1
src/config/router.config.js

@@ -17,7 +17,6 @@ export const asyncRouterMap = [
         name: 'dashboard',
         redirect: '/dashboard/workplace',
         component: RouteView,
-        hideChildrenInMenu: true,
         meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse, permission: [ 'dashboard' ] },
         children: [
           {

+ 18 - 2
src/views/dashboard/Analysis.vue

@@ -78,7 +78,7 @@
           <a-tab-pane loading="true" tab="销售额" key="1">
             <a-row>
               <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">
-                <bar title="销售额排行" />
+                <bar :data="barData" title="销售额排行" />
               </a-col>
               <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
                 <rank-list title="门店销售排行榜" :list="rankList"/>
@@ -88,7 +88,7 @@
           <a-tab-pane tab="访问量" key="2">
             <a-row>
               <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">
-                <bar title="销售额趋势" />
+                <bar :data="barData2" title="销售额趋势" />
               </a-col>
               <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
                 <rank-list title="门店销售排行榜" :list="rankList"/>
@@ -216,6 +216,19 @@ import moment from 'moment'
 import { ChartCard, MiniArea, MiniBar, MiniProgress, RankList, Bar, Trend, NumberInfo, MiniSmoothArea } from '@/components'
 import { mixinDevice } from '@/utils/mixin'
 
+const barData = []
+const barData2 = []
+for (let i = 0; i < 12; i += 1) {
+  barData.push({
+    x: `${i + 1}月`,
+    y: Math.floor(Math.random() * 1000) + 200
+  })
+  barData2.push({
+    x: `${i + 1}月`,
+    y: Math.floor(Math.random() * 1000) + 200
+  })
+}
+
 const rankList = []
 for (let i = 0; i < 7; i++) {
   rankList.push({
@@ -327,6 +340,9 @@ export default {
       searchTableColumns,
       searchData,
 
+      barData,
+      barData2,
+
       //
       pieScale,
       pieData,