| | |
| | | |
| | | config.action.forEach(item => { |
| | | item.logLabel = Tab.label + '-' + item.label // 用于sPC_TableData_InUpDe记录操作按钮 |
| | | if (item.execMode) { |
| | | item.OpenType = 'funcbutton' |
| | | } |
| | | item.$menuId = this.props.MenuID |
| | | |
| | | if (item.position === 'toolbar') { |
| | | _actions.push(item) |
| | |
| | | /** |
| | | * @description 导出Excel时,获取页面搜索排序等参数 |
| | | */ |
| | | getexceloutparam = () => { |
| | | const { Tab, mainSearch } = this.props |
| | | getexceloutparam = (menuId, btnId) => { |
| | | const { Tab, mainSearch, MenuID } = this.props |
| | | const { arr_field, orderBy, search, setting} = this.state |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | let searches = search |
| | | if (mainSearch && mainSearch.length > 0) { // 主表搜索条件 |
| | | searches = [...mainSearch, ...search] |
| | | } |
| | | |
| | | return { |
| | | MKEmitter.emit('execExcelout', MenuID, btnId, { |
| | | arr_field: arr_field, |
| | | orderBy: orderBy || setting.order, |
| | | search: searches, |
| | | menuName: Tab.label |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('getexceloutparam', this.getexceloutparam) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('getexceloutparam', this.getexceloutparam) |
| | | } |
| | | |
| | | render() { |
| | |
| | | selectedData={selectedData} |
| | | MenuID={this.props.SupMenuID} |
| | | refreshdata={this.refreshbyaction} |
| | | getexceloutparam={this.getexceloutparam} |
| | | /> |
| | | </div> |
| | | <SubTable |