mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-12 02:46:08 +00:00
fix: 使用 componentMeta.isModal 代替 protoType.isModal()
This commit is contained in:
parent
3742a04405
commit
b787dc436c
@ -975,12 +975,11 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
event: e,
|
event: e,
|
||||||
};
|
};
|
||||||
|
|
||||||
// if (e.dragObject.type === 'node' && e.dragObject.nodes[0]?.getPrototype()?.isModal()) {
|
|
||||||
if (
|
if (
|
||||||
e.dragObject &&
|
e.dragObject &&
|
||||||
e.dragObject.nodes &&
|
e.dragObject.nodes &&
|
||||||
e.dragObject.nodes.length &&
|
e.dragObject.nodes.length &&
|
||||||
e.dragObject.nodes[0].getPrototype()?.isModal()
|
e.dragObject.nodes[0].componentMeta.isModal
|
||||||
) {
|
) {
|
||||||
return this.designer.createLocation({
|
return this.designer.createLocation({
|
||||||
target: document.rootNode,
|
target: document.rootNode,
|
||||||
|
|||||||
@ -4,8 +4,7 @@ import { DocumentModel } from '../document-model';
|
|||||||
|
|
||||||
function getModalNodes(node: Node) {
|
function getModalNodes(node: Node) {
|
||||||
let nodes: any = [];
|
let nodes: any = [];
|
||||||
const prototype = node.getPrototype();
|
if (node.componentMeta.isModal) {
|
||||||
if (prototype && prototype.isModal()) {
|
|
||||||
nodes.push(node);
|
nodes.push(node);
|
||||||
}
|
}
|
||||||
const children = node.getChildren();
|
const children = node.getChildren();
|
||||||
@ -85,8 +84,7 @@ export class ModalNodesManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private addNode(node: Node) {
|
private addNode(node: Node) {
|
||||||
const prototype = node.getPrototype();
|
if (node.componentMeta.isModal) {
|
||||||
if (prototype && prototype.isModal()) {
|
|
||||||
this.hideModalNodes();
|
this.hideModalNodes();
|
||||||
this.modalNodes.push(node);
|
this.modalNodes.push(node);
|
||||||
this.addNodeEvent(node);
|
this.addNodeEvent(node);
|
||||||
@ -96,8 +94,7 @@ export class ModalNodesManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private removeNode(node: Node) {
|
private removeNode(node: Node) {
|
||||||
const prototype = node.getPrototype();
|
if (node.componentMeta.isModal) {
|
||||||
if (prototype && prototype.isModal()) {
|
|
||||||
const index = this.modalNodes.indexOf(node);
|
const index = this.modalNodes.indexOf(node);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
this.modalNodes.splice(index, 1);
|
this.modalNodes.splice(index, 1);
|
||||||
|
|||||||
@ -158,8 +158,8 @@ export class OutlineMain implements ISensor, ITreeBoard, IScrollable {
|
|||||||
const irect = this.getInsertionRect();
|
const irect = this.getInsertionRect();
|
||||||
const originLoc = document.dropLocation;
|
const originLoc = document.dropLocation;
|
||||||
|
|
||||||
const prop = e.dragObject.nodes ? e.dragObject.nodes[0].getPrototype() : null;
|
const componentMeta = e.dragObject.nodes ? e.dragObject.nodes[0].componentMeta : null;
|
||||||
if (e.dragObject.type === 'node' && prop && prop.isModal()) {
|
if (e.dragObject.type === 'node' && componentMeta && componentMeta.isModal) {
|
||||||
return designer.createLocation({
|
return designer.createLocation({
|
||||||
target: document.rootNode,
|
target: document.rootNode,
|
||||||
detail: {
|
detail: {
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class ModalTreeNodeView extends Component<{ treeNode: TreeNode }> {
|
|||||||
render() {
|
render() {
|
||||||
const { treeNode } = this.props;
|
const { treeNode } = this.props;
|
||||||
const modalNodes = treeNode.children?.filter((item) => {
|
const modalNodes = treeNode.children?.filter((item) => {
|
||||||
return item.node.getPrototype()?.isModal();
|
return item.node.componentMeta.isModal;
|
||||||
});
|
});
|
||||||
if (!modalNodes || modalNodes.length === 0) {
|
if (!modalNodes || modalNodes.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -72,7 +72,7 @@ class TreeNodeChildren extends Component<{
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
treeNode.children?.forEach((child, index) => {
|
treeNode.children?.forEach((child, index) => {
|
||||||
const childIsModal = child.node.getPrototype()?.isModal() || false;
|
const childIsModal = child.node.componentMeta.isModal || false;
|
||||||
if (isModal != childIsModal) {
|
if (isModal != childIsModal) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -508,7 +508,7 @@ class ComponentCreator extends React.Component<{ schema: any; propsMap: any, com
|
|||||||
constructor(props: any) {
|
constructor(props: any) {
|
||||||
super(props);
|
super(props);
|
||||||
const componentMeta = host.currentDocument?.getComponentMeta(props.schema.componentName);
|
const componentMeta = host.currentDocument?.getComponentMeta(props.schema.componentName);
|
||||||
if (componentMeta?.prototype?.isModal()) {
|
if (componentMeta?.isModal) {
|
||||||
this.isModal = true;
|
this.isModal = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user