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" <a-list-item slot="renderItem" slot-scope="item, index" :key="index">
:lg="4" <a-card :bodyStyle="{ padding: 0 }" hoverable @click="showDetailDrawer(item)">
:md="12" <div class="attach-thumb">
:sm="12" <img :src="item.thumbPath">
:xs="24" </div>
> <a-card-meta>
<a-card :bodyStyle="{ padding: 0 }" hoverable @click="showDetailDrawer(attachment)"> <template slot="description">{{ item.mediaType }}</template>
<div class="attach-thumb"> </a-card-meta>
<img :src="attachment.thumbPath"> </a-card>
</div> </a-list-item>
<a-card-meta> </a-list>
<template slot="description">{{ attachment.mediaType }}</template>
</a-card-meta>
</a-card>
</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,51 +1,49 @@
<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" <a-list-item slot="renderItem" slot-scope="item, index" :key="index">
:xs="24" <a-card hoverable :title="item.name">
v-for="(theme, index) in themes" <img :alt="item.name" :src="item.screenshots" slot="cover">
:key="index" <template class="ant-card-actions" slot="actions">
> <div v-if="item.activated">
<a-card hoverable :title="theme.name"> <a-icon type="unlock" theme="twoTone"/>已启用
<img :alt="theme.name" :src="theme.screenshots" slot="cover"> </div>
<template class="ant-card-actions" slot="actions"> <div v-else @click="handleActivateClick(item)">
<div v-if="theme.activated"> <a-icon type="lock"/>启用
<a-icon type="unlock" theme="twoTone"/>已启用 </div>
</div> <div @click="handleEditClick(item)">
<div v-else @click="handleActivateClick(theme)"> <a-icon type="setting"/>设置
<a-icon type="lock"/>启用 </div>
</div> <a-dropdown placement="topCenter">
<div @click="handleEditClick(theme)"> <a class="ant-dropdown-link" href="#">
<a-icon type="setting"/>设置 <a-icon type="ellipsis"/>更多
</div> </a>
<a-dropdown placement="topCenter"> <a-menu slot="overlay">
<a class="ant-dropdown-link" href="#"> <a-menu-item :key="1" :disabled="item.activated">
<a-icon type="ellipsis"/>更多 <a-popconfirm
</a> v-if="!item.activated"
<a-menu slot="overlay"> :title="'确定删除【' + item.name + '】主题?'"
<a-menu-item :key="1" :disabled="theme.activated"> @confirm="deleteTheme(item.id)"
<a-popconfirm okText="确定"
v-if="!theme.activated" cancelText="取消"
:title="'确定删除【' + theme.name + '】主题?'" >
@confirm="deleteTheme(theme.id)" <a-icon type="delete"/>删除
okText="确定" </a-popconfirm>
cancelText="取消" <span v-else>
> <a-icon type="delete"/>删除
<a-icon type="delete"/>删除 </span>
</a-popconfirm> </a-menu-item>
<span v-else> </a-menu>
<a-icon type="delete"/>删除 </a-dropdown>
</span> </template>
</a-menu-item> </a-card>
</a-menu> </a-list-item>
</a-dropdown> </a-list>
</template>
</a-card>
</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 = {}
} }
} }