Support theme reload.

pull/9/head
ruibaby 2019-05-01 22:26:17 +08:00
parent 2e69a8167a
commit c41caba1c0
6 changed files with 52 additions and 27 deletions

View File

@ -117,4 +117,11 @@ themeApi.saveContent = (path, content) => {
})
}
themeApi.reload = () => {
return service({
url: `${baseUrl}/reload`,
method: 'post'
})
}
export default themeApi

View File

@ -8,7 +8,6 @@ const toolbars = {
ol: true, // 有序列表
ul: true, // 无序列表
link: true, // 链接
imagelink: true, // 图片链接
code: true, // code
table: true, // 表格
fullscreen: true, // 全屏编辑

View File

@ -145,10 +145,6 @@ const columns = [
title: '排序',
dataIndex: 'priority'
},
{
title: '图标',
dataIndex: 'icon'
},
{
title: '操作',
key: 'action',

View File

@ -215,13 +215,22 @@
<AttachmentDrawer v-model="attachmentDrawerVisible" />
</a-drawer>
<div class="upload-button">
<a-button
type="primary"
shape="circle"
icon="plus"
size="large"
@click="handleShowUploadModal"
></a-button>
<a-dropdown placement="topLeft" :trigger="['hover','click']">
<a-button
type="primary"
shape="circle"
icon="plus"
size="large"
></a-button>
<a-menu slot="overlay">
<a-menu-item>
<a rel="noopener noreferrer" href="javascript:void(0);" @click="handleShowUploadModal"></a>
</a-menu-item>
<a-menu-item>
<a rel="noopener noreferrer" href="javascript:void(0);" @click="handleReload"></a>
</a-menu-item>
</a-menu>
</a-dropdown>
</div>
<a-modal
title="安装主题"
@ -392,6 +401,11 @@ export default {
this.$message.success('上传成功')
this.loadThemes()
})
},
handleReload() {
themeApi.reload().then(response => {
this.$message.success('刷新成功!')
})
}
}
}

View File

@ -1,9 +1,7 @@
<template>
<div class="page-header-index-wide">
<a-row>
<a-col
:span="24"
>
<a-col :span="24">
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
@ -13,7 +11,7 @@
: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
@ -65,16 +63,20 @@
slot-scope="item, index"
:key="index"
>
<template
slot="actions"
v-for="{type, text} in actions"
>
<span :key="type">
<template slot="actions">
<span>
<a-icon
:type="type"
type="like-o"
style="margin-right: 8px"
/>
{{ text }}
{{ item.likes }}
</span>
<span>
<a-icon
type="message"
style="margin-right: 8px"
/>
{{ item.commentCount }}
</span>
</template>
<template slot="extra">
@ -97,7 +99,7 @@
<a-avatar
slot="avatar"
size="large"
src="https://gravatar.loli.net/avatar/7cc7f29278071bd4dce995612d428834?s=256&d=mm"
:src="user.avatar"
/>
</a-list-item-meta>
</a-list-item>
@ -145,6 +147,7 @@
<script>
import journalApi from '@/api/journal'
import userApi from '@/api/user'
export default {
data() {
@ -163,13 +166,14 @@ export default {
sort: null,
keyword: null
},
actions: [{ type: 'like-o', text: '28031230' }, { type: 'message', text: '2' }],
journals: [],
journal: {}
journal: {},
user: {}
}
},
created() {
this.loadJournals()
this.loadUser()
},
methods: {
loadJournals(isSearch) {
@ -186,6 +190,11 @@ export default {
this.listLoading = false
})
},
loadUser() {
userApi.getProfile().then(response => {
this.user = response.data.data
})
},
handleNew() {
this.title = '新建'
this.visible = true

View File

@ -157,7 +157,7 @@
accept="application/json"
:uploadHandler="handleMigrationUpload"
@remove="handleMigrationFileRemove"
class="animated fadeInUp"
class="animated fadeIn"
:style="{'animation-delay': '0.2s'}"
>
<p class="ant-upload-drag-icon">