This commit is contained in:
2024-05-24 11:03:42 +08:00
parent ce89cd4052
commit 65b7669bf5
3 changed files with 39 additions and 16 deletions

View File

@ -89,6 +89,7 @@ export default ({
addnode: {
fileName: '',
fileSpan: '',
fieldMark: "",
},
modify: false,
}
@ -107,6 +108,7 @@ export default ({
if (el.labelFieldId == item[1]) {
this.addnode.fileSpan = el.fieldName
this.addnode.fileName = e.fieldName
this.addnode.fieldMark = el.fieldMark
}
})
})
@ -116,6 +118,7 @@ export default ({
if (el.labelFieldId == item[1]) {
this.addnode.fileSpan = el.fieldName
this.addnode.fileName = e.fieldName
this.addnode.fieldMark = el.fieldMark
}
})
})
@ -135,6 +138,7 @@ export default ({
type: 'attachment',
link: '',
fileName: this.addnode.fileName,
fieldMark: this.addnode.fieldMark,
fileSpan: this.addnode.fileSpan,
children: [{ text: '' }], // void children
}
@ -142,6 +146,7 @@ export default ({
this.addnode = {
fileName: '',
fileSpan: '',
fieldMark: "",
}
this.editor.focus()
}, 100);
@ -160,6 +165,7 @@ export default ({
type: 'attachmenttwo',
link: '',
fileName: this.addnode.fileName,
fieldMark: this.addnode.fieldMark,
fileSpan: this.addnode.fileSpan,
children: [{ text: '' }], // void children
}
@ -167,6 +173,7 @@ export default ({
this.addnode = {
fileName: '',
fileSpan: '',
fieldMark: "",
}
this.editor.focus()
}, 100);
@ -206,9 +213,7 @@ export default ({
},
watch: {
nodeContent(newValue, oldValue) {
if (newValue) {
this.html = newValue;
}
this.html = newValue;
}
},
mounted() {
@ -311,7 +316,7 @@ function withAttachment(editor) { // JS 语法
Boot.registerPlugin(withAttachment)
function renderAttachment(elem, children, editor) { // JS
// myResume
const { fileName = '', link = '', fileSpan = '' } = elem
const { fileName = '', link = '', fileSpan = '', fieldMark = '' } = elem
// icon vnode
const iconVnode = h(
// HTML tag
@ -387,7 +392,7 @@ function renderAttachment(elem, children, editor) {
}
function renderAttachmenttwo(elem, children, editor) { // JS
// myResume
const { fileName = '', link = '', fileSpan = '' } = elem
const { fileName = '', link = '', fileSpan = '', fieldMark = '' } = elem
// icon vnode
const iconVnode = h(
// HTML tag
@ -480,13 +485,14 @@ const rendermodule = { // JS 语法
Boot.registerModule(rendermodule)
function attachmentToHtml(elem, childrenHtml) { // JS
//
const { link = '', fileName = '', fileSpan = '' } = elem
const { link = '', fileName = '', fileSpan = '', fieldMark = '' } = elem
// HTML
const html = `<span data-w-e-type="attachment"
data-w-e-is-void
data-w-e-is-inline
data-link="${link}"
data-fileSpan="${fileSpan}"
data-fieldMark="${fieldMark}"
data-fileName="${fileName}">
<span class="path-tag-wrap">
<span>${fileName}</span>
@ -497,13 +503,14 @@ function attachmentToHtml(elem, childrenHtml) { // JS 语法
}
function attachmentToHtmltwo(elem, childrenHtml) { // JS
//
const { link = '', fileName = '', fileSpan = '' } = elem
const { link = '', fileName = '', fileSpan = '', fieldMark = '' } = elem
// HTML
const html = `<span data-w-e-type="attachmenttwo"
data-w-e-is-void
data-w-e-is-inline
data-link="${link}"
data-fileSpan="${fileSpan}"
data-fieldMark="${fieldMark}"
data-fileName="${fileName}">
<span class="path-tag-wrap">
<span>${fileName}</span>
@ -529,12 +536,14 @@ function parseAttachmentHtml(domElem, children, editor) {
const link = domElem.getAttribute('data-link') || ''
const fileName = domElem.getAttribute('data-fileName') || ''
const fileSpan = domElem.getAttribute('data-fileSpan') || ''
const fieldMark = domElem.getAttribute('data-fieldMark') || ''
//
const myResume = {
type: 'attachment',
link,
fileName,
fileSpan,
fieldMark,
children: [{ text: '' }], // void node children
}
return myResume
@ -544,11 +553,13 @@ function parseAttachmentHtmltwo(domElem, children, editor) {
const link = domElem.getAttribute('data-link') || ''
const fileName = domElem.getAttribute('data-fileName') || ''
const fileSpan = domElem.getAttribute('data-fileSpan') || ''
const fieldMark = domElem.getAttribute('data-fieldMark') || ''
//
const myResume = {
type: 'attachmenttwo',
link,
fileName,
fieldMark,
fileSpan,
children: [{ text: '' }], // void node children
}

View File

@ -442,7 +442,7 @@ export default {
required: true,
trigger: "blur",
validator: validateInput
// validator: validateInput
},
// { pattern:/^$W*$/, message: '$', trigger: 'blur' }
],
@ -479,7 +479,7 @@ export default {
required: true,
// message: "",
trigger: "blur",
validator: validateInput
// validator: validateInput
},
],

View File

@ -89,6 +89,7 @@ export default ({
addnode: {
fileName: '',
fileSpan: '',
fieldMark: "",
},
modify: false,
}
@ -104,6 +105,7 @@ export default ({
if (el.labelFieldId == item[1]) {
this.addnode.fileSpan = el.fieldName
this.addnode.fileName = e.fieldName
this.addnode.fieldMark = el.fieldMark
}
})
})
@ -113,6 +115,7 @@ export default ({
if (el.labelFieldId == item[1]) {
this.addnode.fileSpan = el.fieldName
this.addnode.fileName = e.fieldName
this.addnode.fieldMark = el.fieldMark
}
})
})
@ -133,12 +136,14 @@ export default ({
link: '',
fileName: this.addnode.fileName,
fileSpan: this.addnode.fileSpan,
fieldMark: this.addnode.fieldMark,
children: [{ text: '' }], // void children
}
this.editor.insertNode(resume)
this.addnode = {
fileName: '',
fileSpan: '',
fieldMark: '',
}
this.editor.focus()
}, 100);
@ -158,11 +163,13 @@ export default ({
link: '',
fileName: this.addnode.fileName,
fileSpan: this.addnode.fileSpan,
fieldMark: this.addnode.fieldMark,
children: [{ text: '' }], // void children
}
this.editor.insertNode(resume)
this.addnode = {
fileName: '',
fieldMark: '',
fileSpan: '',
}
this.editor.focus()
@ -205,9 +212,8 @@ export default ({
},
watch: {
nodeContent(newValue, oldValue) {
if (newValue) {
this.html = newValue;
}
console.log(newValue, oldValue)
this.html = newValue;
}
},
mounted() {
@ -310,7 +316,7 @@ function withAttachment(editor) { // JS 语法
Boot.registerPlugin(withAttachment)
function renderAttachment(elem, children, editor) { // JS
// myResume
const { fileName = '', link = '', fileSpan = '' } = elem
const { fileName = '', link = '', fileSpan = '', fieldMark } = elem
// icon vnode
const iconVnode = h(
// HTML tag
@ -386,7 +392,7 @@ function renderAttachment(elem, children, editor) {
}
function renderAttachmenttwo(elem, children, editor) { // JS
// myResume
const { fileName = '', link = '', fileSpan = '' } = elem
const { fileName = '', link = '', fileSpan = '', fieldMark = '' } = elem
// icon vnode
const iconVnode = h(
// HTML tag
@ -479,13 +485,14 @@ const rendermodule = { // JS 语法
Boot.registerModule(rendermodule)
function attachmentToHtml(elem, childrenHtml) { // JS
//
const { link = '', fileName = '', fileSpan = '' } = elem
const { link = '', fileName = '', fileSpan = '', fieldMark = '' } = elem
// HTML
const html = `<span data-w-e-type="attachment"
data-w-e-is-void
data-w-e-is-inline
data-link="${link}"
data-fileSpan="${fileSpan}"
data-fieldMark="${fieldMark}"
data-fileName="${fileName}">
<span class="path-tag-wrap">
<span>${fileName}</span>
@ -496,13 +503,14 @@ function attachmentToHtml(elem, childrenHtml) { // JS 语法
}
function attachmentToHtmltwo(elem, childrenHtml) { // JS
//
const { link = '', fileName = '', fileSpan = '' } = elem
const { link = '', fileName = '', fileSpan = '', fieldMark = '' } = elem
// HTML
const html = `<span data-w-e-type="attachmenttwo"
data-w-e-is-void
data-w-e-is-inline
data-link="${link}"
data-fileSpan="${fileSpan}"
data-fieldMark="${fieldMark}"
data-fileName="${fileName}">
<span class="path-tag-wrap">
<span>${fileName}</span>
@ -528,12 +536,14 @@ function parseAttachmentHtml(domElem, children, editor) {
const link = domElem.getAttribute('data-link') || ''
const fileName = domElem.getAttribute('data-fileName') || ''
const fileSpan = domElem.getAttribute('data-fileSpan') || ''
const fieldMark = domElem.getAttribute('data-fieldMark') || ''
//
const myResume = {
type: 'attachment',
link,
fileName,
fileSpan,
fieldMark,
children: [{ text: '' }], // void node children
}
return myResume
@ -543,12 +553,14 @@ function parseAttachmentHtmltwo(domElem, children, editor) {
const link = domElem.getAttribute('data-link') || ''
const fileName = domElem.getAttribute('data-fileName') || ''
const fileSpan = domElem.getAttribute('data-fileSpan') || ''
const fieldMark = domElem.getAttribute('data-fieldMark') || ''
//
const myResume = {
type: 'attachmenttwo',
link,
fileName,
fileSpan,
fieldMark,
children: [{ text: '' }], // void node children
}
return myResume