mirror of https://github.com/halo-dev/halo-admin
fix: post edit page. (#302)
parent
895bd70192
commit
1bb9a286c5
|
@ -29,12 +29,6 @@
|
||||||
@onSaveDraft="handleSaveDraft(true)"
|
@onSaveDraft="handleSaveDraft(true)"
|
||||||
@onContentChange="onContentChange"
|
@onContentChange="onContentChange"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- <RichTextEditor
|
|
||||||
v-else
|
|
||||||
:originalContent="postToStage.originalContent"
|
|
||||||
@onContentChange="onContentChange"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
@ -59,14 +53,12 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mixin, mixinDevice } from '@/mixins/mixin.js'
|
import { mixin, mixinDevice } from '@/mixins/mixin.js'
|
||||||
// import { mapGetters } from 'vuex'
|
|
||||||
import { datetimeFormat } from '@/utils/datetime'
|
import { datetimeFormat } from '@/utils/datetime'
|
||||||
|
|
||||||
import PostSettingDrawer from './components/PostSettingDrawer'
|
import PostSettingDrawer from './components/PostSettingDrawer'
|
||||||
import AttachmentDrawer from '../attachment/components/AttachmentDrawer'
|
import AttachmentDrawer from '../attachment/components/AttachmentDrawer'
|
||||||
import MarkdownEditor from '@/components/Editor/MarkdownEditor'
|
import MarkdownEditor from '@/components/Editor/MarkdownEditor'
|
||||||
import { PageView } from '@/layouts'
|
import { PageView } from '@/layouts'
|
||||||
// import RichTextEditor from '@/components/editor/RichTextEditor'
|
|
||||||
|
|
||||||
import postApi from '@/api/post'
|
import postApi from '@/api/post'
|
||||||
export default {
|
export default {
|
||||||
|
@ -76,7 +68,6 @@ export default {
|
||||||
AttachmentDrawer,
|
AttachmentDrawer,
|
||||||
MarkdownEditor,
|
MarkdownEditor,
|
||||||
PageView
|
PageView
|
||||||
// RichTextEditor
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -149,22 +140,6 @@ export default {
|
||||||
}
|
}
|
||||||
return '当前页面数据未保存,确定要离开吗?'
|
return '当前页面数据未保存,确定要离开吗?'
|
||||||
}
|
}
|
||||||
// if (!this.postToStage.editorType) {
|
|
||||||
// this.postToStage.editorType = this.options.default_editor
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
temporaryContent(newValue) {
|
|
||||||
if (newValue) {
|
|
||||||
this.contentChanges++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
temporaryContent() {
|
|
||||||
return this.postToStage.originalContent
|
|
||||||
}
|
|
||||||
// ...mapGetters(['options'])
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSaveDraft(draftOnly = false) {
|
handleSaveDraft(draftOnly = false) {
|
||||||
|
@ -269,6 +244,7 @@ export default {
|
||||||
this.contentChanges = 0
|
this.contentChanges = 0
|
||||||
},
|
},
|
||||||
onContentChange(val) {
|
onContentChange(val) {
|
||||||
|
this.contentChanges++
|
||||||
this.postToStage.originalContent = val
|
this.postToStage.originalContent = val
|
||||||
},
|
},
|
||||||
onRefreshPostFromSetting(post) {
|
onRefreshPostFromSetting(post) {
|
||||||
|
|
|
@ -29,12 +29,6 @@
|
||||||
@onSaveDraft="handleSaveDraft(true)"
|
@onSaveDraft="handleSaveDraft(true)"
|
||||||
@onContentChange="onContentChange"
|
@onContentChange="onContentChange"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- <RichTextEditor
|
|
||||||
v-else
|
|
||||||
:originalContent="sheetToStage.originalContent"
|
|
||||||
@onContentChange="onContentChange"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
@ -55,13 +49,11 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mixin, mixinDevice } from '@/mixins/mixin.js'
|
import { mixin, mixinDevice } from '@/mixins/mixin.js'
|
||||||
// import { mapGetters } from 'vuex'
|
|
||||||
import { datetimeFormat } from '@/utils/datetime'
|
import { datetimeFormat } from '@/utils/datetime'
|
||||||
import { PageView } from '@/layouts'
|
import { PageView } from '@/layouts'
|
||||||
import SheetSettingDrawer from './components/SheetSettingDrawer'
|
import SheetSettingDrawer from './components/SheetSettingDrawer'
|
||||||
import AttachmentDrawer from '../attachment/components/AttachmentDrawer'
|
import AttachmentDrawer from '../attachment/components/AttachmentDrawer'
|
||||||
import MarkdownEditor from '@/components/Editor/MarkdownEditor'
|
import MarkdownEditor from '@/components/Editor/MarkdownEditor'
|
||||||
// import RichTextEditor from '@/components/editor/RichTextEditor'
|
|
||||||
|
|
||||||
import sheetApi from '@/api/sheet'
|
import sheetApi from '@/api/sheet'
|
||||||
export default {
|
export default {
|
||||||
|
@ -70,7 +62,6 @@ export default {
|
||||||
AttachmentDrawer,
|
AttachmentDrawer,
|
||||||
SheetSettingDrawer,
|
SheetSettingDrawer,
|
||||||
MarkdownEditor
|
MarkdownEditor
|
||||||
// RichTextEditor
|
|
||||||
},
|
},
|
||||||
mixins: [mixin, mixinDevice],
|
mixins: [mixin, mixinDevice],
|
||||||
data() {
|
data() {
|
||||||
|
@ -140,22 +131,6 @@ export default {
|
||||||
}
|
}
|
||||||
return '当前页面数据未保存,确定要离开吗?'
|
return '当前页面数据未保存,确定要离开吗?'
|
||||||
}
|
}
|
||||||
// if (!this.sheetToStage.editorType) {
|
|
||||||
// this.sheetToStage.editorType = this.options.default_editor
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
temporaryContent(newValue) {
|
|
||||||
if (newValue) {
|
|
||||||
this.contentChanges++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
temporaryContent() {
|
|
||||||
return this.sheetToStage.originalContent
|
|
||||||
}
|
|
||||||
// ...mapGetters(['options'])
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSaveDraft(draftOnly = false) {
|
handleSaveDraft(draftOnly = false) {
|
||||||
|
@ -256,6 +231,7 @@ export default {
|
||||||
this.contentChanges = 0
|
this.contentChanges = 0
|
||||||
},
|
},
|
||||||
onContentChange(val) {
|
onContentChange(val) {
|
||||||
|
this.contentChanges++
|
||||||
this.sheetToStage.originalContent = val
|
this.sheetToStage.originalContent = val
|
||||||
},
|
},
|
||||||
onRefreshSheetFromSetting(sheet) {
|
onRefreshSheetFromSetting(sheet) {
|
||||||
|
|
Loading…
Reference in New Issue