Show absolute post/sheet path in create page.

pull/9/head
ruibaby 6 years ago
parent 4713436d03
commit 6328530fcd

@ -38,7 +38,7 @@
<a-form layout="vertical">
<a-form-item
label="文章路径:"
:help="'/archives/' + (postToStage.url ? postToStage.url : '{auto_generate}')"
:help="options.blog_url+'/archives/' + (postToStage.url ? postToStage.url : '{auto_generate}')"
>
<a-input v-model="postToStage.url" />
</a-form-item>
@ -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

@ -42,7 +42,7 @@
<a-form layout="vertical">
<a-form-item
label="页面路径:"
:help="'https://localhost:8090/s/'+ (sheetToStage.url ? sheetToStage.url : '{auto_generate}')"
:help="options.blog_url+'/s/'+ (sheetToStage.url ? sheetToStage.url : '{auto_generate}')"
>
<a-input v-model="sheetToStage.url" />
</a-form-item>
@ -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()

Loading…
Cancel
Save