mirror of https://github.com/halo-dev/halo-admin
新增页面自定义发表时间功能
parent
0b714a948f
commit
2965076601
|
@ -288,6 +288,10 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
pickerDefaultValue() {
|
pickerDefaultValue() {
|
||||||
|
if (this.postToStage.createTime) {
|
||||||
|
var date = new Date(this.postToStage.createTime)
|
||||||
|
return moment(date, 'YYYY-MM-DD HH:mm:ss')
|
||||||
|
}
|
||||||
return moment(new Date(), 'YYYY-MM-DD HH:mm:ss')
|
return moment(new Date(), 'YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -57,6 +57,18 @@
|
||||||
<a-radio :value="true">关闭</a-radio>
|
<a-radio :value="true">关闭</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="发表时间:"
|
||||||
|
>
|
||||||
|
<a-date-picker
|
||||||
|
showTime
|
||||||
|
:defaultValue="pickerDefaultValue"
|
||||||
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
placeholder="Select Publish Time"
|
||||||
|
@change="onChange"
|
||||||
|
@ok="onOk"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item label="自定义模板:">
|
<a-form-item label="自定义模板:">
|
||||||
<a-select v-model="sheetToStage.template">
|
<a-select v-model="sheetToStage.template">
|
||||||
<a-select-option
|
<a-select-option
|
||||||
|
@ -139,6 +151,7 @@ import sheetApi from '@/api/sheet'
|
||||||
import themeApi from '@/api/theme'
|
import themeApi from '@/api/theme'
|
||||||
import optionApi from '@/api/option'
|
import optionApi from '@/api/option'
|
||||||
import attachmentApi from '@/api/attachment'
|
import attachmentApi from '@/api/attachment'
|
||||||
|
import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
mavonEditor,
|
mavonEditor,
|
||||||
|
@ -197,6 +210,15 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
pickerDefaultValue() {
|
||||||
|
if (this.sheetToStage.createTime) {
|
||||||
|
var date = new Date(this.sheetToStage.createTime)
|
||||||
|
return moment(date, 'YYYY-MM-DD HH:mm:ss')
|
||||||
|
}
|
||||||
|
return moment(new Date(), 'YYYY-MM-DD HH:mm:ss')
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadCustomTpls() {
|
loadCustomTpls() {
|
||||||
themeApi.customTpls().then(response => {
|
themeApi.customTpls().then(response => {
|
||||||
|
@ -274,6 +296,12 @@ export default {
|
||||||
this.$message.error('图片上传失败:' + responseObject.message)
|
this.$message.error('图片上传失败:' + responseObject.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
onChange(value, dateString) {
|
||||||
|
this.sheetToStage.createTime = value.valueOf()
|
||||||
|
},
|
||||||
|
onOk(value) {
|
||||||
|
this.sheetToStage.createTime = value.valueOf()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue