Change some method name.

pull/9/head
ruibaby 2019-04-27 02:40:10 +08:00
parent 3b33a34db3
commit 7618dbc08c
17 changed files with 119 additions and 106 deletions

View File

@ -223,6 +223,10 @@ export const constantRouterMap = [
path: '/login',
component: () => import('@/views/user/Login')
},
{
path: '/install',
component: () => import('@/views/system/Installation')
},
{
path: '/404',
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')

View File

@ -60,7 +60,7 @@
>查询</a-button>
<a-button
style="margin-left: 8px;"
@click="resetParam"
@click="handleResetParam"
>重置</a-button>
</span>
</a-col>
@ -71,7 +71,7 @@
<a-button
type="primary"
icon="plus"
@click="showUploadModal"
@click="handleShowUploadModal"
>上传</a-button>
</div>
</a-card>
@ -90,7 +90,7 @@
<a-card
:bodyStyle="{ padding: 0 }"
hoverable
@click="showDetailDrawer(item)"
@click="handleShowDetailDrawer(item)"
>
<div class="attach-thumb">
<img :src="item.thumbPath">
@ -215,11 +215,11 @@ export default {
this.mediaTypes = response.data.data
})
},
showDetailDrawer(attachment) {
handleShowDetailDrawer(attachment) {
this.selectAttachment = attachment
this.drawerVisiable = true
},
showUploadModal() {
handleShowUploadModal() {
this.uploadVisible = true
},
handleUploadSuccess() {
@ -232,7 +232,7 @@ export default {
this.pagination.size = size
this.loadAttachments()
},
resetParam() {
handleResetParam() {
this.queryParam.keyword = null
this.queryParam.mediaType = null
this.queryParam.attachmentType = null

View File

@ -38,7 +38,7 @@
>
<a-input
v-model="attachment.name"
@blur="updateAttachment"
@blur="doUpdateAttachment"
/>
</template>
<template
@ -94,7 +94,7 @@
<a href="javascript:void(0);">
<a-icon
type="copy"
@click="doCopyNormalLink"
@click="handleCopyNormalLink"
/>
</a>
</span>
@ -108,7 +108,7 @@
<a href="javascript:void(0);">
<a-icon
type="copy"
@click="doCopyMarkdownLink"
@click="handleCopyMarkdownLink"
/>
</a>
</span>
@ -134,7 +134,7 @@
</a-popconfirm>
<a-popconfirm
title="你确定要删除该附件?"
@confirm="deleteAttachment"
@confirm="handleDeleteAttachment"
okText="确定"
cancelText="取消"
>
@ -198,7 +198,7 @@ export default {
this.detailLoading = false
}, 500)
},
deleteAttachment() {
handleDeleteAttachment() {
attachmentApi.delete(this.attachment.id).then(response => {
this.$message.success('删除成功!')
this.$emit('delete', this.attachment)
@ -208,14 +208,14 @@ export default {
handleEditName() {
this.editable = !this.editable
},
updateAttachment() {
doUpdateAttachment() {
attachmentApi.update(this.attachment.id, this.attachment).then(response => {
this.$log.debug('Updated attachment', response.data.data)
this.$message.success('附件修改成功')
})
this.editable = false
},
doCopyNormalLink() {
handleCopyNormalLink() {
const text = `${this.attachment.path}`
this.$copyText(text)
.then(message => {
@ -227,7 +227,7 @@ export default {
this.$message.error('复制失败')
})
},
doCopyMarkdownLink() {
handleCopyMarkdownLink() {
const text = `![${this.attachment.name}](${this.attachment.path})`
this.$copyText(text)
.then(message => {

View File

@ -34,7 +34,7 @@
class="attach-item"
v-for="(item, index) in formattedDatas"
:key="index"
@click="showDetailDrawer(item)"
@click="handleShowDetailDrawer(item)"
>
<img :src="item.thumbPath">
</div>
@ -59,7 +59,7 @@
<a-divider />
<div class="bottom-control">
<a-button
@click="showUploadModal"
@click="handleShowUploadModal"
type="primary"
>上传附件</a-button>
</div>
@ -158,10 +158,10 @@ export default {
this.skeletonLoading = false
}, 500)
},
showUploadModal() {
handleShowUploadModal() {
this.uploadVisible = true
},
showDetailDrawer(attachment) {
handleShowDetailDrawer(attachment) {
this.selectedAttachment = attachment
this.$log.debug('Show detail of', attachment)
this.detailVisiable = true

View File

@ -32,7 +32,7 @@
class="attach-item"
v-for="(item, index) in attachments"
:key="index"
@click="selectAttachment(item)"
@click="handleSelectAttachment(item)"
>
<img :src="item.thumbPath">
</div>
@ -50,7 +50,7 @@
<a-divider />
<div class="bottom-control">
<a-button
@click="showUploadModal"
@click="handleShowUploadModal"
type="primary"
>上传附件</a-button>
</div>
@ -132,7 +132,7 @@ export default {
this.skeletonLoading = false
}, 500)
},
showUploadModal() {
handleShowUploadModal() {
this.uploadVisible = true
},
loadAttachments() {
@ -143,7 +143,7 @@ export default {
this.pagination.total = response.data.data.total
})
},
selectAttachment(item) {
handleSelectAttachment(item) {
this.$emit('listenToSelect', item)
},
handlePaginationChange(page, pageSize) {

View File

@ -41,7 +41,7 @@
>查询</a-button>
<a-button
style="margin-left: 8px;"
@click="resetParam"
@click="handleResetParam"
>重置</a-button>
</span>
</a-col>
@ -93,12 +93,12 @@
>
<a
href="javascript:;"
@click="editComment(record.id)"
@click="handleEditComment(record.id)"
>通过</a>
<a-divider type="vertical" />
<a
href="javascript:;"
@click="deleteComment(record.id)"
@click="handleDeleteComment(record.id)"
>删除</a>
</span>
</a-table>
@ -108,8 +108,8 @@
:total="pagination.total"
:pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']"
showSizeChanger
@showSizeChange="onPaginationChange"
@change="onPaginationChange"
@showSizeChange="handlePaginationChange"
@change="handlePaginationChange"
/>
</div>
</div>
@ -203,19 +203,19 @@ export default {
this.commentsLoading = false
})
},
editComment(id) {
handleEditComment(id) {
this.$message.success('编辑')
},
deleteComment(id) {
handleDeleteComment(id) {
this.$message.success('删除')
},
onPaginationChange(page, pageSize) {
handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
this.pagination.current = page
this.pagination.pageSize = pageSize
this.loadComments()
},
resetParam() {
handleResetParam() {
this.queryParam.keyword = null
this.queryParam.status = null
this.loadComments()

View File

@ -38,7 +38,7 @@
<a-card title="Anatole 主题">
<theme-file
:files="files"
@listenToSelect="catchSelectFile"
@listenToSelect="handleSelectFile"
/>
</a-card>
</a-col>
@ -85,7 +85,7 @@ export default {
this.files = response.data.data
})
},
catchSelectFile(file) {
handleSelectFile(file) {
const _this = this
if (!file.editable) {
this.$message.info('该文件不支持修改')

View File

@ -58,7 +58,7 @@
<a-popconfirm
v-if="!item.activated"
:title="'确定删除【' + item.name + '】主题?'"
@confirm="deleteTheme(item.id)"
@confirm="handleDeleteTheme(item.id)"
okText="确定"
cancelText="取消"
>
@ -193,7 +193,7 @@
<a-form-item>
<a-button
type="primary"
@click="saveSettings"
@click="handleSaveSettings"
>保存</a-button>
</a-form-item>
</a-form>
@ -210,7 +210,7 @@
shape="circle"
icon="plus"
size="large"
@click="showUploadModal"
@click="handleShowUploadModal"
></a-button>
</div>
<a-modal
@ -320,13 +320,13 @@ export default {
this.loadThemes()
})
},
deleteTheme(key) {
handleDeleteTheme(key) {
themeApi.delete(key).then(response => {
this.$message.success('删除成功!')
this.loadThemes()
})
},
saveSettings() {
handleSaveSettings() {
themeApi.saveSettings(this.themeProperty.id, this.themeSettings).then(response => {
this.$message.success('保存成功!')
})
@ -342,7 +342,7 @@ export default {
this.themeConfiguration = null
this.themeProperty = null
},
showUploadModal() {
handleShowUploadModal() {
this.uploadVisible = true
},
handleChange(info) {

View File

@ -42,7 +42,7 @@
<a-form-item>
<a-button
type="primary"
@click="createCategory"
@click="handleCreateCategory"
>保存</a-button>
</a-form-item>
</a-form>
@ -77,12 +77,12 @@
>
<a
href="javascript:;"
@click="editCategory(record.id)"
@click="handleEditCategory(record.id)"
>编辑</a>
<a-divider type="vertical" />
<a-popconfirm
:title="'你确定要删除【' + record.name + '】分类?'"
@confirm="deleteCategory(record.id)"
@confirm="handleDeleteCategory(record.id)"
okText="确定"
cancelText="取消"
>
@ -149,17 +149,17 @@ export default {
this.categories = response.data.data
})
},
createCategory() {
handleCreateCategory() {
categoryApi.create(this.categoryToCreate).then(response => {
this.$message.success('添加成功!')
this.loadCategories()
this.categoryToCreate = {}
})
},
editCategory(id) {
handleEditCategory(id) {
this.$message.success('编辑' + id)
},
deleteCategory(id) {
handleDeleteCategory(id) {
categoryApi.delete(id).then(response => {
this.$message.success('删除成功!')
this.loadCategories()

View File

@ -123,7 +123,7 @@
<img
class="img"
:src="postToStage.thumbnail || 'https://os.alipayobjects.com/rmsportal/mgesTPFxodmIwpi.png'"
@click="showThumbDrawer"
@click="handleShowThumbDrawer"
>
<a-button
class="post-thum-remove"
@ -137,7 +137,7 @@
</div>
<AttachmentSelectDrawer
v-model="thumDrawerVisible"
@listenToSelect="selectPostThumb"
@listenToSelect="handleSelectPostThumb"
:drawerWidth="460"
/>
<a-divider />
@ -160,11 +160,11 @@
<footer-tool-bar :style="{ width: isSideMenu() && isDesktop() ? `calc(100% - ${sidebarOpened ? 256 : 80}px)` : '100%'}">
<a-button
type="primary"
@click="showDrawer"
@click="handleShowDrawer"
>发布</a-button>
<a-button
type="dashed"
@click="showAttachDrawer"
@click="handleShowAttachDrawer"
style="margin-left: 8px;"
>附件库</a-button>
</footer-tool-bar>
@ -275,13 +275,13 @@ export default {
})
}
},
showDrawer() {
handleShowDrawer() {
this.visible = true
},
showAttachDrawer() {
handleShowAttachDrawer() {
this.attachmentDrawerVisible = true
},
showThumbDrawer() {
handleShowThumbDrawer() {
this.thumDrawerVisible = true
},
toggleCategoryForm() {
@ -307,7 +307,7 @@ export default {
onClose() {
this.visible = false
},
selectPostThumb(data) {
handleSelectPostThumb(data) {
this.postToStage.thumbnail = data.path
this.thumDrawerVisible = false
}

View File

@ -57,7 +57,7 @@
>查询</a-button>
<a-button
style="margin-left: 8px;"
@click="resetParam"
@click="handleResetParam"
>重置</a-button>
</span>
</a-col>
@ -140,12 +140,12 @@
>
<a
href="javascript:;"
@click="onEditClick(post)"
@click="handleEditClick(post)"
v-if="post.status === 'PUBLISHED' || post.status === 'DRAFT'"
>编辑</a>
<a-popconfirm
:title="'你确定要发布【' + post.title + '】文章?'"
@confirm="onEditStatusClick(post.id,'PUBLISHED')"
@confirm="handleEditStatusClick(post.id,'PUBLISHED')"
okText="确定"
cancelText="取消"
v-else-if="post.status === 'RECYCLE'"
@ -157,7 +157,7 @@
<a-popconfirm
:title="'你确定要将【' + post.title + '】文章移到回收站?'"
@confirm="onEditStatusClick(post.id,'RECYCLE')"
@confirm="handleEditStatusClick(post.id,'RECYCLE')"
okText="确定"
cancelText="取消"
v-if="post.status === 'PUBLISHED' || post.status === 'DRAFT'"
@ -167,7 +167,7 @@
<a-popconfirm
:title="'你确定要永久删除【' + post.title + '】文章?'"
@confirm="onDeleteClick(post.id)"
@confirm="handleDeleteClick(post.id)"
okText="确定"
cancelText="取消"
v-else-if="post.status === 'RECYCLE'"
@ -182,8 +182,8 @@
:total="pagination.total"
:pageSizeOptions="['1', '2', '5', '10', '20', '50', '100']"
showSizeChanger
@showSizeChange="onPaginationChange"
@change="onPaginationChange"
@showSizeChange="handlePaginationChange"
@change="handlePaginationChange"
/>
</div>
</div>
@ -292,12 +292,9 @@ export default {
this.categories = response.data.data
})
},
onEditClick(post) {
handleEditClick(post) {
this.$router.push({ name: 'PostEdit', query: { postId: post.id } })
},
deletePost(id) {
this.$message.success('删除')
},
onSelectionChange(selectedRowKeys) {
this.$log.debug(`SelectedRowKeys: ${selectedRowKeys}`)
},
@ -309,25 +306,25 @@ export default {
}
}
},
onPaginationChange(page, pageSize) {
handlePaginationChange(page, pageSize) {
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
this.pagination.current = page
this.pagination.pageSize = pageSize
this.loadPosts()
},
resetParam() {
handleResetParam() {
this.queryParam.keyword = null
this.queryParam.categoryId = null
this.queryParam.status = null
this.loadPosts()
},
onEditStatusClick(postId, status) {
handleEditStatusClick(postId, status) {
postApi.updateStatus(postId, status).then(response => {
this.$message.success('操作成功!')
this.loadPosts()
})
},
onDeleteClick(postId) {
handleDeleteClick(postId) {
postApi.delete(postId).then(response => {
this.$message.success('删除成功!')
this.loadPosts()

View File

@ -26,7 +26,7 @@
<a-form-item>
<a-button
type="primary"
@click="createTag"
@click="handleCreateTag"
>保存</a-button>
</a-form-item>
</a-form>
@ -51,7 +51,7 @@
</template>
<a-tag
closable
@close="deleteTag(tag.id)"
@close="handleDeleteTag(tag.id)"
color="blue"
>{{ tag.name }}</a-tag>
</a-tooltip>
@ -81,17 +81,17 @@ export default {
this.tags = response.data.data
})
},
createTag() {
handleCreateTag() {
tagApi.create(this.tagToCreate).then(response => {
this.loadTags()
})
},
updateTag(tagId) {
handleUpdateTag(tagId) {
tagApi.update(tagId, this.tagToUpdate).then(response => {
this.loadTags()
})
},
deleteTag(tagId) {
handleDeleteTag(tagId) {
tagApi.delete(tagId).then(response => {
this.$message.success('删除成功!')
this.loadTags()

View File

@ -87,7 +87,7 @@
<img
class="img"
:src="sheetToStage.thumbnail || 'https://os.alipayobjects.com/rmsportal/mgesTPFxodmIwpi.png'"
@click="showThumbDrawer"
@click="handleShowThumbDrawer"
>
<a-button
class="sheet-thum-remove"
@ -101,7 +101,7 @@
</div>
<AttachmentSelectDrawer
v-model="thumDrawerVisible"
@listenToSelect="selectSheetThumb"
@listenToSelect="handleSelectSheetThumb"
:drawerWidth="460"
/>
<div class="bottom-control">
@ -121,12 +121,12 @@
<footer-tool-bar :style="{ width: isSideMenu() && isDesktop() ? `calc(100% - ${sidebarOpened ? 256 : 80}px)` : '100%'}">
<a-button
type="primary"
@click="showDrawer"
@click="handleShowDrawer"
>发布</a-button>
<a-button
type="dashed"
style="margin-left: 8px;"
@click="showAttachDrawer"
@click="handleShowAttachDrawer"
>附件库</a-button>
</footer-tool-bar>
</div>
@ -195,13 +195,13 @@ export default {
this.customTpls = response.data.data
})
},
showAttachDrawer() {
handleShowAttachDrawer() {
this.attachmentDrawerVisible = true
},
showThumbDrawer() {
handleShowThumbDrawer() {
this.thumDrawerVisible = true
},
showDrawer() {
handleShowDrawer() {
this.visible = true
},
handlePublishClick() {
@ -232,7 +232,7 @@ export default {
onClose() {
this.visible = false
},
selectSheetThumb(data) {
handleSelectSheetThumb(data) {
this.sheetToStage.thumbnail = data.path
this.thumDrawerVisible = false
}

View File

@ -67,7 +67,7 @@
<a-divider type="vertical" />
<a
href="javascript:;"
@click="viewPage(record.id)"
@click="handleViewPage(record.id)"
>查看</a>
</span>
</a-table>
@ -101,13 +101,13 @@
>
<a
href="javascript:;"
@click="onEditClick(sheet)"
@click="handleEditClick(sheet)"
v-if="sheet.status === 'PUBLISHED' || sheet.status === 'DRAFT'"
>编辑</a>
<a-popconfirm
:title="'你确定要发布【' + sheet.title + '】?'"
@confirm="onEditStatusClick(sheet.id,'PUBLISHED')"
@confirm="handleEditStatusClick(sheet.id,'PUBLISHED')"
okText="确定"
cancelText="取消"
v-else-if="sheet.status === 'RECYCLE'"
@ -121,7 +121,7 @@
<a-popconfirm
:title="'你确定要将【' + sheet.title + '】页面移到回收站?'"
@confirm="onEditStatusClick(sheet.id,'RECYCLE')"
@confirm="handleEditStatusClick(sheet.id,'RECYCLE')"
okText="确定"
cancelText="取消"
v-if="sheet.status === 'PUBLISHED' || sheet.status === 'DRAFT'"
@ -133,7 +133,7 @@
<a-popconfirm
:title="'你确定要永久删除【' + sheet.title + '】页面?'"
@confirm="onDeleteClick(sheet.id)"
@confirm="handleDeleteClick(sheet.id)"
okText="确定"
cancelText="取消"
v-else-if="sheet.status === 'RECYCLE'"
@ -247,22 +247,22 @@ export default {
this.sheets = response.data.data.content
})
},
onEditClick(sheet) {
handleEditClick(sheet) {
this.$router.push({ name: 'SheetEdit', query: { sheetId: sheet.id } })
},
onEditStatusClick(sheetId, status) {
handleEditStatusClick(sheetId, status) {
sheetApi.updateStatus(sheetId, status).then(response => {
this.$message.success('操作成功!')
this.loadSheets()
})
},
onDeleteClick(sheetId) {
handleDeleteClick(sheetId) {
sheetApi.delete(sheetId).then(response => {
this.$message.success('删除成功!')
this.loadSheets()
})
},
viewPage(id) {
handleViewPage(id) {
this.$message.success('查看' + id)
}
}

View File

@ -0,0 +1,12 @@
<template>
<div>
安装向导
</div>
</template>
<script>
</script>
<style lang="less" scoped>
</style>

View File

@ -52,7 +52,7 @@
<a-form-item>
<a-button
type="primary"
@click="saveOptions"
@click="handleSaveOptions"
>保存</a-button>
</a-form-item>
</a-form>
@ -113,7 +113,7 @@
<a-form-item>
<a-button
type="primary"
@click="saveOptions"
@click="handleSaveOptions"
>保存</a-button>
</a-form-item>
</a-form>
@ -156,7 +156,7 @@
<a-form-item>
<a-button
type="primary"
@click="saveOptions"
@click="handleSaveOptions"
>保存</a-button>
</a-form-item>
</a-form>
@ -277,7 +277,7 @@
<a-form-item>
<a-button
type="primary"
@click="saveOptions"
@click="handleSaveOptions"
>保存</a-button>
</a-form-item>
</a-form>
@ -445,7 +445,7 @@
<a-form-item>
<a-button
type="primary"
@click="saveOptions"
@click="handleSaveOptions"
>保存</a-button>
</a-form-item>
</a-form>
@ -518,7 +518,7 @@
<a-form-item>
<a-button
type="primary"
@click="saveOptions"
@click="handleSaveOptions"
>保存</a-button>
</a-form-item>
</a-form>
@ -593,7 +593,7 @@
<a-form-item>
<a-button
type="primary"
@click="saveOptions"
@click="handleSaveOptions"
>保存</a-button>
</a-form-item>
</a-form>
@ -630,7 +630,7 @@ export default {
this.options = response.data.data
})
},
saveOptions() {
handleSaveOptions() {
optionApi.save(this.options).then(response => {
this.loadOptions()
this.$message.success('保存成功!')

View File

@ -22,7 +22,7 @@
<div class="avatar">
<img
:src="user.avatar || 'https://gravatar.loli.net/avatar/?s=256&d=mm'"
@click="showAttachDrawer"
@click="handleShowAttachDrawer"
>
</div>
</a-tooltip>
@ -97,7 +97,7 @@
</a-form-item>
<a-form-item>
<a-button
@click="updateProfile"
@click="handleUpdateProfile"
type="primary"
>保存</a-button>
</a-form-item>
@ -129,7 +129,7 @@
<a-form-item>
<a-button
:disabled="passwordUpdateButtonDisabled"
@click="updatePassword"
@click="handleUpdatePassword"
type="primary"
>确认更改</a-button>
</a-form-item>
@ -143,7 +143,7 @@
<AttachmentSelectDrawer
v-model="attachmentDrawerVisible"
@listenToSelect="selectAvatar"
@listenToSelect="handleSelectAvatar"
/>
</div>
</template>
@ -181,7 +181,7 @@ export default {
this.getCounts()
},
methods: {
showAttachDrawer() {
handleShowAttachDrawer() {
this.attachmentDrawerVisible = true
},
loadUser() {
@ -196,7 +196,7 @@ export default {
this.countsLoading = false
})
},
updatePassword() {
handleUpdatePassword() {
// Check confirm password
if (this.passwordParam.newPassword !== this.passwordParam.confirmPassword) {
this.$message.error('确认密码和新密码不匹配!')
@ -205,13 +205,13 @@ export default {
userApi.updatePassword(this.passwordParam.oldPassword, this.passwordParam.newPassword).then(response => {})
},
updateProfile() {
handleUpdateProfile() {
userApi.updateProfile(this.user).then(response => {
this.user = response.data.data
this.$message.success('资料更新成功!')
})
},
selectAvatar(data) {
handleSelectAvatar(data) {
this.user.avatar = data.path
this.attachmentDrawerVisible = false
}