mirror of https://github.com/halo-dev/halo
Add category post count support
parent
5a2aa0b025
commit
9da6b782a6
|
@ -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'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue