You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
970 B
React
41 lines
970 B
React
4 months ago
|
import React from 'react';
|
||
|
import { Select } from 'antd';
|
||
|
import { observer } from 'mobx-react';
|
||
|
import { HotelStars as options } from '../../libs/ht';
|
||
|
|
||
|
const HotelStars = (props) => {
|
||
|
const { mode, value, onChange, show_all, ...extProps } = props;
|
||
|
const _show_all = ['tags', 'multiple'].includes(mode) ? false : show_all;
|
||
|
return (
|
||
|
<div>
|
||
|
<Select
|
||
|
mode={mode || null}
|
||
|
allowClear
|
||
|
style={{ width: '100%' }}
|
||
|
placeholder="星级"
|
||
|
value={value || undefined}
|
||
|
onChange={(value) => {
|
||
|
if (typeof onChange === 'function') {
|
||
|
onChange(value);
|
||
|
}
|
||
|
}}
|
||
|
labelInValue={false}
|
||
|
{...extProps}
|
||
|
options={options}
|
||
|
>
|
||
|
{_show_all ? (
|
||
|
<Select.Option key="-1" value="ALL">
|
||
|
ALL
|
||
|
</Select.Option>
|
||
|
) : (
|
||
|
''
|
||
|
)}
|
||
|
</Select>
|
||
|
</div>
|
||
|
);
|
||
|
};
|
||
|
/**
|
||
|
* 酒店星级
|
||
|
*/
|
||
|
export default observer(HotelStars);
|