|
|
|
@ -83,20 +83,27 @@ export class AddAssocDrillLock implements Command
|
|
|
|
|
if (associationBoardRes.Status === PromptStatus.OK)
|
|
|
|
|
{
|
|
|
|
|
const associationBoards = associationBoardRes.SelectSet.SelectEntityList as Board[];
|
|
|
|
|
for (const associationBoard of associationBoards)
|
|
|
|
|
const associBoards = []; //成功关联的板
|
|
|
|
|
let count = 0; //没有关联的板数量
|
|
|
|
|
const assocBrIds = new Set(FirstBoard.DrillList.keys());
|
|
|
|
|
for (const br of associationBoards)
|
|
|
|
|
{
|
|
|
|
|
const associationBoardId = associationBoard.Id;
|
|
|
|
|
FirstBoard.AppendDrillAssociationLock(associationBoardId);
|
|
|
|
|
|
|
|
|
|
associationBoard.AppendDrillAssociationLock(FirstBoardId);
|
|
|
|
|
if (assocBrIds.has(br.Id))
|
|
|
|
|
{
|
|
|
|
|
associBoards.push(br);
|
|
|
|
|
FirstBoard.AppendDrillAssociationLock(br.Id);
|
|
|
|
|
br.AppendDrillAssociationLock(FirstBoard.Id);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
count++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AppToaster.show({
|
|
|
|
|
message: `排钻关联锁定成功,共关联了${associationBoards.length}块板`,
|
|
|
|
|
message: `共${associBoards.length}块板关联了排钻锁,有${count}块板没有关联排钻,未关联排钻锁`,
|
|
|
|
|
intent: Intent.SUCCESS,
|
|
|
|
|
timeout: 3000,
|
|
|
|
|
});
|
|
|
|
|
Log(`排钻关联锁定成功,共关联了${associationBoards.length}块板`, LogType.Info, [...associationBoards]);
|
|
|
|
|
Log(`共${associBoards.length}块板关联了排钻锁,查看关联的板:`, LogType.Info, [...associBoards]);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -127,7 +134,15 @@ export class AddAssocDrillLock implements Command
|
|
|
|
|
if (BoardRes.SelectSet.SelectObjectCount === 2)
|
|
|
|
|
{
|
|
|
|
|
const [br1, br2] = BoardRes.SelectSet.SelectEntityList as Board[];
|
|
|
|
|
if (br1.DrillAssociationLock.has(br2.Id))
|
|
|
|
|
if ([...br1.DrillList.keys()].every(id => br2.Id != id))
|
|
|
|
|
{
|
|
|
|
|
AppToaster.show({
|
|
|
|
|
message: `选中的板之间没有排钻,请先排钻再关联`,
|
|
|
|
|
intent: Intent.WARNING,
|
|
|
|
|
timeout: 3000,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else if (br1.DrillAssociationLock.has(br2.Id))
|
|
|
|
|
{
|
|
|
|
|
AppToaster.show({
|
|
|
|
|
message: `选中的板已关联,请勿重复关联`,
|
|
|
|
|