| | |
| | | sync: _sync |
| | | }, () => { |
| | | if (config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | this.loadData() |
| | | this.loadData(null, 'init') |
| | | } else if (config.setting.sync === 'true' && _data) { |
| | | this.handleData() |
| | | this.handleData('init') |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData() |
| | | this.handleData('init') |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | |
| | | /** |
| | | * @description 数据加载 |
| | | */ |
| | | async loadData (hastimer) { |
| | | async loadData (hastimer, type) { |
| | | const { mainSearch, menuType } = this.props |
| | | const { config, arr_field, BID } = this.state |
| | | |
| | |
| | | data: result.data, |
| | | loading: false |
| | | }, () => { |
| | | this.handleData() |
| | | this.handleData(type) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | } |
| | | } |
| | | |
| | | handleData = () => { |
| | | handleData = (type) => { |
| | | const { data, searchkey, config } = this.state |
| | | if (!data || data.length === 0) { |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | expandedKeys: _treeNodes[0] ? [_treeNodes[0].$key] : [], |
| | | treedata: _treedata, |
| | | treeNodes: _treeNodes, |
| | | }) |
| | | |
| | | if (type === 'init' && _treeNodes[0] && config.wrap.selected === 'true') { |
| | | this.setState({ |
| | | selectedKeys: [_treeNodes[0].$key] |
| | | }) |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('resetSelectLine', config.uuid, _treeNodes[0].$key, '') |
| | | }, 200) |
| | | } |
| | | } |
| | | |
| | | treeFilter = (value) => { |