import { CSSObject } from "zq_ui_react_4/utils/css/config"; import { NodeTypes, EdgeTypes } from "react-flow-renderer"; import { StringMap } from "zq_ui_react_4/zq"; /** * 节点定义 * */ export interface NodePro { id: any; type: "input" | "default" | "output" | string; data: { label: any; value?: any; }; label: any; style?: CSSObject; position: { x: number; y: number; }; } export interface EdgePro { id: any; source: string; target: string; label: any; type?: "custom" | "step" | "smoothstep" | string; animated?: boolean; style?: CSSObject; markerEnd?: { type: any; color?: string; width?: number; height?: number; markerUnits?: string; orient?: string; strokeWidth?: number; }; labelStyle?: CSSObject; } export interface showDataPro { Nodes: NodePro[]; Edges: EdgePro[]; } export declare type showType = "row" | "col"; /** * preNode: any, // 上个节点的信息 curNode: any, // 当前节点的信息 index:number, // 当前节点的索引 broNum: number, // 兄弟节点数量 parentsNum: number, // 当前节点的父节点数量 childrensNum: number, // 当前节点的子节点数量 baseNodeStyle?: CSSObject, // 节点初始样式 baseEdgeStyle?: CSSObject, // 线初始样式 * */ export interface computeOneNodeProps { preNode: any; curNode: any; index: number; broNum: number; parentsNum: number; childrensNum: number; baseNodeStyle?: CSSObject; baseEdgeStyle?: CSSObject; showType: showType; broInfo: any; childrenNumMap?: StringMap; parentNumMap?: StringMap; } export interface settingProps { nodeType?: string; nodeStyle?: CSSObject; edgeType?: string; edgeStyle?: CSSObject; [key: string]: any; } /** * 每条数据的结构 * * */ export interface reactFlowDataItem { _id: string; parents: reactFlowDataItem[]; childrens: reactFlowDataItem[]; setting: settingProps; [key: string]: any; } /** * * reactFlowData的结构 * */ export interface reactFlowDataPro { center: reactFlowDataItem; inList: reactFlowDataItem[]; outList: reactFlowDataItem[]; } /** * ShowReactFlowPro * */ export interface ShowReactFlowPro { data: reactFlowDataPro; showType: showType; getInitNodes?: (dataList: any) => Promise; handleType?: "股权结构"; NodeComp?: any; NodeCompProps?: any; nodeTypes?: NodeTypes; edgeTypes?: EdgeTypes; panelStyle?: CSSObject; baseNodeStyle?: CSSObject; baseEdgeStyle?: CSSObject; }