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 export default themeApi

View File

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

View File

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

View File

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

View File

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

View File

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