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> <template>
<page-view> <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-row :gutter="12">
<a-col <a-col
:xl="8" :xl="8"
@ -28,46 +90,7 @@
:bordered="false" :bordered="false"
title="最新评论" 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-card>
</a-col> </a-col>
<a-col <a-col
@ -91,6 +114,7 @@
<script> <script>
import { PageView } from '@/layouts' import { PageView } from '@/layouts'
import AnalysisCard from './components/AnalysisCard'
import postApi from '@/api/post' import postApi from '@/api/post'
import commentApi from '@/api/comment' import commentApi from '@/api/comment'
@ -141,7 +165,8 @@ const commentColumns = [
export default { export default {
name: 'Dashboard', name: 'Dashboard',
components: { components: {
PageView PageView,
AnalysisCard
}, },
data() { data() {
return { 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" :lg="8"
> >
<a-card <a-card
title="Markdown 导入" title="Markdown 文章导入"
:bordered="false" :bordered="false"
> >
<span style="font-size:18px">Markdown 文档导入</span> <p>支持 Hexo/Jekyll 导入并解析元数据</p>
<a-button <a-button
type="primary" type="primary"
style="float:right" style="float:right"
@click="importMarkDown" @click="importMarkDown"
>导入</a-button> >导入</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-card>
</a-col> </a-col>
</a-row> </a-row>
<a-modal <a-modal
title="Markdown 文导入" title="Markdown 文章导入"
v-model="ishow" v-model="markdownUpload"
@ok="sure" :footer="null"
> >
<a-upload-dragger <a-upload-dragger
name="file" name="file"
@ -53,7 +34,7 @@
<p class="ant-upload-drag-icon"> <p class="ant-upload-drag-icon">
<a-icon type="inbox" /> <a-icon type="inbox" />
</p> </p>
<p class="ant-upload-text">拖拽或点击选择MarkDown文件到此处</p> <p class="ant-upload-text">拖拽或点击选择 MarkDown 文件到此处</p>
</a-upload-dragger> </a-upload-dragger>
</a-modal> </a-modal>
</div> </div>
@ -64,15 +45,12 @@
export default { export default {
data() { data() {
return { return {
ishow: false markdownUpload: false
} }
}, },
methods: { methods: {
importMarkDown() { importMarkDown() {
this.ishow = true this.markdownUpload = true
},
sure() {
this.ishow = false
}, },
handleChange(info) { handleChange(info) {
const status = info.file.status const status = info.file.status
@ -84,9 +62,6 @@ export default {
} else if (status === 'error') { } else if (status === 'error') {
this.$message.error(`${info.file.name} file upload failed.`) this.$message.error(`${info.file.name} file upload failed.`)
} }
},
importWordPress() {
this.$message.info('程序猿正在努力开发呢!')
} }
} }
} }

View File

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