From f6ba3de79d9eb19ff4eff6318e4b6b83dfe0d852 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Fri, 19 Jul 2024 10:21:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=BE=E6=8E=A5key=E5=80=BC=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/draw-app/dialogs/SetTrainLink.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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('列车连接成功!');