From 65b7669bf5dac95f2d33f1ad401c0862d8518d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89?= <814457906@qq.com> Date: Fri, 24 May 2024 11:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/manage/components/wangEditor.vue | 25 +++++++++++++------ src/views/manage/labelfieldcontent/index.vue | 4 +-- src/views/system/components/wangEditor.vue | 26 ++++++++++++++------ 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/src/views/manage/components/wangEditor.vue b/src/views/manage/components/wangEditor.vue index c28168e..9d5cc64 100644 --- a/src/views/manage/components/wangEditor.vue +++ b/src/views/manage/components/wangEditor.vue @@ -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 = ` ${fileName} @@ -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 = ` ${fileName} @@ -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 ,其中有一个空字符串,重要!!! } diff --git a/src/views/manage/labelfieldcontent/index.vue b/src/views/manage/labelfieldcontent/index.vue index 634d3e0..8e0060d 100644 --- a/src/views/manage/labelfieldcontent/index.vue +++ b/src/views/manage/labelfieldcontent/index.vue @@ -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 }, ], diff --git a/src/views/system/components/wangEditor.vue b/src/views/system/components/wangEditor.vue index 267d442..526e515 100644 --- a/src/views/system/components/wangEditor.vue +++ b/src/views/system/components/wangEditor.vue @@ -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 = ` ${fileName} @@ -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 = ` ${fileName} @@ -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