修改
This commit is contained in:
parent
4dc9184867
commit
3561f70b13
@ -1,4 +1,5 @@
|
||||
<template> <div style="border: 1px solid #ccc">
|
||||
<template>
|
||||
<div style="border: 1px solid #ccc">
|
||||
<Toolbar
|
||||
style="border-bottom: 1px solid #ccc"
|
||||
:editor="editor"
|
||||
@ -51,8 +52,6 @@
|
||||
:before-close="beforeClose"
|
||||
class="category-cascader-panel"
|
||||
>
|
||||
|
||||
|
||||
<!-- 在这里 -->
|
||||
<el-cascader-panel
|
||||
:options="fieldoptions"
|
||||
@ -61,19 +60,18 @@
|
||||
value: 'termCode',
|
||||
label: 'termContent',
|
||||
children: 'children',
|
||||
checkStrictly: true,
|
||||
checkStrictly: false,
|
||||
multiple: true,
|
||||
emitPath: false,
|
||||
}"
|
||||
ref="cascaderAddr"
|
||||
>
|
||||
</el-cascader-panel>
|
||||
|
||||
<div style="margin: 20px 0">结果预览:</div>
|
||||
<div style="width: 80%;height: 100%; border: 2px solid #ECEFF7 ;">
|
||||
<div v-for="(item, index) of add" :key="index" >
|
||||
<div style="width: 80%; height: 100%; border: 2px solid #eceff7">
|
||||
<div v-for="(item, index) of add" :key="index">
|
||||
<!-- <input type="text"> -->
|
||||
<div >{{ item }}</div>
|
||||
<div>{{ item }}</div>
|
||||
<!-- <el-input
|
||||
type="textarea"
|
||||
v-model="item[0]"
|
||||
@ -85,36 +83,36 @@
|
||||
<el-button @click="fieldclick" type="primary">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
DomEditor,
|
||||
IDomEditor,
|
||||
SlateElement,
|
||||
SlateDescendant,
|
||||
SlateTransforms,
|
||||
SlateEditor,
|
||||
SlateNode,
|
||||
DomEditor,
|
||||
IDomEditor,
|
||||
SlateElement,
|
||||
SlateDescendant,
|
||||
SlateTransforms,
|
||||
SlateEditor,
|
||||
SlateNode,
|
||||
} from "@wangeditor/editor";
|
||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
||||
import { Boot } from "@wangeditor/editor";
|
||||
import { h, VNode } from "snabbdom";
|
||||
import {
|
||||
labelFieldList,
|
||||
richTextPictureUrl,
|
||||
bankLevel,
|
||||
labelFieldList,
|
||||
richTextPictureUrl,
|
||||
bankLevel,
|
||||
} from "@/api/system/wangEditor.js";
|
||||
// import menuConf from "./ModalMenu";
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
var that;
|
||||
export default {
|
||||
props: ["nodeContent"],
|
||||
components: { Editor, Toolbar },
|
||||
name: "wangEditor",
|
||||
data() {
|
||||
props: ["nodeContent"],
|
||||
components: { Editor, Toolbar },
|
||||
name: "wangEditor",
|
||||
data() {
|
||||
return {
|
||||
isResouceShow: 1,
|
||||
searchForm: {},
|
||||
@ -183,9 +181,9 @@ data() {
|
||||
elist: [],
|
||||
termContent: "",
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
methods: {
|
||||
handleChange(e) {
|
||||
console.log(e, "e");
|
||||
this.add = [];
|
||||
@ -200,7 +198,6 @@ methods: {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
async handleUpload(file, insertFn) {
|
||||
@ -212,8 +209,7 @@ methods: {
|
||||
this.html +=
|
||||
'<video poster="" controls="true" width="auto" height="auto"><source src="' +
|
||||
process.env.VUE_APP_BASE_API +
|
||||
+
|
||||
'" type="video/mp4"/></video>';
|
||||
+'" type="video/mp4"/></video>';
|
||||
},
|
||||
async uploadFile(form) {
|
||||
let res = await richTextPictureUrl(form); //此处换为自己的上传接口地址
|
||||
@ -268,16 +264,16 @@ methods: {
|
||||
fieldclick() {
|
||||
// 先判断 富文本里有没有这个名字叫divBox的标签 有的话用原生js给他删掉 然后继续走下面的+=
|
||||
// 如果富文本里面没有这个元素 就直接走+= ‘divBox’唯一标识符 这样就第二次选择的时候 会覆盖第一次选择的
|
||||
var aaa = document.querySelectorAll('.divBox')
|
||||
console.log(this.html,'this.html--before');
|
||||
console.log(aaa,'打印dom')
|
||||
if(aaa.length!=0){
|
||||
console.log(this.html,'this.html111');
|
||||
aaa.remove()
|
||||
}else{
|
||||
aaa.innerHTML = ''
|
||||
this.html += `<p >${this.add}</p>`
|
||||
console.log(this.html,'this.html2222');
|
||||
var aaa = document.querySelectorAll(".divBox");
|
||||
console.log(this.html, "this.html--before");
|
||||
console.log(aaa, "打印dom");
|
||||
if (aaa.length != 0) {
|
||||
console.log(this.html, "this.html111");
|
||||
aaa.remove();
|
||||
} else {
|
||||
aaa.innerHTML = "";
|
||||
this.html += `<p >${this.add}</p>`;
|
||||
console.log(this.html, "this.html2222");
|
||||
}
|
||||
this.fieldshow = false;
|
||||
setTimeout(() => {
|
||||
@ -305,11 +301,10 @@ methods: {
|
||||
// fieldMark: "",
|
||||
// fileSpan: "",
|
||||
// };
|
||||
this.add=[]
|
||||
// this.editor.focus();
|
||||
this.add = [];
|
||||
this.editor.focus();
|
||||
++this.isResouceShow;
|
||||
}, 100);
|
||||
|
||||
},
|
||||
onCreated(editor) {
|
||||
this.editor = Object.seal(editor);
|
||||
@ -332,7 +327,7 @@ methods: {
|
||||
});
|
||||
|
||||
bankLevel("3").then((res) => {
|
||||
console.log(res,'打印res值')
|
||||
console.log(res, "打印res值");
|
||||
// res.forEach((e) => {
|
||||
// e.children.forEach((el) => {
|
||||
// el.children.forEach((f) => {
|
||||
@ -344,7 +339,7 @@ methods: {
|
||||
// });
|
||||
// });
|
||||
this.fieldoptions = res;
|
||||
console.log(this.fieldoptions ,'***')
|
||||
console.log(this.fieldoptions, "***");
|
||||
});
|
||||
},
|
||||
beforeClose() {
|
||||
@ -353,123 +348,123 @@ methods: {
|
||||
this.fieldshow = false;
|
||||
this.labelshow = false;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
watch: {
|
||||
nodeContent(newValue, oldValue) {
|
||||
console.log(newValue, oldValue);
|
||||
this.html = newValue;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
mounted() {
|
||||
this.html = this.nodeContent;
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
const editor = this.editor;
|
||||
if (editor == null) return;
|
||||
editor.destroy(); // 组件销毁时,及时销毁编辑器
|
||||
},
|
||||
created() {
|
||||
},
|
||||
created() {
|
||||
that = this;
|
||||
this.info();
|
||||
},
|
||||
},
|
||||
};
|
||||
class MyButtonMenu {
|
||||
// JS 语法
|
||||
constructor(vueInstance) {
|
||||
// JS 语法
|
||||
constructor(vueInstance) {
|
||||
this.vueInstance = vueInstance;
|
||||
this.title = "添加画像标签字段";
|
||||
this.iconSvg =
|
||||
'<svg t="1711951668796" class="icon" viewBox="0 0 1119 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4490" xmlns:xlink="http://www.w3.org/1999/xlink" width="218.5546875" height="200"><path d="M25.415082 562.922053a25.1989 25.1989 0 0 1-17.745705-43.299519L542.347456 7.392772A25.110172 25.110172 0 1 1 577.040308 43.682738L42.894601 555.9125a25.110172 25.110172 0 0 1-17.479519 7.009553z" p-id="4491"></path><path d="M1094.061411 562.922053a25.110172 25.110172 0 0 1-17.745704-7.009553L542.347456 43.682738A25.110172 25.110172 0 1 1 577.040308 7.392772l534.323165 512.229762a25.1989 25.1989 0 0 1-17.745704 43.299519zM559.738247 1023.955458a380.467906 380.467906 0 0 1-380.024264-380.112992 25.1989 25.1989 0 0 1 50.309073 0 330.070105 330.070105 0 0 0 329.715191 329.80392 25.1989 25.1989 0 1 1 0 50.309072z" p-id="4492"></path><path d="M1009.769315 799.472295H618.3878a25.1989 25.1989 0 0 1 0-50.309072h391.381515a25.1989 25.1989 0 0 1 0 50.309072z" fill="#231815" p-id="4493"></path><path d="M814.122922 996.005974a25.1989 25.1989 0 0 1-25.198901-25.198901V579.869201a25.1989 25.1989 0 1 1 50.309073 0v390.937872a25.1989 25.1989 0 0 1-25.110172 25.198901z" fill="#231815" p-id="4494"></path></svg>';
|
||||
this.tag = "button";
|
||||
this.showModal = true;
|
||||
}
|
||||
// 菜单是否需要激活(如选中加粗文本,“加粗”菜单会激活),用不到则返回 false
|
||||
isActive(editor) {
|
||||
}
|
||||
// 菜单是否需要激活(如选中加粗文本,“加粗”菜单会激活),用不到则返回 false
|
||||
isActive(editor) {
|
||||
return false;
|
||||
}
|
||||
// 获取菜单执行时的 value ,用不到则返回空 字符串或 false
|
||||
getValue(editor) {
|
||||
}
|
||||
// 获取菜单执行时的 value ,用不到则返回空 字符串或 false
|
||||
getValue(editor) {
|
||||
return "";
|
||||
}
|
||||
// 菜单是否需要禁用(如选中 H1 ,“引用”菜单被禁用),用不到则返回 false
|
||||
isDisabled(editor) {
|
||||
}
|
||||
// 菜单是否需要禁用(如选中 H1 ,“引用”菜单被禁用),用不到则返回 false
|
||||
isDisabled(editor) {
|
||||
return false;
|
||||
}
|
||||
// 点击菜单时触发的函数
|
||||
exec(editor, value) {
|
||||
}
|
||||
// 点击菜单时触发的函数
|
||||
exec(editor, value) {
|
||||
this.vueInstance.labelshow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
class MyButtonMenutwo {
|
||||
// JS 语法
|
||||
constructor(vueInstance) {
|
||||
// JS 语法
|
||||
constructor(vueInstance) {
|
||||
this.vueInstance = vueInstance;
|
||||
this.title = "添加知识库字段";
|
||||
this.iconSvg =
|
||||
'<svg t="1711422779479" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2507" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M831.6 639.6h-63.9v127.9H639.9v63.9h127.8v127.9h63.9V831.4h127.9v-63.9H831.6z" p-id="2508"></path><path d="M564.3 925.2c0-18.5-15-33.6-33.6-33.6H287.3c-86.2 0-156.4-70.2-156.4-156.4V286.9c0-86.2 70.1-156.4 156.4-156.4h448.4c86.2 0 156.4 70.2 156.4 156.4v238.8c0 18.5 15 33.6 33.6 33.6s33.6-15 33.6-33.6V286.9C959.2 163.6 859 63.3 735.7 63.3H287.3C164 63.3 63.7 163.6 63.7 286.8v448.3c0 123.2 100.3 223.5 223.6 223.5h243.4c18.6 0.1 33.6-14.9 33.6-33.4z" p-id="2509"></path></svg>';
|
||||
this.tag = "button";
|
||||
this.showModal = true;
|
||||
}
|
||||
// 菜单是否需要激活(如选中加粗文本,“加粗”菜单会激活),用不到则返回 false
|
||||
isActive(editor) {
|
||||
}
|
||||
// 菜单是否需要激活(如选中加粗文本,“加粗”菜单会激活),用不到则返回 false
|
||||
isActive(editor) {
|
||||
return false;
|
||||
}
|
||||
// 获取菜单执行时的 value ,用不到则返回空 字符串或 false
|
||||
getValue(editor) {
|
||||
}
|
||||
// 获取菜单执行时的 value ,用不到则返回空 字符串或 false
|
||||
getValue(editor) {
|
||||
return "";
|
||||
}
|
||||
// 菜单是否需要禁用(如选中 H1 ,“引用”菜单被禁用),用不到则返回 false
|
||||
isDisabled(editor) {
|
||||
}
|
||||
// 菜单是否需要禁用(如选中 H1 ,“引用”菜单被禁用),用不到则返回 false
|
||||
isDisabled(editor) {
|
||||
return false;
|
||||
}
|
||||
// 点击菜单时触发的函数
|
||||
exec(editor, value) {
|
||||
}
|
||||
// 点击菜单时触发的函数
|
||||
exec(editor, value) {
|
||||
this.vueInstance.fieldshow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
const menuConf = {
|
||||
key: "MyButtonMenu", // 定义 menu key :要保证唯一、不重复(重要)
|
||||
factory() {
|
||||
key: "MyButtonMenu", // 定义 menu key :要保证唯一、不重复(重要)
|
||||
factory() {
|
||||
return new MyButtonMenu(that);
|
||||
},
|
||||
},
|
||||
};
|
||||
const menuConftwo = {
|
||||
key: "MyButtonMenutwo", // 定义 menu key :要保证唯一、不重复(重要)
|
||||
factory() {
|
||||
key: "MyButtonMenutwo", // 定义 menu key :要保证唯一、不重复(重要)
|
||||
factory() {
|
||||
return new MyButtonMenutwo(that);
|
||||
},
|
||||
},
|
||||
};
|
||||
const module = {
|
||||
// JS 语法
|
||||
menus: [menuConf, menuConftwo],
|
||||
// 其他功能,下文讲解...
|
||||
// JS 语法
|
||||
menus: [menuConf, menuConftwo],
|
||||
// 其他功能,下文讲解...
|
||||
};
|
||||
Boot.registerModule(module);
|
||||
function withAttachment(editor) {
|
||||
// JS 语法
|
||||
const { isInline, isVoid } = editor;
|
||||
const newEditor = editor;
|
||||
newEditor.isInline = (elem) => {
|
||||
// JS 语法
|
||||
const { isInline, isVoid } = editor;
|
||||
const newEditor = editor;
|
||||
newEditor.isInline = (elem) => {
|
||||
const type = DomEditor.getNodeType(elem);
|
||||
if (type === "attachment") return true; // 针对 type: attachment ,设置为 inline
|
||||
if (type === "attachmenttwo") return true; // 针对 type: attachment ,设置为 inline
|
||||
return isInline(elem);
|
||||
};
|
||||
newEditor.isVoid = (elem) => {
|
||||
};
|
||||
newEditor.isVoid = (elem) => {
|
||||
const type = DomEditor.getNodeType(elem);
|
||||
if (type === "attachment") return true; // 针对 type: attachment ,设置为 void
|
||||
if (type === "attachmenttwo") return true; // 针对 type: attachment ,设置为 void
|
||||
return isVoid(elem);
|
||||
};
|
||||
return newEditor; // 返回 newEditor ,重要!!!
|
||||
};
|
||||
return newEditor; // 返回 newEditor ,重要!!!
|
||||
}
|
||||
Boot.registerPlugin(withAttachment);
|
||||
function renderAttachment(elem, children, editor) {
|
||||
// JS 语法
|
||||
// 获取“附件”的数据,参考上文 myResume 数据结构
|
||||
const { fileName = "", link = "", fileSpan = "", fieldMark = "" } = elem;
|
||||
// 附件 icon 图标 vnode
|
||||
const iconVnode = h(
|
||||
// JS 语法
|
||||
// 获取“附件”的数据,参考上文 myResume 数据结构
|
||||
const { fileName = "", link = "", fileSpan = "", fieldMark = "" } = elem;
|
||||
// 附件 icon 图标 vnode
|
||||
const iconVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性
|
||||
@ -492,8 +487,8 @@ const iconVnode = h(
|
||||
},
|
||||
}
|
||||
// img 没有子节点,所以第三个参数不用写
|
||||
);
|
||||
const nameiconVnode = h(
|
||||
);
|
||||
const nameiconVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性
|
||||
@ -517,8 +512,8 @@ const nameiconVnode = h(
|
||||
},
|
||||
}
|
||||
// img 没有子节点,所以第三个参数不用写
|
||||
);
|
||||
const spanVnode = h(
|
||||
);
|
||||
const spanVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性
|
||||
@ -533,8 +528,8 @@ const spanVnode = h(
|
||||
},
|
||||
// img 没有子节点,所以第三个参数不用写
|
||||
[fileSpan, iconVnode]
|
||||
);
|
||||
const nameVnode = h(
|
||||
);
|
||||
const nameVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性
|
||||
@ -549,9 +544,9 @@ const nameVnode = h(
|
||||
},
|
||||
// img 没有子节点,所以第三个参数不用写
|
||||
[fileName, nameiconVnode]
|
||||
);
|
||||
// 附件元素 vnode
|
||||
const attachVnode = h(
|
||||
);
|
||||
// 附件元素 vnode
|
||||
const attachVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性、样式、事件
|
||||
@ -564,15 +559,15 @@ const attachVnode = h(
|
||||
},
|
||||
// 子节点
|
||||
[nameVnode, spanVnode]
|
||||
);
|
||||
return attachVnode;
|
||||
);
|
||||
return attachVnode;
|
||||
}
|
||||
function renderAttachmenttwo(elem, children, editor) {
|
||||
// JS 语法
|
||||
// 获取“附件”的数据,参考上文 myResume 数据结构
|
||||
const { fileName = "", link = "", fileSpan = "", fieldMark = "" } = elem;
|
||||
// 附件 icon 图标 vnode
|
||||
const iconVnode = h(
|
||||
// JS 语法
|
||||
// 获取“附件”的数据,参考上文 myResume 数据结构
|
||||
const { fileName = "", link = "", fileSpan = "", fieldMark = "" } = elem;
|
||||
// 附件 icon 图标 vnode
|
||||
const iconVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性
|
||||
@ -595,8 +590,8 @@ const iconVnode = h(
|
||||
},
|
||||
}
|
||||
// img 没有子节点,所以第三个参数不用写
|
||||
);
|
||||
const nameiconVnode = h(
|
||||
);
|
||||
const nameiconVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性
|
||||
@ -616,13 +611,13 @@ const nameiconVnode = h(
|
||||
click() {
|
||||
that.modify = true;
|
||||
that.fieldshow = true;
|
||||
this.add=[]
|
||||
this.add = [];
|
||||
} /* 其他... */,
|
||||
},
|
||||
}
|
||||
// img 没有子节点,所以第三个参数不用写
|
||||
);
|
||||
const spanVnode = h(
|
||||
);
|
||||
const spanVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性
|
||||
@ -637,8 +632,8 @@ const spanVnode = h(
|
||||
},
|
||||
// img 没有子节点,所以第三个参数不用写
|
||||
[fileSpan, iconVnode]
|
||||
);
|
||||
const nameVnode = h(
|
||||
);
|
||||
const nameVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性
|
||||
@ -653,9 +648,9 @@ const nameVnode = h(
|
||||
},
|
||||
// img 没有子节点,所以第三个参数不用写
|
||||
[fileName, nameiconVnode]
|
||||
);
|
||||
// 附件元素 vnode
|
||||
const attachVnode = h(
|
||||
);
|
||||
// 附件元素 vnode
|
||||
const attachVnode = h(
|
||||
// HTML tag
|
||||
"span",
|
||||
// HTML 属性、样式、事件
|
||||
@ -668,33 +663,33 @@ const attachVnode = h(
|
||||
},
|
||||
// 子节点
|
||||
[nameVnode, spanVnode]
|
||||
);
|
||||
return attachVnode;
|
||||
);
|
||||
return attachVnode;
|
||||
}
|
||||
const renderElemConf = {
|
||||
type: "attachment", // 新元素 type ,重要!!!
|
||||
renderElem: renderAttachment,
|
||||
type: "attachment", // 新元素 type ,重要!!!
|
||||
renderElem: renderAttachment,
|
||||
};
|
||||
const renderElemConftwo = {
|
||||
type: "attachmenttwo", // 新元素 type ,重要!!!
|
||||
renderElem: renderAttachmenttwo,
|
||||
type: "attachmenttwo", // 新元素 type ,重要!!!
|
||||
renderElem: renderAttachmenttwo,
|
||||
};
|
||||
|
||||
const rendermodule = {
|
||||
// JS 语法
|
||||
// menus: [menu1Conf, menu2Conf, menu3Conf], // 菜单
|
||||
// editorPlugin: withBreakAndDelete, // 插件
|
||||
renderElems: [renderElemConf, renderElemConftwo /* 其他元素... */], // renderElem
|
||||
// JS 语法
|
||||
// menus: [menu1Conf, menu2Conf, menu3Conf], // 菜单
|
||||
// editorPlugin: withBreakAndDelete, // 插件
|
||||
renderElems: [renderElemConf, renderElemConftwo /* 其他元素... */], // renderElem
|
||||
|
||||
// 其他功能,下文讲解...
|
||||
// 其他功能,下文讲解...
|
||||
};
|
||||
Boot.registerModule(rendermodule);
|
||||
function attachmentToHtml(elem, childrenHtml) {
|
||||
// JS 语法
|
||||
// 获取附件元素的数据
|
||||
const { link = "", fileName = "", fileSpan = "", fieldMark = "" } = elem;
|
||||
// 生成 HTML 代码
|
||||
const html = `<span data-w-e-type="attachment"
|
||||
// JS 语法
|
||||
// 获取附件元素的数据
|
||||
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}"
|
||||
@ -706,14 +701,14 @@ const html = `<span data-w-e-type="attachment"
|
||||
<span>${fileSpan}</span>
|
||||
</span>
|
||||
</span>`;
|
||||
return html;
|
||||
return html;
|
||||
}
|
||||
function attachmentToHtmltwo(elem, childrenHtml) {
|
||||
// JS 语法
|
||||
// 获取附件元素的数据
|
||||
const { link = "", fileName = "", fileSpan = "", fieldMark = "" } = elem;
|
||||
// 生成 HTML 代码
|
||||
const html = `<span data-w-e-type="attachmenttwo"
|
||||
// JS 语法
|
||||
// 获取附件元素的数据
|
||||
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}"
|
||||
@ -725,67 +720,67 @@ const html = `<span data-w-e-type="attachmenttwo"
|
||||
<span>${fileSpan}</span>
|
||||
</span>
|
||||
</span>`;
|
||||
return html;
|
||||
return html;
|
||||
}
|
||||
const elemToHtmlConf = {
|
||||
type: "attachment", // 新元素的 type ,重要!!!
|
||||
elemToHtml: attachmentToHtml,
|
||||
type: "attachment", // 新元素的 type ,重要!!!
|
||||
elemToHtml: attachmentToHtml,
|
||||
};
|
||||
const elemToHtmlConftwo = {
|
||||
type: "attachmenttwo", // 新元素的 type ,重要!!!
|
||||
elemToHtml: attachmentToHtmltwo,
|
||||
type: "attachmenttwo", // 新元素的 type ,重要!!!
|
||||
elemToHtml: attachmentToHtmltwo,
|
||||
};
|
||||
const elemToHtmlConfmodule = {
|
||||
// JS 语法
|
||||
elemsToHtml: [elemToHtmlConf, elemToHtmlConftwo /* 其他元素... */], // elemToHtml
|
||||
// JS 语法
|
||||
elemsToHtml: [elemToHtmlConf, elemToHtmlConftwo /* 其他元素... */], // elemToHtml
|
||||
};
|
||||
Boot.registerModule(elemToHtmlConfmodule);
|
||||
function parseAttachmentHtml(domElem, children, editor) {
|
||||
// JS 语法
|
||||
// 从 DOM element 中获取“附件”的信息
|
||||
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 = {
|
||||
// JS 语法
|
||||
// 从 DOM element 中获取“附件”的信息
|
||||
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;
|
||||
};
|
||||
return myResume;
|
||||
}
|
||||
function parseAttachmentHtmltwo(domElem, children, editor) {
|
||||
// JS 语法
|
||||
// 从 DOM element 中获取“附件”的信息
|
||||
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 = {
|
||||
// JS 语法
|
||||
// 从 DOM element 中获取“附件”的信息
|
||||
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;
|
||||
};
|
||||
return myResume;
|
||||
}
|
||||
const parseHtmlConf = {
|
||||
selector: 'span[data-w-e-type="attachment"]', // CSS 选择器,匹配特定的 HTML 标签
|
||||
parseElemHtml: parseAttachmentHtml,
|
||||
selector: 'span[data-w-e-type="attachment"]', // CSS 选择器,匹配特定的 HTML 标签
|
||||
parseElemHtml: parseAttachmentHtml,
|
||||
};
|
||||
const parseHtmlConftwo = {
|
||||
selector: 'span[data-w-e-type="attachmenttwo"]', // CSS 选择器,匹配特定的 HTML 标签
|
||||
parseElemHtml: parseAttachmentHtmltwo,
|
||||
selector: 'span[data-w-e-type="attachmenttwo"]', // CSS 选择器,匹配特定的 HTML 标签
|
||||
parseElemHtml: parseAttachmentHtmltwo,
|
||||
};
|
||||
const parseHtmlConfmodule = {
|
||||
parseElemsHtml: [parseHtmlConf, parseHtmlConftwo], // parseElemHtml
|
||||
parseElemsHtml: [parseHtmlConf, parseHtmlConftwo], // parseElemHtml
|
||||
};
|
||||
Boot.registerModule(parseHtmlConfmodule);
|
||||
</script>
|
||||
@ -794,15 +789,15 @@ Boot.registerModule(parseHtmlConfmodule);
|
||||
|
||||
<style lang="scss" >
|
||||
.category-cascader-panel {
|
||||
.el-cascader-panel {
|
||||
// background-color: red !important;
|
||||
|
||||
li[aria-haspopup="true"] {
|
||||
.el-cascader-panel {
|
||||
// background-color: red !important;
|
||||
.el-scrollbar:first-child {
|
||||
// li[aria-haspopup="true"] {
|
||||
.el-checkbox {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
// ::v-deep .el-textarea__inner {
|
||||
|
||||
@ -583,7 +583,7 @@ export default {
|
||||
executionTime: "",
|
||||
appletPushSign: "0",
|
||||
officialPushSign: "0",
|
||||
messagePushSign: "0",
|
||||
messagePushSign: 0,
|
||||
taskSubdivisiontemplateType: "",
|
||||
officialRemindContent: "",
|
||||
messagePreview: "",
|
||||
@ -692,10 +692,21 @@ export default {
|
||||
this.totalNumber = res.data.totalNumber;
|
||||
res.data.specialDiseaseNodeList.forEach((e) => {
|
||||
console.log(e, "eeeeeeeeeeeeeeeee");
|
||||
if(e.messagePushSign){
|
||||
e.messagePushSign = "" + e.messagePushSign;
|
||||
|
||||
}if( e.officialPushSign ){
|
||||
e.officialPushSign = "" + e.officialPushSign;
|
||||
|
||||
}
|
||||
if(e.appletPushSign){
|
||||
e.appletPushSign = "" + e.appletPushSign;
|
||||
e.phonePushSign = "" + e.phonePushSign;
|
||||
|
||||
}
|
||||
if(e.phonePushSign){
|
||||
e.phonePushSign = ""+e.phonePushSign
|
||||
|
||||
}
|
||||
});
|
||||
this.lists = this.handleData(
|
||||
res.data.specialDiseaseNodeList,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user