代码调整

This commit is contained in:
dong 2023-07-19 17:55:32 +08:00
parent b3011f2fb6
commit e85c27aefb

View File

@ -82,18 +82,8 @@ import { ITrainState, Train } from 'src/graphics/train/Train';
import { useLineStore } from 'src/stores/line-store';
import { ref, watch } from 'vue';
type trainState = {
id: string;
up: boolean;
headLinkId: string;
headLinkOffset: number;
tailLinkId: string;
tailLinkOffset: number;
occupiedLinkIndex: string[];
expanded?: boolean;
};
const lineStore = useLineStore();
const trainInfo = ref<trainState | null>();
const trainInfo = ref<ITrainState | null>();
watch(
() => lineStore.selectedGraphics,
(val) => {
@ -106,7 +96,7 @@ watch(
);
function getTrainStates(train: Train) {
trainInfo.value = null;
const s = train.getStates() as ITrainState;
const s = train.states as ITrainState;
trainInfo.value = s;
}
</script>