From 6328530fcd9b43347c09a3518ed8fa665d4b2c4e Mon Sep 17 00:00:00 2001 From: ruibaby Date: Fri, 10 May 2019 23:55:46 +0800 Subject: [PATCH] Show absolute post/sheet path in create page. --- src/views/post/PostEdit.vue | 13 +++++++++++-- src/views/sheet/SheetEdit.vue | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/views/post/PostEdit.vue b/src/views/post/PostEdit.vue index 56081b736..8aab3a21c 100644 --- a/src/views/post/PostEdit.vue +++ b/src/views/post/PostEdit.vue @@ -38,7 +38,7 @@ @@ -202,6 +202,7 @@ import 'mavon-editor/dist/css/index.css' import tagApi from '@/api/tag' import categoryApi from '@/api/category' import postApi from '@/api/post' +import optionApi from '@/api/option' export default { components: { TagSelect, @@ -231,12 +232,15 @@ export default { selectedTagIds: [], postToStage: {}, categoryToCreate: {}, - timer: null + timer: null, + options: [], + keys: ['blog_url'] } }, created() { this.loadTags() this.loadCategories() + this.loadOptions() clearInterval(this.timer) this.timer = null this.autoSaveTimer() @@ -279,6 +283,11 @@ export default { this.categories = response.data.data }) }, + loadOptions() { + optionApi.listAll(this.keys).then(response => { + this.options = response.data.data + }) + }, createOrUpdatePost(createSuccess, updateSuccess) { // Set category ids this.postToStage.categoryIds = this.selectedCategoryIds diff --git a/src/views/sheet/SheetEdit.vue b/src/views/sheet/SheetEdit.vue index ef8d4f973..e8ed29777 100644 --- a/src/views/sheet/SheetEdit.vue +++ b/src/views/sheet/SheetEdit.vue @@ -42,7 +42,7 @@ @@ -135,6 +135,7 @@ import { toolbars } from '@/core/const' import 'mavon-editor/dist/css/index.css' import sheetApi from '@/api/sheet' import themeApi from '@/api/theme' +import optionApi from '@/api/option' export default { components: { mavonEditor, @@ -156,11 +157,14 @@ export default { sheetSettingVisible: false, customTpls: [], sheetToStage: {}, - timer: null + timer: null, + options: [], + keys: ['blog_url'] } }, created() { this.loadCustomTpls() + this.loadOptions() clearInterval(this.timer) this.timer = null this.autoSaveTimer() @@ -196,6 +200,11 @@ export default { this.customTpls = response.data.data }) }, + loadOptions() { + optionApi.listAll(this.keys).then(response => { + this.options = response.data.data + }) + }, handlePublishClick() { this.sheetToStage.status = 'PUBLISHED' this.saveSheet()