diff --git a/src/views/post/PostEdit.vue b/src/views/post/PostEdit.vue
index 0a718181f..e6c991827 100644
--- a/src/views/post/PostEdit.vue
+++ b/src/views/post/PostEdit.vue
@@ -27,11 +27,13 @@
@@ -173,6 +175,12 @@ export default {
},
onRefreshPostFromSetting(post) {
this.postToStage = post
+ },
+ onRefreshTagIdsFromSetting(tagIds) {
+ this.selectedTagIds = tagIds
+ },
+ onRefreshCategoryIdsFromSetting(categoryIds) {
+ this.selectedCategoryIds = categoryIds
}
}
}
diff --git a/src/views/post/PostList.vue b/src/views/post/PostList.vue
index b9ce8d33a..7f61c9581 100644
--- a/src/views/post/PostList.vue
+++ b/src/views/post/PostList.vue
@@ -259,8 +259,8 @@
@@ -502,6 +504,12 @@ export default {
},
onRefreshPostFromSetting(post) {
this.selectedPost = post
+ },
+ onRefreshTagIdsFromSetting(tagIds) {
+ this.selectedTagIds = tagIds
+ },
+ onRefreshCategoryIdsFromSetting(categoryIds) {
+ this.selectedCategoryIds = categoryIds
}
}
}
diff --git a/src/views/post/components/PostSetting.vue b/src/views/post/components/PostSetting.vue
index 3320e39a7..5dcd676a9 100644
--- a/src/views/post/components/PostSetting.vue
+++ b/src/views/post/components/PostSetting.vue
@@ -17,13 +17,13 @@
label="文章标题:"
v-if="needTitle"
>
-
+
-
+
@@ -38,7 +38,7 @@
开启
@@ -121,7 +121,7 @@
@@ -136,7 +136,7 @@
![]()
this.thumDrawerVisible=true"
>
{
@@ -286,11 +309,11 @@ export default {
this.categoryFormVisible = !this.categoryFormVisible
},
handleDraftClick() {
- this.post.status = 'DRAFT'
+ this.selectedPost.status = 'DRAFT'
this.savePost()
},
handlePublishClick() {
- this.post.status = 'PUBLISHED'
+ this.selectedPost.status = 'PUBLISHED'
this.savePost()
},
savePost() {
@@ -302,13 +325,13 @@ export default {
},
createOrUpdatePost(createSuccess, updateSuccess, autoSave) {
// Set category ids
- this.post.categoryIds = this.selectedCategoryIds
+ this.selectedPost.categoryIds = this.selectedCategoryIds
// Set tag ids
- this.post.tagIds = this.selectedTagIds
+ this.selectedPost.tagIds = this.selectedTagIds
- if (this.post.id) {
+ if (this.selectedPost.id) {
// Update the post
- postApi.update(this.post.id, this.post, autoSave).then(response => {
+ postApi.update(this.selectedPost.id, this.selectedPost, autoSave).then(response => {
this.$log.debug('Updated post', response.data.data)
if (updateSuccess) {
updateSuccess()
@@ -316,24 +339,23 @@ export default {
})
} else {
// Create the post
- postApi.create(this.post, autoSave).then(response => {
+ postApi.create(this.selectedPost, autoSave).then(response => {
this.$log.debug('Created post', response.data.data)
if (createSuccess) {
createSuccess()
}
- this.post = response.data.data
+ this.selectedPost = response.data.data
})
}
- this.$emit('onRefreshPost', this.post)
},
onClose() {
this.$emit('close', false)
},
onPostDateChange(value, dateString) {
- this.post.createTime = value.valueOf()
+ this.selectedPost.createTime = value.valueOf()
},
onPostDateOk(value) {
- this.post.createTime = value.valueOf()
+ this.selectedPost.createTime = value.valueOf()
}
}
}