pull/9/head
ruibaby 6 years ago
commit c606c8917b

@ -9,10 +9,7 @@
:sm="24" :sm="24"
> >
<a-form-item label="关键词"> <a-form-item label="关键词">
<a-input <a-input v-model="queryParam.keyword" />
v-model="queryParam.id"
placeholder
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col <a-col
@ -25,9 +22,13 @@
placeholder="请选择文章状态" placeholder="请选择文章状态"
defaultValue="0" defaultValue="0"
> >
<a-select-option value="0">已发布</a-select-option> <a-select-option
<a-select-option value="1">草稿箱</a-select-option> v-for="status in Object.keys(postStatus)"
<a-select-option value="2">回收站</a-select-option> :key="status"
:value="status"
>
{{ postStatus[status].text }}
</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -55,7 +56,7 @@
<span class="table-page-search-submitButtons"> <span class="table-page-search-submitButtons">
<a-button <a-button
type="primary" type="primary"
@click="$refs.table.refresh(true)" @click="loadPosts"
>查询</a-button> >查询</a-button>
<a-button <a-button
style="margin-left: 8px;" style="margin-left: 8px;"
@ -76,15 +77,9 @@
</router-link> </router-link>
<a-dropdown> <a-dropdown>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item <a-menu-item key="1">
key="1"
v-if="postStatus==0 || postStatus==1"
>
<a-icon type="delete" />移到回收站 </a-menu-item> <a-icon type="delete" />移到回收站 </a-menu-item>
<a-menu-item <a-menu-item key="2">
key="1"
v-else-if="postStatus==2"
>
<a-icon type="delete" />永久删除 </a-menu-item> <a-icon type="delete" />永久删除 </a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px;"> <a-button style="margin-left: 8px;">
@ -182,7 +177,7 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
mdl: {}, postStatus: postApi.postStatus,
// //
pagination: {}, pagination: {},
queryParam: { queryParam: {
@ -248,16 +243,14 @@ export default {
options: {}, options: {},
optionAlertShow: false, optionAlertShow: false,
categories: [], categories: [],
postStatus: 0,
posts: [], posts: [],
postsLoading: false postsLoading: false
} }
}, },
computed: { computed: {
formattedPosts() { formattedPosts() {
const postStatus = postApi.postStatus
return this.posts.map(post => { return this.posts.map(post => {
post.statusProperty = postStatus[post.status] post.statusProperty = this.postStatus[post.status]
return post return post
}) })
} }

Loading…
Cancel
Save