Remove createTime for post list.

pull/9/head
ruibaby 2019-04-20 17:21:21 +08:00
parent 47ac79559b
commit 589ffb1704
2 changed files with 58 additions and 208 deletions

View File

@ -1,10 +1,6 @@
<template>
<div class="page-header-index-wide">
<a-row
:gutter="12"
type="flex"
align="middle"
>
<a-row :gutter="12" type="flex" align="middle">
<a-col
class="theme-item"
:xl="6"
@ -15,46 +11,24 @@
v-for="(theme, index) in themes"
:key="index"
>
<a-card
hoverable
:title="theme.name"
>
<img
:alt="theme.name"
:src="theme.screenshots"
slot="cover"
>
<template
class="ant-card-actions"
slot="actions"
>
<a-card hoverable :title="theme.name">
<img :alt="theme.name" :src="theme.screenshots" slot="cover">
<template class="ant-card-actions" slot="actions">
<div v-if="theme.activated">
<a-icon
type="unlock"
theme="twoTone"
/>
<a-icon type="unlock" theme="twoTone"/>已启用
</div>
<div
v-else
@click="handleActivateClick(theme)"
>
<a-icon type="lock" />启用
<div v-else @click="handleActivateClick(theme)">
<a-icon type="lock"/>启用
</div>
<div @click="handleEditClick(theme)">
<a-icon type="setting" />设置
<a-icon type="setting"/>设置
</div>
<a-dropdown placement="topCenter">
<a
class="ant-dropdown-link"
href="#"
>
<a-icon type="ellipsis" />更多
<a class="ant-dropdown-link" href="#">
<a-icon type="ellipsis"/>更多
</a>
<a-menu slot="overlay">
<a-menu-item
:key="1"
:disabled="theme.activated"
>
<a-menu-item :key="1" :disabled="theme.activated">
<a-popconfirm
v-if="!theme.activated"
:title="'确定删除【' + theme.name + '】主题?'"
@ -62,10 +36,10 @@
okText="确定"
cancelText="取消"
>
<a-icon type="delete" />删除
<a-icon type="delete"/>删除
</a-popconfirm>
<span v-else>
<a-icon type="delete" />删除
<a-icon type="delete"/>删除
</span>
</a-menu-item>
</a-menu>
@ -83,28 +57,11 @@
:visible="visible"
destroyOnClose
>
<a-row
:gutter="12"
type="flex"
>
<a-col
:xl="12"
:lg="12"
:md="12"
:sm="24"
:xs="24"
>
<a-skeleton
active
:loading="optionLoading"
:paragraph="{rows: 10}"
>
<a-row :gutter="12" type="flex">
<a-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
<a-skeleton active :loading="optionLoading" :paragraph="{rows: 10}">
<a-card :bordered="false">
<img
:alt="themeProperty.name"
:src="themeProperty.screenshots"
slot="cover"
>
<img :alt="themeProperty.name" :src="themeProperty.screenshots" slot="cover">
<a-card-meta
:title="themeProperty.author.name"
:description="themeProperty.description"
@ -115,32 +72,15 @@
size="large"
slot="avatar"
/>
<a-avatar
v-else
size="large"
slot="avatar"
>{{ themeProperty.author.name }}</a-avatar>
<a-avatar v-else size="large" slot="avatar">{{ themeProperty.author.name }}</a-avatar>
</a-card-meta>
</a-card>
</a-skeleton>
</a-col>
<a-col
:xl="12"
:lg="12"
:md="12"
:sm="24"
:xs="24"
>
<a-skeleton
active
:loading="optionLoading"
:paragraph="{rows: 20}"
>
<a-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
<a-skeleton active :loading="optionLoading" :paragraph="{rows: 20}">
<div class="card-container">
<a-tabs
type="card"
defaultActiveKey="0"
>
<a-tabs type="card" defaultActiveKey="0">
<a-tab-pane
v-for="(group, index) in themeConfiguration"
:key="index.toString()"
@ -189,10 +129,7 @@
</a-select>
</a-form-item>
<a-form-item>
<a-button
type="primary"
@click="saveSettings"
>保存</a-button>
<a-button type="primary" @click="saveSettings"></a-button>
</a-form-item>
</a-form>
</a-tab-pane>
@ -203,13 +140,7 @@
</a-row>
</a-drawer>
<div class="upload-button">
<a-button
type="primary"
shape="circle"
icon="plus"
size="large"
@click="showUploadModal"
></a-button>
<a-button type="primary" shape="circle" icon="plus" size="large" @click="showUploadModal"></a-button>
</div>
<a-modal
title="安装主题"
@ -218,10 +149,7 @@
:bodyStyle="{ padding: '0 24px 24px' }"
>
<a-tabs defaultActiveKey="1">
<a-tab-pane
tab="本地上传"
key="1"
>
<a-tab-pane tab="本地上传" key="1">
<upload
name="file"
multiple
@ -231,25 +159,19 @@
@success="handleUploadSuccess"
>
<p class="ant-upload-drag-icon">
<a-icon type="inbox" />
<a-icon type="inbox"/>
</p>
<p class="ant-upload-text">点击选择主题或将主题拖拽到此处</p>
<p class="ant-upload-hint">支持单个或批量上传仅支持 ZIP 格式的文件</p>
</upload>
</a-tab-pane>
<a-tab-pane
tab="远程拉取"
key="2"
>
<a-tab-pane tab="远程拉取" key="2">
<a-form layout="vertical">
<a-form-item label="远程地址:">
<a-input v-model="fetchingUrl" />
<a-input v-model="fetchingUrl"/>
</a-form-item>
<a-form-item>
<a-button
type="primary"
@click="handleFetching"
>确定</a-button>
<a-button type="primary" @click="handleFetching"></a-button>
</a-form-item>
</a-form>
</a-tab-pane>

