mirror of https://github.com/halo-dev/halo-admin
feat: support post custom template.
parent
0e208e9888
commit
bd682745bc
|
@ -25,9 +25,16 @@ themeApi.listFiles = themeId => {
|
|||
})
|
||||
}
|
||||
|
||||
themeApi.customTpls = () => {
|
||||
themeApi.customSheetTpls = () => {
|
||||
return service({
|
||||
url: `${baseUrl}/files/custom`,
|
||||
url: `${baseUrl}/activation/template/custom/sheet`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
themeApi.customPostTpls = () => {
|
||||
return service({
|
||||
url: `${baseUrl}/activation/template/custom/post`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -65,6 +65,19 @@
|
|||
<a-radio :value="0">否</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="自定义模板:">
|
||||
<a-select v-model="selectedPost.template">
|
||||
<a-select-option
|
||||
key=""
|
||||
value=""
|
||||
>无</a-select-option>
|
||||
<a-select-option
|
||||
v-for="tpl in customTpls"
|
||||
:key="tpl"
|
||||
:value="tpl"
|
||||
>{{ tpl }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -258,7 +271,8 @@ export default {
|
|||
selectedTagIds: this.tagIds,
|
||||
selectedCategoryIds: this.categoryIds,
|
||||
categories: [],
|
||||
categoryToCreate: {}
|
||||
categoryToCreate: {},
|
||||
customTpls: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
@ -331,6 +345,7 @@ export default {
|
|||
this.loadSkeleton()
|
||||
this.loadCategories()
|
||||
this.loadPresetMetasField()
|
||||
this.loadCustomTpls()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -376,6 +391,11 @@ export default {
|
|||
})
|
||||
}
|
||||
},
|
||||
loadCustomTpls() {
|
||||
themeApi.customPostTpls().then(response => {
|
||||
this.customTpls = response.data.data
|
||||
})
|
||||
},
|
||||
handleSelectPostThumb(data) {
|
||||
this.selectedPost.thumbnail = encodeURI(data.path)
|
||||
this.thumbDrawerVisible = false
|
||||
|
|
|
@ -237,7 +237,7 @@ export default {
|
|||
}
|
||||
},
|
||||
loadCustomTpls() {
|
||||
themeApi.customTpls().then(response => {
|
||||
themeApi.customSheetTpls().then(response => {
|
||||
this.customTpls = response.data.data
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue