From 417215cfccd6553889517bfbe51a6b68a65904ee Mon Sep 17 00:00:00 2001 From: Baorong Li Date: Sun, 9 Sep 2018 08:53:06 +0800 Subject: [PATCH] remove useless mock --- mock/dashboard.js | 4 +-- mock/menu.js | 34 ------------------------ src/pages/dashboard/components/cpu.js | 4 +-- src/pages/dashboard/components/user.js | 8 ++---- src/pages/dashboard/components/user.less | 5 ++-- 5 files changed, 7 insertions(+), 48 deletions(-) diff --git a/mock/dashboard.js b/mock/dashboard.js index 9f31a4a..c4626e6 100644 --- a/mock/dashboard.js +++ b/mock/dashboard.js @@ -57,11 +57,9 @@ const Dashboard = Mock.mock({ }, ], user: { - name: 'zuiidea', - email: 'zuiiidea@.gmail.com', + name: 'github', sales: 3241, sold: 3556, - avatar: 'http://tva4.sinaimg.cn/crop.0.0.996.996.180/6ee6a3a3jw8f0ks5pk7btj20ro0rodi0.jpg', }, 'completed|12': [ { diff --git a/mock/menu.js b/mock/menu.js index 3f8fe1a..d22ffd2 100644 --- a/mock/menu.js +++ b/mock/menu.js @@ -88,40 +88,6 @@ let database = [ icon: 'area-chart', route: '/chart/Recharts', }, - { - id: '6', - bpid: '1', - name: 'Test Navigation', - icon: 'setting', - }, - { - id: '61', - bpid: '6', - mpid: '6', - name: 'Test Navigation1', - route: '/navigation/navigation1', - }, - { - id: '62', - bpid: '6', - mpid: '6', - name: 'Test Navigation2', - route: '/navigation/navigation2', - }, - { - id: '621', - bpid: '62', - mpid: '62', - name: 'Test Navigation21', - route: '/navigation/navigation2/navigation1', - }, - { - id: '622', - bpid: '62', - mpid: '62', - name: 'Test Navigation22', - route: '/navigation/navigation2/navigation2', - }, ] module.exports = { diff --git a/src/pages/dashboard/components/cpu.js b/src/pages/dashboard/components/cpu.js index 30eb8d4..08a4ccb 100644 --- a/src/pages/dashboard/components/cpu.js +++ b/src/pages/dashboard/components/cpu.js @@ -20,14 +20,14 @@ const countUpProps = { separator: ',', } -function Cpu ({ usage, space, cpu, data }) { +function Cpu ({ usage=0, space=0, cpu=0, data }) { return (

usage

- +

diff --git a/src/pages/dashboard/components/user.js b/src/pages/dashboard/components/user.js index f1da43a..4653788 100644 --- a/src/pages/dashboard/components/user.js +++ b/src/pages/dashboard/components/user.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { Button } from 'antd' +import { Button, Icon } from 'antd' import CountUp from 'react-countup' import { color } from 'utils' import styles from './user.less' @@ -18,12 +18,8 @@ function User ({ avatar, name, email, sales, sold }) {
-
+
{name}
-

{email}

diff --git a/src/pages/dashboard/components/user.less b/src/pages/dashboard/components/user.less index 51fd72a..a693d72 100644 --- a/src/pages/dashboard/components/user.less +++ b/src/pages/dashboard/components/user.less @@ -16,7 +16,7 @@ &::after { content: ''; - background: #caa2d6; + background: #c5bec7; position: absolute; width: 100%; height: 200px; @@ -27,8 +27,7 @@ } .avatar { - width: 64px; - height: 64px; + font-size: 48px; background-position: center; background-size: cover; border-radius: 50%;