View File

@ -4,42 +4,25 @@
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col
:md="6"
:sm="24"
>
<a-col :md="6" :sm="24">
<a-form-item label="关键词">
<a-input v-model="queryParam.keyword" />
<a-input v-model="queryParam.keyword"/>
</a-form-item>
</a-col>
<a-col
:md="6"
:sm="24"
>
<a-col :md="6" :sm="24">
<a-form-item label="文章状态">
<a-select
v-model="queryParam.status"
placeholder="请选择文章状态"
>
<a-select v-model="queryParam.status" placeholder="请选择文章状态">
<a-select-option
v-for="status in Object.keys(postStatus)"
:key="status"
:value="status"
>
{{ postStatus[status].text }}
</a-select-option>
>{{ postStatus[status].text }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:md="6"
:sm="24"
>
<a-col :md="6" :sm="24">
<a-form-item label="分类目录">
<a-select
v-model="queryParam.categoryId"
placeholder="请选择分类"
>
<a-select v-model="queryParam.categoryId" placeholder="请选择分类">
<a-select-option
v-for="category in categories"
:key="category.id"
@ -48,19 +31,10 @@
</a-form-item>
</a-col>
<a-col
:md="6"
:sm="24"
>
<a-col :md="6" :sm="24">
<span class="table-page-search-submitButtons">
<a-button
type="primary"
@click="loadPosts"
>查询</a-button>
<a-button
style="margin-left: 8px;"
@click="resetParam"
>重置</a-button>
<a-button type="primary" @click="loadPosts"></a-button>
<a-button style="margin-left: 8px;" @click="resetParam"></a-button>
</span>
</a-col>
</a-row>
@ -69,21 +43,20 @@
<div class="table-operator">
<router-link :to="{name:'PostEdit'}">
<a-button
type="primary"
icon="plus"
>写文章</a-button>
<a-button type="primary" icon="plus">写文章</a-button>
</router-link>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1">
<a-icon type="delete" />移到回收站 </a-menu-item>
<a-icon type="delete"/>移到回收站
</a-menu-item>
<a-menu-item key="2">
<a-icon type="delete" />永久删除 </a-menu-item>
<a-icon type="delete"/>永久删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px;">
批量操作
<a-icon type="down" />
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
@ -99,74 +72,34 @@
:loading="postsLoading"
:pagination="false"
>
<span
slot="status"
slot-scope="statusProperty"
>
<a-badge :status="statusProperty.status" />{{ statusProperty.text }}
<span slot="status" slot-scope="statusProperty">
<a-badge :status="statusProperty.status"/>
{{ statusProperty.text }}
</span>
<span
slot="categories"
slot-scope="categoriesOfPost"
>
<span slot="categories" slot-scope="categoriesOfPost">
<a-tag
v-for="(category,index) in categoriesOfPost"
:key="index"
color="blue"
>
{{ category.name }}
</a-tag>
>{{ category.name }}</a-tag>
</span>
<span
slot="tags"
slot-scope="tags"
>
<a-tag
v-for="(tag, index) in tags"
:key="index"
color="green"
>
{{ tag.name }}
</a-tag>
<span slot="tags" slot-scope="tags">
<a-tag v-for="(tag, index) in tags" :key="index" color="green">{{ tag.name }}</a-tag>
</span>
<span
slot="createTime"
slot-scope="createTime"
>
{{ createTime | timeAgo }}
</span>
<span slot="createTime" slot-scope="createTime">{{ createTime | timeAgo }}</span>
<span
slot="updateTime"
slot-scope="updateTime"
>
{{ updateTime | timeAgo }}
</span>
<span slot="updateTime" slot-scope="updateTime">{{ updateTime | timeAgo }}</span>
<span
slot="action"
slot-scope="text, post"
>
<a
href="javascript:;"
@click="onEditClick(post)"
>编辑</a>
<a-divider type="vertical" />
<a
href="javascript:;"
@click="deletePost(post.id)"
>删除</a>
<span slot="action" slot-scope="text, post">
<a href="javascript:;" @click="onEditClick(post)"></a>
<a-divider type="vertical"/>
<a href="javascript:;" @click="deletePost(post.id)"></a>
</span>
</a-table>
<a-row
type="flex"
justify="end"
align="middle"
>
<a-row type="flex" justify="end" align="middle">
<a-pagination
class="pagination"
:total="pagination.total"
@ -234,11 +167,6 @@ export default {
title: '访问量',
dataIndex: 'visits'
},
{
title: '创建时间',
dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' }
},
{
title: '更新时间',
dataIndex: 'updateTime',