修改问题知识库的富文本粘贴图片

This commit is contained in:
sunFlower
2022-09-16 09:31:13 +08:00
parent ea74da2a7f
commit 72c1726824
@@ -227,10 +227,9 @@
data() {
return {
formInline: {},
loading: false,
headers: '',
uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload',
loading: false,
problemTypeList: [],
editorOption: { // 富文本框配置
placeholder: '',
theme: 'snow', // or 'bubble'
@@ -253,6 +252,7 @@
}
}
},
problemTypeList: [],
rules: {
showPermissions: [
{
@@ -308,6 +308,7 @@
},
isDisplay: false,
disabled: false,
content: '<h2>I am Example</h2>'
projectNameList: [
{
value: 'Open',
@@ -318,26 +319,19 @@
name: this.$t('Privacy')
}
],
content: '<h2>I am Example</h2>'
}
},
created() {
const token = Vue.ls.get(ACCESS_TOKEN)
this.headers = { 'X-Access-Token': token }
},
computed: {
editor() {
return this.$refs.myQuillEditor.quill
}
},
created() {
const token = Vue.ls.get(ACCESS_TOKEN)
this.headers = { 'X-Access-Token': token }
},
mounted() {
this.getBase()
if (this.$route.query.id) {
this.queryById()
document.title = this.$t('problemKnowledgeBase') + this.$t('edit')
} else {
document.title = this.$t('problemKnowledgeBase') + this.$t('newlyAdded')
}
let quill = this.$refs.myQuillEditor.quill
this.$forceUpdate()
quill.root.addEventListener(
@@ -381,11 +375,14 @@
},
false
)
if (this.$route.query.id) {
this.queryById()
document.title = this.$t('problemKnowledgeBase') + this.$t('edit')
} else {
document.title = this.$t('problemKnowledgeBase') + this.$t('newlyAdded')
}
},
methods: {
quilleditorBlur() {
this.$refs.ruleForm.validateField('content')
},
handleCustomMatcher(node, Delta) {
let ops = []
Delta.ops.forEach(op => {
@@ -398,6 +395,9 @@
Delta.ops = ops
return Delta
},
quilleditorBlur() {
this.$refs.ruleForm.validateField('content')
},
getBase() {
getAction('/problemKnowledgeBase/problemKnowledgeBaseClassifyEO/list', {}).then((res) => {
if (res.success) {
@@ -460,39 +460,28 @@
,
onEditorFocus(quill) {
console.log('editor focus!', quill)
}
,
},
onEditorReady(quill) {
console.log('editor ready!', quill)
}
,
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
onEditorChange({ quill, html, text }) {
console.log(html)
console.log(quill)
console.log(text)
this.formInline.content = html
}
,
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
}
,
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
}
,
},
bringInDocumentInformationClick() {
this.$refs.listAddModelRef.addModel(this.formInline)
}
,
listAddModelForm(id, number) {
this.formInline.standNumber = number
this.formInline.bussDocumentLibraryId = id
this.formInline = { ...this.formInline }
},
handleChange(info) {
let { file } = info
@@ -512,6 +501,11 @@
}
},
listAddModelForm(id, number) {
this.formInline.standNumber = number
this.formInline.bussDocumentLibraryId = id
this.formInline = { ...this.formInline }
},
clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true