Merge branch 'master' of gitlab.com:halo_dev/halo-admin

pull/9/head
johnniang 6 years ago
commit 39137738a9

@ -1,6 +1,46 @@
<template>
<page-view>
<a-row :gutter="12" type="flex" align="middle">
<a-col :span="24" class="search-box">
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="6" :sm="24">
<a-form-item label="关键词">
<a-input/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="年月份">
<a-select placeholder="请选择年月">
<a-select-option value="2019-01">2019-01</a-select-option>
<a-select-option value="2019-02">2019-02</a-select-option>
<a-select-option value="2019-03">2019-03</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="类型">
<a-select placeholder="请选择类型">
<a-select-option value="image/png">image/png</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary">查询</a-button>
<a-button style="margin-left: 8px;">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div class="table-operator">
<a-button type="primary" icon="plus" @click="showUploadModal"></a-button>
</div>
</a-card>
</a-col>
<a-col
class="attachment-item"
v-for="attachment in attachments"
@ -21,16 +61,13 @@
</a-card>
</a-col>
</a-row>
<a-row type="flex" justify="end" :gutter="12">
<a-row type="flex" justify="end">
<a-pagination
:defaultPageSize="pagination.size"
:total="pagination.total"
@change="handlePaginationChange"
></a-pagination>
</a-row>
<div class="upload-button">
<a-button type="primary" shape="circle" icon="plus" size="large" @click="showUploadModal"></a-button>
</div>
<a-modal title="上传附件" v-model="uploadVisible" :footer="null">
<a-upload-dragger
name="file"
@ -68,8 +105,15 @@
<a-skeleton active :loading="detailLoading" :paragraph="{rows: 8}">
<a-list itemLayout="horizontal">
<a-list-item>
<a-list-item-meta :description="selectAttachment.name">
<span slot="title">附件名</span>
<a-list-item-meta>
<template slot="description" v-if="editable">
<a-input v-model="selectAttachment.name" @blur="updateAttachment"/>
</template>
<template slot="description" v-else>{{ selectAttachment.name }}</template>
<span slot="title">
附件名
<a-icon type="edit" @click="handleEditName"/>
</span>
</a-list-item-meta>
</a-list-item>
<a-list-item>
@ -87,6 +131,11 @@
<span slot="title">图片尺寸</span>
</a-list-item-meta>
</a-list-item>
<a-list-item>
<a-list-item-meta :description="selectAttachment.createTime">
<span slot="title">上传日期</span>
</a-list-item-meta>
</a-list-item>
<a-list-item>
<a-list-item-meta :description="selectAttachment.path">
<span slot="title">
@ -141,9 +190,10 @@ export default {
selectAttachment: null,
drawerWidth: '560',
attachments: [],
editable: false,
pagination: {
page: 1,
size: 12,
size: 18,
sort: ''
}
}
@ -257,6 +307,13 @@ export default {
source.cancel('Upload operation canceled by the user.')
}
}
},
handleEditName() {
this.editable = !this.editable
},
updateAttachment() {
this.$message.success('修改')
this.editable = false
}
}
}
@ -267,16 +324,11 @@ export default {
margin: 24px 0 12px 0;
}
.attachment-item {
.attachment-item,
.search-box {
padding-bottom: 12px;
}
.upload-button {
position: fixed;
bottom: 80px;
right: 20px;
}
.attach-thumb {
width: 100%;
margin: 0 auto;
@ -311,4 +363,8 @@ export default {
background: rgb(255, 255, 255);
border-radius: 0px 0px 4px 4px;
}
.table-operator {
margin-bottom: 0;
}
</style>

@ -115,6 +115,10 @@
destroyOnClose
@close="onAttachmentClose"
>
<a-row type="flex" align="middle">
<a-input-search placeholder="搜索附件" enterButton size="large"/>
</a-row>
<a-divider></a-divider>
<a-row type="flex" align="middle">
<a-col :span="24">
<div
@ -127,6 +131,14 @@
</div>
</a-col>
</a-row>
<a-divider></a-divider>
<a-row type="flex" justify="end">
<a-pagination
:defaultPageSize="pagination.size"
:total="pagination.total"
@change="handlePaginationChange"
></a-pagination>
</a-row>
<a-drawer
title="附件详情"
@ -259,7 +271,7 @@ export default {
detailLoading: false,
pagination: {
page: 1,
size: 10,
size: 8,
sort: ''
}
}
@ -401,6 +413,11 @@ export default {
console.log('copy.err', err)
this.$message.error('复制失败')
})
},
handlePaginationChange(page, pageSize) {
this.pagination.page = page
this.pagination.size = pageSize
this.loadAttachments()
}
}
}

