|
@@ -20,10 +20,12 @@ import './houseManage.less'
|
20
|
20
|
export default React.forwardRef((props, ref) => {
|
21
|
21
|
const { hotel, hotelList, onHotelChange } = props
|
22
|
22
|
const [detail, setDetail] = useState([])
|
|
23
|
+ const [search,setSearch]=useState()
|
23
|
24
|
|
24
|
25
|
const queryParams = useMemo(() => ({
|
25
|
|
- hotelId: hotel.hotelId
|
26
|
|
- }), [hotel.hotelId])
|
|
26
|
+ hotelId: hotel.hotelId,
|
|
27
|
+ roomName: search
|
|
28
|
+ }), [hotel.hotelId,search])
|
27
|
29
|
|
28
|
30
|
const shareDataRef = useRef()
|
29
|
31
|
|
|
@@ -119,11 +121,13 @@ export default React.forwardRef((props, ref) => {
|
119
|
121
|
|
120
|
122
|
const onSearch = (e) => {
|
121
|
123
|
if (e.detail.value == '') {
|
|
124
|
+ setSearch()
|
122
|
125
|
getRoomList({ hotelId: hotel.hotelId }).then((res) => {
|
123
|
126
|
setDetail(res.records || [])
|
124
|
127
|
})
|
125
|
128
|
}
|
126
|
129
|
else {
|
|
130
|
+ setSearch(e.detail.value)
|
127
|
131
|
getRoomList({ hotelId: hotel.hotelId, roomName: e.detail.value }).then((res) => {
|
128
|
132
|
setDetail(res.records || [])
|
129
|
133
|
})
|