Fixed style error.

pull/9/head
ruibaby 2019-05-03 17:49:11 +08:00
parent f179a4242f
commit 0834a61771
4 changed files with 127 additions and 75 deletions

View File

@ -1,5 +1,67 @@
<template>
<page-view>
<a-row :gutter="24">
<a-col
:xl="6"
:lg="6"
:md="12"
:sm="12"
:xs="12"
:style="{ marginBottom: '24px' }"
>
<analysis-card
:loading="countsLoading"
title="文章"
:number="countsData.postCount"
>
</analysis-card>
</a-col>
<a-col
:xl="6"
:lg="6"
:md="12"
:sm="12"
:xs="12"
:style="{ marginBottom: '24px' }"
>
<analysis-card
:loading="countsLoading"
title="评论"
:number="countsData.commentCount"
>
</analysis-card>
</a-col>
<a-col
:xl="6"
:lg="6"
:md="12"
:sm="12"
:xs="12"
:style="{ marginBottom: '24px' }"
>
<analysis-card
:loading="countsLoading"
title="附件"
:number="countsData.attachmentCount"
>
</analysis-card>
</a-col>
<a-col
:xl="6"
:lg="6"
:md="12"
:sm="12"
:xs="12"
:style="{ marginBottom: '24px' }"
>
<analysis-card
:loading="countsLoading"
title="成立天数"
:number="countsData.establishDays"
>
</analysis-card>
</a-col>
</a-row>
<a-row :gutter="12">
<a-col
:xl="8"
@ -28,46 +90,7 @@
:bordered="false"
title="最新评论"
>
<a-comment>
<span slot="actions">Reply to</span>
<a slot="author">Han Solo</a>
<a-avatar
slot="avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
alt="Han Solo"
/>
<p slot="content">We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).</p>
<a-comment>
<span slot="actions">Reply to</span>
<a slot="author">Han Solo</a>
<a-avatar
slot="avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
alt="Han Solo"
/>
<p slot="content">We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).</p>
<a-comment>
<span slot="actions">Reply to</span>
<a slot="author">Han Solo</a>
<a-avatar
slot="avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
alt="Han Solo"
/>
<p slot="content">We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).</p>
</a-comment>
<a-comment>
<span slot="actions">Reply to</span>
<a slot="author">Han Solo</a>
<a-avatar
slot="avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
alt="Han Solo"
/>
<p slot="content">We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).</p>
</a-comment>
</a-comment>
</a-comment>
最新评论
</a-card>
</a-col>
<a-col
@ -91,6 +114,7 @@
<script>
import { PageView } from '@/layouts'
import AnalysisCard from './components/AnalysisCard'
import postApi from '@/api/post'
import commentApi from '@/api/comment'
@ -141,7 +165,8 @@ const commentColumns = [
export default {
name: 'Dashboard',
components: {
PageView
PageView,
AnalysisCard
},
data() {
return {

View File

@ -0,0 +1,53 @@
<template>
<a-card
:loading="loading"
:body-style="{ padding: '8px 24px 8px' }"
:bordered="false"
>
<div class="card-main">
<div class="number">
<slot name="number">
<span>{{ number }}</span>
</slot>
</div>
<div class="title">
<slot name="title">
<span>{{ title }}</span>
</slot>
</div>
</div>
</a-card>
</template>
<script>
export default {
name: 'AnalysisCard',
props: {
title: {
type: String,
default: ''
},
number: {
type: [Function, Number, String],
required: false,
default: null
},
loading: {
type: Boolean,
default: false
}
}
}
</script>
<style lang="less" scoped>
.card-main {
.number {
color: #000;
margin-bottom: 0;
font-size: 38px;
line-height: 38px;
height: 38px;
}
}
</style>

View File

@ -8,41 +8,22 @@
:lg="8"
>
<a-card
title="Markdown 导入"
title="Markdown 文章导入"
:bordered="false"
>
<span style="font-size:18px">Markdown 文档导入</span>
<p>支持 Hexo/Jekyll 导入并解析元数据</p>
<a-button
type="primary"
style="float:right"
@click="importMarkDown"
>导入</a-button>
<p>支持 Hexo/Jekyll 导入并解析元数据</p>
</a-card>
</a-col>
<a-col
:sm="24"
:md="12"
:lg="8"
>
<a-card
title="WordPress 导入"
:bordered="false"
>
<span style="font-size:18px">WordPress 数据导入</span>
<a-button
type="primary"
style="float:right"
@click="importWordPress"
>导入</a-button>
<p>尽请期待</p>
</a-card>
</a-col>
</a-row>
<a-modal
title="Markdown 文导入"
v-model="ishow"
@ok="sure"
title="Markdown 文章导入"
v-model="markdownUpload"
:footer="null"
>
<a-upload-dragger
name="file"
@ -64,15 +45,12 @@
export default {
data() {
return {
ishow: false
markdownUpload: false
}
},
methods: {
importMarkDown() {
this.ishow = true
},
sure() {
this.ishow = false
this.markdownUpload = true
},
handleChange(info) {
const status = info.file.status
@ -84,9 +62,6 @@ export default {
} else if (status === 'error') {
this.$message.error(`${info.file.name} file upload failed.`)
}
},
importWordPress() {
this.$message.info('程序猿正在努力开发呢!')
}
}
}

View File

@ -7,7 +7,6 @@
:style="{ 'padding-bottom': '12px' }"
>
<a-card
:bodyStyle="{ padding: '16' }"
:bordered="false"
>
<div class="profile-center-avatarHolder">