mirror of https://github.com/halo-dev/halo-admin
Support journal delete.
parent
b7518ac23d
commit
6808e2ad3a
|
@ -28,4 +28,11 @@ journalApi.update = (journalId, journal) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
journalApi.delete = journalId => {
|
||||||
|
return service({
|
||||||
|
url: `${baseUrl}/${journalId}`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default journalApi
|
export default journalApi
|
||||||
|
|
|
@ -87,7 +87,14 @@
|
||||||
@click="handleEdit(item)"
|
@click="handleEdit(item)"
|
||||||
>编辑</a>
|
>编辑</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a href="javascript:void(0);">删除</a>
|
<a-popconfirm
|
||||||
|
title="你确定要删除这条日志?"
|
||||||
|
@confirm="handleDelete(item.id)"
|
||||||
|
okText="确定"
|
||||||
|
cancelText="取消"
|
||||||
|
>
|
||||||
|
<a href="javascript:void(0);">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
<a-list-item-meta :description="item.content">
|
<a-list-item-meta :description="item.content">
|
||||||
<span slot="title">{{ item.createTime | moment }}</span>
|
<span slot="title">{{ item.createTime | moment }}</span>
|
||||||
|
@ -193,6 +200,12 @@ export default {
|
||||||
this.journal = item
|
this.journal = item
|
||||||
this.visible = true
|
this.visible = true
|
||||||
},
|
},
|
||||||
|
handleDelete(id) {
|
||||||
|
journalApi.delete(id).then(response => {
|
||||||
|
this.$message.success('删除成功!')
|
||||||
|
this.loadJournals()
|
||||||
|
})
|
||||||
|
},
|
||||||
createOrUpdateJournal() {
|
createOrUpdateJournal() {
|
||||||
if (this.journal.id) {
|
if (this.journal.id) {
|
||||||
journalApi.update(this.journal.id, this.journal).then(response => {
|
journalApi.update(this.journal.id, this.journal).then(response => {
|
||||||
|
|
Loading…
Reference in New Issue