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 = {}
|
const categoryApi = {}
|
||||||
|
|
||||||
categoryApi.listAll = () => {
|
categoryApi.listAll = (more = false) => {
|
||||||
return service({
|
return service({
|
||||||
url: `${baseUrl}`,
|
url: `${baseUrl}`,
|
||||||
|
params: {
|
||||||
|
more: more
|
||||||
|
},
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,45 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="page-header-index-wide">
|
<div class="page-header-index-wide">
|
||||||
<a-row :gutter="12">
|
<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-card>
|
||||||
<a-form layout="vertical">
|
<a-form layout="vertical">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<codemirror v-model="content" :options="options"></codemirror>
|
<codemirror
|
||||||
|
v-model="content"
|
||||||
|
:options="options"
|
||||||
|
></codemirror>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<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-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</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 主题">
|
<a-card title="Anatole 主题">
|
||||||
<theme-file :files="files" @listenToSelect="catchSelectFile"/>
|
<theme-file
|
||||||
|
:files="files"
|
||||||
|
@listenToSelect="catchSelectFile"
|
||||||
|
/>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
|
@ -122,7 +122,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '文章数',
|
title: '文章数',
|
||||||
dataIndex: 'posts.count'
|
dataIndex: 'postCount'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
@ -145,7 +145,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadCategories() {
|
loadCategories() {
|
||||||
categoryApi.listAll().then(response => {
|
categoryApi.listAll(true).then(response => {
|
||||||
this.categories = response.data.data
|
this.categories = response.data.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue