vue antd admin init
This commit is contained in:
72
src/components/dashboard/ChartCard.vue
Normal file
72
src/components/dashboard/ChartCard.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<a-card :body-style="{padding: '20px 24px 8px'}" :bordered="false">
|
||||
<div class="chart-card-header">
|
||||
<div class="meta">
|
||||
<span class="chart-card-title">{{title}}</span>
|
||||
<span class="chart-card-action">
|
||||
<slot name="action"></slot>
|
||||
</span>
|
||||
</div>
|
||||
<div class="total"><span>¥ 1358.34</span></div>
|
||||
</div>
|
||||
<div class="chart-card-content">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div class="chart-card-footer">
|
||||
<slot name="footer"></slot>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ACard from 'vue-antd-ui/es/card/Card'
|
||||
export default {
|
||||
name: 'ChartCard',
|
||||
components: {ACard},
|
||||
props: ['title']
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card-header{
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
.chart-card-header .meta{
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
color: rgba(0,0,0,.45);
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.chart-card-action{
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
.total {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
word-break: break-all;
|
||||
white-space: nowrap;
|
||||
color: #000;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 0;
|
||||
font-size: 30px;
|
||||
line-height: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
.chart-card-footer{
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding-top: 9px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.chart-card-content{
|
||||
margin-bottom: 12px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
95
src/components/dashboard/Dashboard.vue
Normal file
95
src/components/dashboard/Dashboard.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-row style="margin: -12px">
|
||||
<a-col :sm="24" :md="12" :xl="6" style="padding: 12px 12px 24px;">
|
||||
<chart-card title="总销售额">
|
||||
<a-tooltip title="指标说明" slot="action">
|
||||
<a-icon type="info-circle-o" />
|
||||
</a-tooltip>
|
||||
<div>
|
||||
<div style="display: inline-block; font-size: 14px; line-height: 22px; margin-right: 16px">
|
||||
同周比
|
||||
<span>12%</span>
|
||||
<span style="color: #f5222d; font-size: 12px"><a-icon type="caret-up" /></span>
|
||||
</div>
|
||||
<div style="display: inline-block; font-size: 14px; line-height: 22px;">
|
||||
日环比
|
||||
<span>11%</span>
|
||||
<span style="color: #52c41a; font-size: 12px"><a-icon type="caret-down" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer">日均销售额 <span>¥ 234.56</span></div>
|
||||
</chart-card>
|
||||
</a-col>
|
||||
<a-col :sm="24" :md="12" :xl="6" style="padding: 12px 12px 24px;">
|
||||
<chart-card title="总销售额">
|
||||
<a-tooltip title="指标说明" slot="action">
|
||||
<a-icon type="info-circle-o" />
|
||||
</a-tooltip>
|
||||
<div>
|
||||
<mini-chart />
|
||||
</div>
|
||||
<div slot="footer">日均销售额 <span>¥ 234.56</span></div>
|
||||
</chart-card>
|
||||
</a-col>
|
||||
<a-col :sm="24" :md="12" :xl="6" style="padding: 12px 12px 24px;">
|
||||
<chart-card title="总销售额">
|
||||
<a-tooltip title="指标说明" slot="action">
|
||||
<a-icon type="info-circle-o" />
|
||||
</a-tooltip>
|
||||
<div>
|
||||
<div style="display: inline-block; font-size: 14px; line-height: 22px; margin-right: 16px">
|
||||
同周比
|
||||
<span>12%</span>
|
||||
<span style="color: #f5222d; font-size: 12px"><a-icon type="caret-up" /></span>
|
||||
</div>
|
||||
<div style="display: inline-block; font-size: 14px; line-height: 22px;">
|
||||
日环比
|
||||
<span>11%</span>
|
||||
<span style="color: #52c41a; font-size: 12px"><a-icon type="caret-down" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer">日均销售额 <span>¥ 234.56</span></div>
|
||||
</chart-card>
|
||||
</a-col>
|
||||
<a-col :sm="24" :md="12" :xl="6" style="padding: 12px 12px 24px;">
|
||||
<chart-card title="总销售额">
|
||||
<a-tooltip title="指标说明" slot="action">
|
||||
<a-icon type="info-circle-o" />
|
||||
</a-tooltip>
|
||||
<div>
|
||||
<div style="display: inline-block; font-size: 14px; line-height: 22px; margin-right: 16px">
|
||||
同周比
|
||||
<span>12%</span>
|
||||
<span style="color: #f5222d; font-size: 12px"><a-icon type="caret-up" /></span>
|
||||
</div>
|
||||
<div style="display: inline-block; font-size: 14px; line-height: 22px;">
|
||||
日环比
|
||||
<span>11%</span>
|
||||
<span style="color: #52c41a; font-size: 12px"><a-icon type="caret-down" /></span>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer">日均销售额 <span>¥ 234.56</span></div>
|
||||
</chart-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ACol from 'vue-antd-ui/es/grid/Col'
|
||||
import ARow from 'vue-antd-ui/es/grid/Row'
|
||||
import ACard from 'vue-antd-ui/es/card/Card'
|
||||
import ChartCard from './ChartCard'
|
||||
import ATooltip from 'vue-antd-ui/es/tooltip/Tooltip'
|
||||
import AIcon from 'vue-antd-ui/es/icon/icon'
|
||||
import MiniChart from '../chart/MiniChart'
|
||||
export default {
|
||||
name: 'dashboard',
|
||||
components: {MiniChart, AIcon, ATooltip, ChartCard, ACard, ARow, ACol}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user