diff --git a/src/components/draw-app/dialogs/SetTrainLink.vue b/src/components/draw-app/dialogs/SetTrainLink.vue index bbb3bbc..325432a 100644 --- a/src/components/draw-app/dialogs/SetTrainLink.vue +++ b/src/components/draw-app/dialogs/SetTrainLink.vue @@ -53,23 +53,23 @@ const props = defineProps({ required: true, }, }); -const connType = ref(); -const connectOptions = ref<{ label: string; value: number }[]>([]); +const connType = ref(); +const connectOptions = ref<{ label: string; value: string }[]>([]); const showLoadTransData = ref(true); -const connectMap = new Map(); +const connectMap = new Map(); onMounted(() => { connectOptions.value = []; getCanLinkPlatForm(props.simulationId) .then((resp) => { - const list: { label: string; value: number }[] = []; + const list: { label: string; value: string }[] = []; resp.data.forEach((element: { typeName: string; connType: number }) => { list.push({ label: element.typeName, - value: element.connType, + value: element.typeName, }); - connectMap.set(element.connType, element.typeName); + connectMap.set(element.typeName, element.connType); }); connectOptions.value = list; }) @@ -84,8 +84,8 @@ function onCreate() { updateTrainConn({ id: props.trainId + '', simulationId: props.simulationId, - connType: connType.value as number, - typeName: connectMap.get(connType.value as number) || '', + connType: connectMap.get(connType.value as string) || 0, + typeName: connType.value as string, }) .then(() => { successNotify('列车连接成功!');