站台关联关系调整

This commit is contained in:
joylink_zhaoerwei 2023-10-17 16:42:31 +08:00
parent cdb02a8e20
commit e2165a0a35
2 changed files with 14 additions and 9 deletions

View File

@ -17,10 +17,10 @@
</q-btn-dropdown>
</q-card-section>
<q-separator inset />
<q-card-section>
<q-input outlined readonly v-model="relayState.id" label="id" hint="" />
<q-card-section class="q-gutter-sm">
<q-input outlined readonly v-model="relayState.id" label="id" />
<q-input outlined readonly v-model="relayState.code" label="名称" />
<q-checkbox v-model="relayState.xh" outlined label="是否吸合" />
<q-checkbox disable v-model="relayState.xh" label="是否吸合" />
</q-card-section>
</q-card>
</template>

View File

@ -168,20 +168,25 @@ export class Platform extends JlGraphic {
}
});
if (minDistanceRefSections) {
const refSection = minDistanceRefSections?.reduce((prev, cur) => {
const refSection = minDistanceRefSections.reduce((prev, cur) => {
return distance2(
prev.localToCanvasPoint(prev.getStartPoint()),
prev.localToCanvasPoint(getRectangleCenter(prev.getLocalBounds())),
this.position
) >
distance2(cur.localToCanvasPoint(prev.getStartPoint()), this.position)
distance2(
cur.localToCanvasPoint(getRectangleCenter(cur.getLocalBounds())),
this.position
)
? cur
: prev;
});
if (refSection) {
this.relationManage.deleteRelationOfGraphicAndOtherType(
this,
Section.Type
);
this.relationManage.addRelation(this, refSection);
}
}
}
saveRelations() {
const platformRef = [];
const refStation = this.relationManage