import { observable, action, computed, } from 'mobx'; import { WeaForm } from 'comsMobx'; import { WeaLocaleProvider, } from 'ecCom'; import { Button, } from 'antd'; const getLabel = WeaLocaleProvider.getLabel; export default class SearchStore { constructor(api, rootStore) { this.api = api; this.rootStore = rootStore; } get buttons(){ return [getLabel(82529, '搜索'), getLabel(27088, '重置'), getLabel(32694, '取消')]; } get searchProps() { return { advanceHeight: 130, hasMask: false, keyParam: 'key', searchType: ['base', 'advanced'], onChange: key => this.setSelectedKey(key), setShowSearchAd: bool => this.setShowSearchAd(bool), onSearch: () => this.onSearch(), onSearchChange: val => this.onSearchChange(val), buttonsAd: this.buttons.map((name, index) => { const type = (index === 0) && "primary"; let callback; if (index === 0) { callback = () => this.onSearch(); } else if (index === 1) { callback = () => this.form.reset(); } else { callback = () => this.setShowSearchAd(false) } return }) } } linkageFieldName; @observable showSearchAd = false; @observable form = new WeaForm(); @observable selectedKey = ''; @observable datas = []; @computed get searchsAd() { return