Support stick post.

pull/40/head
ruibaby 2019-08-30 20:58:22 +08:00
parent a8ade50451
commit 5d654db0c9
8 changed files with 31 additions and 14 deletions

View File

@ -19,6 +19,7 @@
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"verte": "^0.0.12", "verte": "^0.0.12",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-clipboard2": "^0.3.0",
"vue-codemirror-lite": "^1.0.4", "vue-codemirror-lite": "^1.0.4",
"vue-count-to": "^1.0.13", "vue-count-to": "^1.0.13",
"vue-ls": "^3.2.1", "vue-ls": "^3.2.1",

View File

@ -1,13 +1,21 @@
<template> <template>
<a-locale-provider :locale="locale">
<div id="app"> <div id="app">
<router-view /> <router-view />
</div> </div>
</a-locale-provider>
</template> </template>
<script> <script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import { deviceEnquire, DEVICE_TYPE } from '@/utils/device' import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
export default { export default {
data() {
return {
locale: zhCN
}
},
mounted() { mounted() {
const { $store } = this const { $store } = this
deviceEnquire(deviceType => { deviceEnquire(deviceType => {
@ -36,3 +44,4 @@ export default {
height: 100%; height: 100%;
} }
</style> </style>

View File

@ -7,6 +7,9 @@ import '@/core/lazy_lib/components_use'
import 'ant-design-vue/dist/antd.less' import 'ant-design-vue/dist/antd.less'
import bootstrap from './bootstrap' import bootstrap from './bootstrap'
import VueClipboard from 'vue-clipboard2'
Vue.use(VueStorage, config.storageOptions) Vue.use(VueStorage, config.storageOptions)
Vue.use(VueClipboard)
bootstrap() bootstrap()

View File

@ -6,6 +6,9 @@ import config from '@/config/defaultSettings'
import Antd from 'ant-design-vue' import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.less' import 'ant-design-vue/dist/antd.less'
import VueClipboard from 'vue-clipboard2'
Vue.use(Antd) Vue.use(Antd)
Vue.use(VueStorage, config.storageOptions) Vue.use(VueStorage, config.storageOptions)
Vue.use(VueClipboard)

View File

@ -112,7 +112,7 @@ export default {
handleSaveDraft() { handleSaveDraft() {
this.postToStage.status = 'DRAFT' this.postToStage.status = 'DRAFT'
if (!this.postToStage.title) { if (!this.postToStage.title) {
this.postToStage.title = moment(new Date()) this.postToStage.title = moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')
} }
if (!this.postToStage.originalContent) { if (!this.postToStage.originalContent) {
this.postToStage.originalContent = '开始编辑...' this.postToStage.originalContent = '开始编辑...'

View File

@ -128,20 +128,12 @@
:loading="postsLoading" :loading="postsLoading"
:pagination="false" :pagination="false"
> >
<!-- ellipsis内嵌a标签后文本会被置空
<ellipsis
:length="25"
tooltip
slot="postTitle"
slot-scope="text,record"
>
{{ text }}
</ellipsis> -->
<span <span
slot="postTitle" slot="postTitle"
slot-scope="text,record" slot-scope="text,record"
style="max-width: 150px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" style="max-width: 150px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
> >
<a-icon type="pushpin" v-if="record.topPriority!=0" theme="twoTone" twoToneColor="red" />
<a <a
:href="options.blog_url+'/archives/'+record.url" :href="options.blog_url+'/archives/'+record.url"
target="_blank" target="_blank"

View File

@ -50,6 +50,15 @@
<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-radio-group
v-model="selectedPost.topPriority"
:defaultValue="0"
>
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-form> </a-form>
</div> </div>
</div> </div>

View File

@ -102,7 +102,7 @@ export default {
handleSaveDraft() { handleSaveDraft() {
this.sheetToStage.status = 'DRAFT' this.sheetToStage.status = 'DRAFT'
if (!this.sheetToStage.title) { if (!this.sheetToStage.title) {
this.sheetToStage.title = moment(new Date()) this.sheetToStage.title = moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')
} }
if (!this.sheetToStage.originalContent) { if (!this.sheetToStage.originalContent) {
this.sheetToStage.originalContent = '开始编辑...' this.sheetToStage.originalContent = '开始编辑...'