Skip to content

Commit

Permalink
feat: release 6.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Jul 14, 2023
1 parent 6cbed97 commit 3272979
Show file tree
Hide file tree
Showing 66 changed files with 274 additions and 134 deletions.
2 changes: 1 addition & 1 deletion app/Constant/AppConstant.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ class AppConstant
{
const APP = 'cms';
const APP_NAME = 'ModStartCMS';
const VERSION = '6.7.0';
const VERSION = '6.8.0';
}
126 changes: 68 additions & 58 deletions module/Vendor/resources/asset/src/components/RichEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,82 @@
</template>

<script>
import {FieldInputMixin, FieldVModel} from "@ModStartAsset/svue/lib/fields-config";
import {StrUtil} from "@ModStartAsset//svue/lib/util"
import {FieldInputMixin, FieldVModel} from "@ModStartAsset/svue/lib/fields-config";
import {StrUtil} from "@ModStartAsset/svue/lib/util"
export default {
name: "RichEditor",
mixins: [FieldInputMixin, FieldVModel],
data() {
return {
id: null,
editor: null,
ignoreChange: false,
}
},
watch: {
data: {
handler(n, o) {
// console.log('data.change', this.ignoreChange, n)
if (this.ignoreChange) {
this.ignoreChange = false
return
}
this.setContent(n)
this.currentData = n
},
immediate: true,
export default {
name: "RichEditor",
mixins: [FieldInputMixin, FieldVModel],
props: {
editorOption: {
type: Object,
default: () => {
return {}
},
},
mounted() {
this.id = StrUtil.randomString()
$(this.$refs.editor).attr('id', this.id)
this.$nextTick(() => {
this.editor = window.api.editor.basic(this.id, {
ready: () => {
// console.log('editor.ready', this.editor)
//TODO 该段代码会导致插入图片时不能插入正确的位置
// $(this.editor.container).click((e) => {
// e.stopPropagation()
// this.editor.setContent(this.currentData)
//})
},
},{
zIndex: 10000,
})
this.editor.on('contentchange', () => {
this.currentData = this.editor.getContent()
this.ignoreChange = true
})
})
},
methods: {
setContent(content) {
if (!this.editor || !this.editor.body) {
setTimeout(() => {
this.setContent(content)
}, 100)
},
data() {
return {
id: null,
editor: null,
editorReady: false,
ignoreChangedContent: null,
}
},
watch: {
data: {
handler(n, o) {
if (this.ignoreChangedContent && this.ignoreChangedContent === n) {
this.ignoreChangedContent = null
return
}
// console.log('editor.setContent', content)
this.setContent(n)
},
immediate: true,
},
},
mounted() {
this.id = StrUtil.randomString()
$(this.$refs.editor).attr('id', this.id)
this.$nextTick(() => {
this.editor = MS.editor.basic(this.id, {
ready: () => {
this.editorReady = true;
// console.log('editor.ready', this.editor)
//TODO 该段代码会导致插入图片时不能插入正确的位置
// $(this.editor.container).click((e) => {
// e.stopPropagation()
// this.editor.setContent(this.currentData)
//})
},
}, Object.assign({
zIndex: 10000,
}, this.editorOption))
this.editor.on('contentchange', () => {
// console.log('xxx','contentchange');
const content = this.editor.getContent()
this.currentData = content
this.ignoreChangedContent = content
})
})
},
beforeDestroy() {
if (this.editor) {
this.editor.destroy()
this.editor = null
}
},
methods: {
setContent(content) {
if (!this.editorReady) {
setTimeout(() => {
this.editor.setContent(content)
this.setContent(content)
}, 100)
return
}
// console.log('editor.setContent', content)
this.editor.setContent(content)
}
}
}
</script>

<style scoped>
</style>
2 changes: 1 addition & 1 deletion public/asset/common/admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/asset/common/base.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/asset/common/clipboard.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/asset/common/commonVerify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3272979

Please sign in to comment.