From 240b5dd759cbc88042567d53ef46aaf9842a8cad Mon Sep 17 00:00:00 2001 From: zhangrenyuan <18990852002@163.com> Date: Mon, 19 Jan 2026 10:53:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9C=B0=E5=8C=BA=E5=A4=84=E7=90=86):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A=EF=BC=8C=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=E5=9C=B0=E5=8C=BA=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E7=90=86=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/moneyManage/financialAccount/cashFlow.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/moneyManage/financialAccount/cashFlow.vue b/src/views/moneyManage/financialAccount/cashFlow.vue index b9e0a5e..64a10a1 100644 --- a/src/views/moneyManage/financialAccount/cashFlow.vue +++ b/src/views/moneyManage/financialAccount/cashFlow.vue @@ -315,13 +315,16 @@ const throttledsubmitRefund = _.throttle(handleRefund, 5000, { trailing: false }) // 递归查找地区ID +// normalizeMarketLabel 标准化地区名称,用于对比匹配 const normalizeMarketLabel = (value) => { return String(value ?? '') .trim() .toLowerCase() .replace(/[\s_-]+/g, '') } +// 传入的这两个参数对比,是否有匹配的地区ID const findValueByLabel = (options, label) => { + // option和label都调用normalizeMarketLabel函数 const normalizedLabel = normalizeMarketLabel(label) for (const option of options) { if (normalizeMarketLabel(option.label) === normalizedLabel) { @@ -339,6 +342,7 @@ onMounted(async () => { await getMarket() // 处理从工作台跳转过来的地区参数 + // 如果出现URL中的?region=a®ion=b 这种重复key,router会解析为['a','b'], 取第一个地区ID const regionName = Array.isArray(route.query.region) ? route.query.region[0] : route.query.region if (regionName && marketOptions.value.length) { const matchedId = findValueByLabel(marketOptions.value, regionName)