import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { Button } from "antd";
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
import "./index.less";

const getLabel = WeaLocaleProvider.getLabel;

@inject("calculateStore")
@observer
class Index extends Component {
  render() {
    const { calculateStore: { ECSearchForm } } = this.props;
    return (
      <div className="advance-search">
        <WeaInputSearch value={ECSearchForm.getFormParams().employeeName}
                        onChange={v => ECSearchForm.updateFields({ employeeName: v })}
                        onSearch={this.props.onAdvanceSearch}
        />
        <Button type="ghost" className="wea-advanced-search text-elli"
                onClick={this.props.onOpenAdvanceSearch}>{getLabel(111, "高级搜索")}</Button>
      </div>
    );
  }
}

export default Index;
