列车报错修改

This commit is contained in:
dong 2023-08-15 18:08:52 +08:00
parent 12fcb7d1a6
commit 40c2583b12
2 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,7 @@ import { ref } from 'vue';
const props = defineProps({
dev: {
type: Section || Turnout,
type: [Section, Turnout],
required: true,
},
kmLength: {

View File

@ -421,6 +421,9 @@ export class Train extends JlGraphic {
}
allLength = Math.abs(B - A);
}
if (allLength == 0) {
allLength = 1;
}
if (this.states.headOffset > allLength) {
console.error('偏移长度超出最大长度');
return;