Refactor codes.

pull/9/head
ruibaby 2019-05-04 16:11:46 +08:00
parent a4a7d54e7c
commit 4d5d5a5926
4 changed files with 29 additions and 17 deletions

View File

@ -26,7 +26,10 @@
:sm="24" :sm="24"
> >
<a-form-item label="存储位置"> <a-form-item label="存储位置">
<a-select v-model="queryParam.attachmentType"> <a-select
v-model="queryParam.attachmentType"
@change="handleQuery"
>
<a-select-option <a-select-option
v-for="item in Object.keys(attachmentType)" v-for="item in Object.keys(attachmentType)"
:key="item" :key="item"
@ -40,7 +43,10 @@
:sm="24" :sm="24"
> >
<a-form-item label="文件类型"> <a-form-item label="文件类型">
<a-select v-model="queryParam.mediaType"> <a-select
v-model="queryParam.mediaType"
@change="handleQuery"
>
<a-select-option <a-select-option
v-for="(item,index) in mediaTypes" v-for="(item,index) in mediaTypes"
:key="index" :key="index"

View File

@ -74,13 +74,15 @@
> >
<analysis-card <analysis-card
:loading="countsLoading" :loading="countsLoading"
title="立天数" title="立天数"
:number="countsData.establishDays" :number="countsData.establishDays"
> >
<a-tooltip <a-tooltip
:title="'已成立'+countsData.establishDays+'天了'"
slot="action" slot="action"
> >
<template slot="title">
博客建立于 {{ countsData.birthday | moment }}
</template>
<a href="javascript:void(0);"> <a href="javascript:void(0);">
<a-icon type="info-circle-o" /></a> <a-icon type="info-circle-o" /></a>
</a-tooltip> </a-tooltip>

View File

@ -22,7 +22,7 @@
<a-input v-model="options.blog_url" /> <a-input v-model="options.blog_url" />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="LOGO" label="Logo"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-input v-model="options.blog_logo"> <a-input v-model="options.blog_logo">

View File

@ -6,9 +6,7 @@
:md="24" :md="24"
:style="{ 'padding-bottom': '12px' }" :style="{ 'padding-bottom': '12px' }"
> >
<a-card <a-card :bordered="false">
:bordered="false"
>
<div class="profile-center-avatarHolder"> <div class="profile-center-avatarHolder">
<a-tooltip <a-tooltip
placement="right" placement="right"
@ -30,19 +28,16 @@
</div> </div>
<div class="profile-center-detail"> <div class="profile-center-detail">
<p> <p>
<a-icon type="link" /> <a-icon type="link" /><a
<a :href="options.blog_url"
href="http://localhost:8090"
target="method" target="method"
>http://localhost:8090</a> >{{ options.blog_url }}</a>
</p> </p>
<p> <p>
<a-icon type="mail" /> <a-icon type="mail" />{{ user.email }}
{{ user.email }}
</p> </p>
<p> <p>
<a-icon type="calendar" /> <a-icon type="calendar" />{{ counts.establishDays || 0 }}
{{ counts.establishDays || 0 }}
</p> </p>
</div> </div>
<a-divider /> <a-divider />
@ -152,6 +147,7 @@
import AttachmentSelectDrawer from '../attachment/components/AttachmentSelectDrawer' import AttachmentSelectDrawer from '../attachment/components/AttachmentSelectDrawer'
import userApi from '@/api/user' import userApi from '@/api/user'
import adminApi from '@/api/admin' import adminApi from '@/api/admin'
import optionApi from '@/api/option'
export default { export default {
components: { components: {
@ -168,7 +164,9 @@ export default {
newPassword: null, newPassword: null,
confirmPassword: null confirmPassword: null
}, },
attachment: {} attachment: {},
options: [],
keys: 'blog_url'
} }
}, },
computed: { computed: {
@ -179,6 +177,7 @@ export default {
created() { created() {
this.loadUser() this.loadUser()
this.getCounts() this.getCounts()
this.loadOptions()
}, },
methods: { methods: {
handleShowAttachDrawer() { handleShowAttachDrawer() {
@ -190,6 +189,11 @@ export default {
this.profileLoading = false this.profileLoading = false
}) })
}, },
loadOptions() {
optionApi.listByKeys(this.keys).then(response => {
this.options = response.data.data
})
},
getCounts() { getCounts() {
adminApi.counts().then(response => { adminApi.counts().then(response => {
this.counts = response.data.data this.counts = response.data.data