@ -1,10 +1,154 @@
<template>
<div class="page-header-index-wide">Backup List</div>
<div class="page-header-index-wide">
<div class="card-container">
<a-tabs type="card">
<a-tab-pane tab="资源文件备份" key="1">
<a-table :columns="columns" :dataSource="ResourcesData">
<span slot="action" slot-scope="text, record">
<a href="javascript:;" @click="downResources('ResourcesData',record.id)"></a>
<a-divider type="vertical"/>
<a href="javascript:;" @click="sendResources('ResourcesData',record.id)"></a>
<a-divider type="vertical"/>
<a href="javascript:;" @click="deleteResources('ResourcesData',record.id)"></a>
</span>
</a-table>
<a-button type="primary" @click="backupData('ResourcesData')"></a-button>
</a-tab-pane>
<a-tab-pane tab="数据库备份" key="2">
<a-table :columns="columns" :dataSource="DataBaseData">
<span slot="action" slot-scope="text, record">
<a href="javascript:;" @click="downResources('DataBaseData',record.id)"></a>
<a-divider type="vertical"/>
<a href="javascript:;" @click="sendResources('DataBaseData',record.id)"></a>
<a-divider type="vertical"/>
<a href="javascript:;" @click="deleteResources('DataBaseData',record.id)"></a>
</span>
</a-table>
<a-button type="primary" @click="backupData('DataBaseData')"></a-button>
</a-tab-pane>
<a-tab-pane tab="文章备份" key="3">
<a-table :columns="columns" :dataSource="FileData">
<span slot="action" slot-scope="text, record">
<a href="javascript:;" @click="downResources('FileData',record.id)"></a>
<a-divider type="vertical"/>
<a href="javascript:;" @click="sendResources('FileData',record.id)"></a>
<a-divider type="vertical"/>
<a href="javascript:;" @click="deleteResources('FileData',record.id)"></a>
</span>
</a-table>
<a-button type="primary" @click="backupData('FileData')"></a-button>
</a-tab-pane>
</a-tabs>
</div>
</div>
</template>
<script>
export default {}
export default {
components: {},
data() {
return {
num: 0,
columns: [
{
title: '文件名称',
dataIndex: 'name'
},
{
title: '日期',
dataIndex: 'date'
},
{
title: '文件大小',
dataIndex: 'size'
},
{
title: '文件类型',
dataIndex: 'type'
},
{
title: '操作',
scopedSlots: { customRender: 'action' }
}
],
ResourcesData: [],
FileData: []
}
},
created() {
ResourcesData = function() {}
},
methods: {
//
downResources(type, id) {
if (type == 'ResourcesData') {
alert('资源文件下载' + id)
} else if (type == 'DataBaseData') {
alert('数据库文件下载' + id)
} else {
alert('文件下载' + id)
}
},
//
sendResources(type, id) {
if (type == 'ResourcesData') {
alert('资源文件发送到邮箱' + id)
} else if (type == 'DataBaseData') {
alert('数据库文件发送到邮箱' + id)
} else {
alert('文件发送到邮箱' + id)
}
},
//
deleteResources(type, id) {
if (type == 'ResourcesData') {
alert('资源文件删除' + id)
} else if (type == 'DataBaseData') {
alert('数据库文件删除' + id)
} else {
alert('文件删除' + id)
}
},
//
backupData(type) {
if (type == 'ResourcesData') {
alert('资源文件备份')
} else if (type == 'DataBaseData') {
alert('数据库文件备份')
} else {
alert('文件备份')
}
}
}
}
</script>
<style>
.card-container {
background: #f5f5f5;
overflow: hidden;
padding: 24px;
}
.card-container > .ant-tabs-card > .ant-tabs-content {
/* height: 120px; */
margin-top: -16px;
}
<style scoped>
.card-container > .ant-tabs-card > .ant-tabs-content > .ant-tabs-tabpane {
background: #fff;
padding: 16px;
}
.card-container > .ant-tabs-card > .ant-tabs-bar {
border-color: #fff;
}
.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab {
border-color: transparent;
background: transparent;
}
.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active {
border-color: #fff;
background: #fff;
}
</style>
Loading…
Cancel
Save