Add category post count support

pull/3445/head
johnniang 2019-04-23 18:38:31 +08:00
parent 5a2aa0b025
commit 9da6b782a6
3 changed files with 35 additions and 8 deletions

View File

@ -4,9 +4,12 @@ const baseUrl = '/api/admin/categories'
const categoryApi = {}
categoryApi.listAll = () => {
categoryApi.listAll = (more = false) => {
return service({
url: `${baseUrl}`,
params: {
more: more
},
method: 'get'
})
}

View File

@ -1,21 +1,45 @@
<template>
<div class="page-header-index-wide">
<a-row :gutter="12">
<a-col :xl="18" :lg="18" :md="18" :sm="24" :xs="24" :style="{'padding-bottom':'12px'}">
<a-col
:xl="18"
:lg="18"
:md="18"
:sm="24"
:xs="24"
:style="{'padding-bottom':'12px'}"
>
<a-card>
<a-form layout="vertical">
<a-form-item>
<codemirror v-model="content" :options="options"></codemirror>
<codemirror
v-model="content"
:options="options"
></codemirror>
</a-form-item>
<a-form-item>
<a-button type="primary" @click="handlerSaveContent" :disabled="buttonDisabled">保存</a-button>
<a-button
type="primary"
@click="handlerSaveContent"
:disabled="buttonDisabled"
>保存</a-button>
</a-form-item>
</a-form>
</a-card>
</a-col>
<a-col :xl="6" :lg="6" :md="6" :sm="24" :xs="24" :style="{'padding-bottom':'12px'}">
<a-col
:xl="6"
:lg="6"
:md="6"
:sm="24"
:xs="24"
:style="{'padding-bottom':'12px'}"
>
<a-card title="Anatole 主题">
<theme-file :files="files" @listenToSelect="catchSelectFile"/>
<theme-file
:files="files"
@listenToSelect="catchSelectFile"
/>
</a-card>
</a-col>
</a-row>

View File

@ -122,7 +122,7 @@ const columns = [
},
{
title: '文章数',
dataIndex: 'posts.count'
dataIndex: 'postCount'
},
{
title: '操作',
@ -145,7 +145,7 @@ export default {
},
methods: {
loadCategories() {
categoryApi.listAll().then(response => {
categoryApi.listAll(true).then(response => {
this.categories = response.data.data
})
},