From 9fd2f8dda6ef0f4e600a585fec3f8a960f1e062e Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 12 Nov 2025 10:39:43 +0800 Subject: [PATCH] =?UTF-8?q?perf:=207.=20=E9=80=89=E6=8B=A9=E5=AF=BC?= =?UTF-8?q?=E6=B8=B8=E7=9A=84=E5=88=97=E8=A1=A8=E4=B8=AD=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=BC=E6=B8=B8=E8=81=94=E7=B3=BB=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=89=80=E5=B1=9E=E5=9F=8E=E5=B8=82=E7=9A=84?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=8C=89=E5=9F=8E=E5=B8=82=E5=88=86?= =?UTF-8?q?=E7=BB=84=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Reservation.js | 3 ++- src/views/reservation/Newest.jsx | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js index 6a5ff74..8908c75 100644 --- a/src/stores/Reservation.js +++ b/src/stores/Reservation.js @@ -163,7 +163,8 @@ const useReservationStore = create(devtools((set, get) => ({ return { guideId: data.TGI_SN, guideName: data.TGI2_Name, - mobileNo: data.TGI_Mobile + mobileNo: data.TGI_Mobile, + cityName: data.city_name, } }) return guideList diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index 07ee4b6..5f180fc 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -2,7 +2,7 @@ import { NavLink } from 'react-router-dom' import { useState, useEffect } from 'react' import { Row, Col, Space, Button, Table, Typography, Modal, App, Select } from 'antd' import dayjs from 'dayjs' -import { isEmpty } from '@/utils/commons' +import { groupBy, isEmpty } from '@/utils/commons' import { useTranslation } from 'react-i18next' import useFormStore from '@/stores/Form' import useReservationStore from '@/stores/Reservation' @@ -140,13 +140,11 @@ function Newest() { const initAgencyGuideList = (agencyId) => { fetchAgencyGuideList(agencyId) .then((guideList) => { - const selectOptions = guideList.map((data) => { - return { - value: data.guideId, - label: data.guideName + '(' + data.mobileNo + ')', - } - }) - setGuideSelectOptions(selectOptions) + const guideCity = (groupBy(guideList, 'cityName')); + const guideOptions = Object.keys(guideCity).map(city => ({ + label: city, options: guideCity[city].map(guide => ({ value: guide.guideId, label: guide.guideName + '(' + guide.mobileNo + ')', })), + })); + setGuideSelectOptions(guideOptions) }) }