代码调整

This commit is contained in:
dong 2023-08-09 09:57:43 +08:00
parent b3c7646fba
commit 61362fda0c
2 changed files with 8 additions and 8 deletions

View File

@ -8,8 +8,8 @@
dense
outlined
:disable="true"
label="Link"
v-model="props.link.code"
label="SectionLink"
v-model="props.sectionLink.code"
/>
</q-card-section>
<q-card-section class="q-pt-none">
@ -17,7 +17,7 @@
type="number"
dense
outlined
:label="`列车偏移(mm)[Link长度为${props.link.linkLength}mm]`"
:label="`列车偏移(mm)[SectionLink长度为${props.sectionLink.linkLength}mm]`"
:min="0"
v-model.number="offset"
/>
@ -52,7 +52,7 @@ import { SectionLink } from 'src/graphics/sectionLink/SectionLink';
import { ref } from 'vue';
const props = defineProps({
link: {
sectionLink: {
type: SectionLink,
required: true,
},

View File

@ -149,8 +149,8 @@ export class SectionLinkOperateInteraction extends GraphicInteractionPlugin<Sect
}
onContextMenu(e: FederatedMouseEvent) {
const target = e.target as DisplayObject;
const link = target.getGraphic() as SectionLink;
this.app.updateSelected(link);
const sectionLink = target.getGraphic() as SectionLink;
this.app.updateSelected(sectionLink);
const lineStore = useLineStore();
const simulationId = lineStore.simulationId || '';
addTrainConfig.handler = () => {
@ -158,14 +158,14 @@ export class SectionLinkOperateInteraction extends GraphicInteractionPlugin<Sect
title: '创建列车',
message: '',
component: AddTrainDialog,
componentProps: { link: link },
componentProps: { sectionLink: sectionLink },
cancel: true,
persistent: true,
}).onOk((data: { offset: number; dir: 1 | 0 }) => {
addTrain({
simulationId,
up: !!data.dir,
headLinkId: link.datas.index.toString(),
headLinkId: sectionLink.datas.index.toString(),
headLinkOffset: data.offset,
})
.then(() => {