perf: 7. 选择导游的列表中,增加导游联系方式以及所属城市的信息,按城市分组并添加手机号码

main
Lei OT 5 months ago
parent 5cc30aaefa
commit 9fd2f8dda6

@ -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

@ -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)
})
}

Loading…
Cancel
Save