获取数据时判断是否为多输入或输出,创建连线时添加字符串标识
let fromPort = el.connectionfrom_original_name;
fromPort = fromPort.includes('[')?(el.connectionfrom+'[]'):el.connectionfrom;
let toPort = el.connectionto_original_name;
toPort = toPort.includes('[')?(el.connectionto+'[]'):el.connectionto;
this.graphAntv.addEdge({
source:{cell: fromcell, port:fromPort},
target:{cell: tocell, port:toPort},
attrs:{
trueNameFrom:el.connectionfrom_original_name,
trueNameTo:el.connectionto_original_name,
}
})
连接时判断
if(e.edge.source.port.includes('[]')){
this.midCellLine = e.edge.id;
if(e.edge.target.port.includes('[]')){
// 输入和输出都是多端口