2023-06-07 11:20:21 +08:00
|
|
|
|
2023-06-07 11:55:45 +08:00
|
|
|
export const avRender = (element: Element) => {
|
|
|
|
|
let avElements: Element[] = [];
|
|
|
|
|
if (element.getAttribute("data-type") === "NodeAttributeView") {
|
|
|
|
|
// 编辑器内代码块编辑渲染
|
|
|
|
|
avElements = [element];
|
|
|
|
|
} else {
|
|
|
|
|
avElements = Array.from(element.querySelectorAll('[data-type="NodeAttributeView"]'));
|
|
|
|
|
}
|
|
|
|
|
if (avElements.length === 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (avElements.length > 0) {
|
|
|
|
|
avElements.forEach((e: HTMLDivElement) => {
|
|
|
|
|
if (e.getAttribute("data-render") === "true") {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const data = {
|
|
|
|
|
filter:{},
|
|
|
|
|
sorts: {},
|
|
|
|
|
columns:[{
|
|
|
|
|
id:"",
|
|
|
|
|
name:"",
|
|
|
|
|
type:"",
|
|
|
|
|
}],
|
|
|
|
|
rows:[{
|
|
|
|
|
id:"",
|
|
|
|
|
cells:[{
|
|
|
|
|
value:"",
|
|
|
|
|
}]
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
e.setAttribute("data-render", "true");
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-06-07 11:20:21 +08:00
|
|
|
}
|