Refactor attachment list and theme list.

pull/9/head
ruibaby 2019-04-20 17:47:00 +08:00
parent 589ffb1704
commit c007933919
4 changed files with 66 additions and 75 deletions

View File

@ -41,25 +41,22 @@
</div> </div>
</a-card> </a-card>
</a-col> </a-col>
<a-col :span="24">
<a-col <a-list
class="attachment-item" :grid="{ gutter: 12, xs: 1, sm: 2, md: 4, lg: 6, xl: 6, xxl: 6 }"
v-for="attachment in attachments" :dataSource="attachments"
:key="attachment.id"
:xl="4"
:lg="4"
:md="12"
:sm="12"
:xs="24"
> >
<a-card :bodyStyle="{ padding: 0 }" hoverable @click="showDetailDrawer(attachment)"> <a-list-item slot="renderItem" slot-scope="item, index" :key="index">
<a-card :bodyStyle="{ padding: 0 }" hoverable @click="showDetailDrawer(item)">
<div class="attach-thumb"> <div class="attach-thumb">
<img :src="attachment.thumbPath"> <img :src="item.thumbPath">
</div> </div>
<a-card-meta> <a-card-meta>
<template slot="description">{{ attachment.mediaType }}</template> <template slot="description">{{ item.mediaType }}</template>
</a-card-meta> </a-card-meta>
</a-card> </a-card>
</a-list-item>
</a-list>
</a-col> </a-col>
</a-row> </a-row>
<a-row type="flex" justify="end"> <a-row type="flex" justify="end">
@ -179,7 +176,6 @@ export default {
margin: 24px 0 12px 0; margin: 24px 0 12px 0;
} }
.attachment-item,
.search-box { .search-box {
padding-bottom: 12px; padding-bottom: 12px;
} }

View File

@ -91,6 +91,12 @@ const columns = [
title: '内容', title: '内容',
dataIndex: 'content' dataIndex: 'content'
}, },
{
title: '状态',
className: 'status',
dataIndex: 'statusProperty',
scopedSlots: { customRender: 'status' }
},
{ {
title: '评论页面', title: '评论页面',
dataIndex: 'post', dataIndex: 'post',
@ -101,12 +107,6 @@ const columns = [
dataIndex: 'createTime', dataIndex: 'createTime',
scopedSlots: { customRender: 'createTime' } scopedSlots: { customRender: 'createTime' }
}, },
{
title: '状态',
className: 'status',
dataIndex: 'statusProperty',
scopedSlots: { customRender: 'status' }
},
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',

View File

@ -1,26 +1,22 @@
<template> <template>
<div class="page-header-index-wide"> <div class="page-header-index-wide">
<a-row :gutter="12" type="flex" align="middle"> <a-row :gutter="12" type="flex" align="middle">
<a-col <a-col :span="24">
class="theme-item" <a-list
:xl="6" :grid="{ gutter: 12, xs: 1, sm: 1, md: 2, lg: 4, xl: 4, xxl: 4 }"
:lg="6" :dataSource="themes"
:md="12"
:sm="12"
:xs="24"
v-for="(theme, index) in themes"
:key="index"
> >
<a-card hoverable :title="theme.name"> <a-list-item slot="renderItem" slot-scope="item, index" :key="index">
<img :alt="theme.name" :src="theme.screenshots" slot="cover"> <a-card hoverable :title="item.name">
<img :alt="item.name" :src="item.screenshots" slot="cover">
<template class="ant-card-actions" slot="actions"> <template class="ant-card-actions" slot="actions">
<div v-if="theme.activated"> <div v-if="item.activated">
<a-icon type="unlock" theme="twoTone"/>已启用 <a-icon type="unlock" theme="twoTone"/>已启用
</div> </div>
<div v-else @click="handleActivateClick(theme)"> <div v-else @click="handleActivateClick(item)">
<a-icon type="lock"/>启用 <a-icon type="lock"/>启用
</div> </div>
<div @click="handleEditClick(theme)"> <div @click="handleEditClick(item)">
<a-icon type="setting"/>设置 <a-icon type="setting"/>设置
</div> </div>
<a-dropdown placement="topCenter"> <a-dropdown placement="topCenter">
@ -28,11 +24,11 @@
<a-icon type="ellipsis"/>更多 <a-icon type="ellipsis"/>更多
</a> </a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item :key="1" :disabled="theme.activated"> <a-menu-item :key="1" :disabled="item.activated">
<a-popconfirm <a-popconfirm
v-if="!theme.activated" v-if="!item.activated"
:title="'确定删除【' + theme.name + '】主题?'" :title="'确定删除【' + item.name + '】主题?'"
@confirm="deleteTheme(theme.id)" @confirm="deleteTheme(item.id)"
okText="确定" okText="确定"
cancelText="取消" cancelText="取消"
> >
@ -46,6 +42,8 @@
</a-dropdown> </a-dropdown>
</template> </template>
</a-card> </a-card>
</a-list-item>
</a-list>
</a-col> </a-col>
</a-row> </a-row>
<a-drawer <a-drawer
@ -299,10 +297,6 @@ export default {
margin: 14px 0; margin: 14px 0;
} }
.theme-item {
padding-bottom: 12px;
}
.theme-item .theme-control .theme-title { .theme-item .theme-control .theme-title {
font-size: 18px; font-size: 18px;
} }

View File

@ -191,6 +191,7 @@ export default {
}) })
} }
this.loadLinks() this.loadLinks()
this.addLink()
this.link = {} this.link = {}
} }
} }