diff --git a/src/api/log.js b/src/api/log.js index 773b045e..4bb38d30 100644 --- a/src/api/log.js +++ b/src/api/log.js @@ -65,6 +65,18 @@ logApi.logType = { PROFILE_UPDATED: { value: 45, text: '资料修改' + }, + SHEET_PUBLISHED: { + value: 50, + text: '页面发布' + }, + SHEET_EDITED: { + value: 50, + text: '页面修改' + }, + SHEET_DELETED: { + value: 50, + text: '页面删除' } } diff --git a/src/api/post.js b/src/api/post.js index 9fee5b9a..73196336 100644 --- a/src/api/post.js +++ b/src/api/post.js @@ -82,4 +82,4 @@ postApi.postStatus = { text: '回收站' } } -export default postApi \ No newline at end of file +export default postApi diff --git a/src/api/sheet.js b/src/api/sheet.js index 80a37eb3..2f436cde 100644 --- a/src/api/sheet.js +++ b/src/api/sheet.js @@ -18,19 +18,25 @@ sheetApi.get = sheetId => { }) } -sheetApi.create = sheetToCreate => { +sheetApi.create = (sheetToCreate, autoSave) => { return service({ url: baseUrl, method: 'post', - data: sheetToCreate + data: sheetToCreate, + params: { + autoSave: autoSave + } }) } -sheetApi.update = (sheetId, sheetToUpdate) => { +sheetApi.update = (sheetId, sheetToUpdate, autoSave) => { return service({ url: `${baseUrl}/${sheetId}`, method: 'put', - data: sheetToUpdate + data: sheetToUpdate, + params: { + autoSave: autoSave + } }) } diff --git a/src/views/sheet/SheetEdit.vue b/src/views/sheet/SheetEdit.vue index e8ed2977..6276480c 100644 --- a/src/views/sheet/SheetEdit.vue +++ b/src/views/sheet/SheetEdit.vue @@ -216,16 +216,16 @@ export default { handlerRemoveThumb() { this.sheetToStage.thumbnail = null }, - createOrUpdateSheet(createSuccess, updateSuccess) { + createOrUpdateSheet(createSuccess, updateSuccess, autoSave) { if (this.sheetToStage.id) { - sheetApi.update(this.sheetToStage.id, this.sheetToStage).then(response => { + sheetApi.update(this.sheetToStage.id, this.sheetToStage, autoSave).then(response => { this.$log.debug('Updated sheet', response.data.data) if (updateSuccess) { updateSuccess() } }) } else { - sheetApi.create(this.sheetToStage).then(response => { + sheetApi.create(this.sheetToStage, autoSave).then(response => { this.$log.debug('Created sheet', response.data.data) if (createSuccess) { createSuccess() @@ -235,11 +235,15 @@ export default { } }, saveSheet() { - this.createOrUpdateSheet(() => this.$message.success('页面创建成功'), () => this.$message.success('页面更新成功')) + this.createOrUpdateSheet( + () => this.$message.success('页面创建成功'), + () => this.$message.success('页面更新成功'), + false + ) }, autoSaveSheet() { if (this.sheetToStage.title != null && this.sheetToStage.originalContent != null) { - this.createOrUpdateSheet() + this.createOrUpdateSheet(null, null, true) } }, handleSelectSheetThumb(data) {