import React, {Component} from 'react';
import {Select} from 'antd';
import {observer} from 'mobx-react';


const BillTypeSelect = (props) => {
    const {store} = props;
    return (
        <div>
            <Select
                mode={store.bill_type_mode}
                style={{width: '100%'}}
                placeholder="选择类型"
                value={store.bill_types}
                onChange={store.bt_handleChange}
            >
                {props.show_all ? <Select.Option key="-1" value="ALL">ALL 账单类型</Select.Option> : ''}
                {Object.keys(store.data).length == 0 ? '' : store.data.map((item, index) => {
                    return (
                        <Select.Option key={index}
                                       value={item.cb_billtype}>{item.cb_billtype}</Select.Option>
                    )

                })
                }
            </Select>
        </div>
    );

}

export default observer(BillTypeSelect);

