| | |
| | | popData: false, // 弹框页面,所选的表格数据 |
| | | visible: false, // 弹框显示隐藏控制 |
| | | tabBtn: null, // 表单标签按钮 |
| | | tabParam: null // 表单标签参数 |
| | | tabParam: null, // 表单标签参数 |
| | | refreshtabs: null // 需要刷新的标签集 |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | let _isLinkMain = false // 检查是否有与主表关联的子表 |
| | | let supmenus = {} |
| | | config.tabgroups.forEach(group => { |
| | | if (config[group] && config[group].length > 0) { |
| | | config[group] = config[group].map(tab => { |
| | | if (tab.subtabs && tab.subtabs.length > 0) { |
| | | tab.subtabs.forEach(id => { |
| | | supmenus[id] = tab.uuid |
| | | }) |
| | | } |
| | | if (config.setting.subtabs.includes(tab.uuid)) { |
| | | tab.supMenu = 'mainTable' |
| | | _isLinkMain = true |
| | | } else if (supmenus[tab.uuid]) { |
| | | tab.supMenu = supmenus[tab.uuid] |
| | | } |
| | | config.tabgroups.forEach(groupId => { |
| | | if (!config[groupId] || config[groupId].length === 0) return |
| | | |
| | | return tab |
| | | }) |
| | | } |
| | | config[groupId].forEach(tab => { |
| | | if (tab.supMenu === 'mainTable') { |
| | | _isLinkMain = true |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | this.setState({ |
| | |
| | | /** |
| | | * @description 子表操作完成后刷新主表 |
| | | */ |
| | | handleMainTable = () => { |
| | | this.reloadtable() |
| | | handleMainTable = (type, tab) => { |
| | | if (type === 'maingrid' && tab.supMenu === 'mainTable') { |
| | | this.reloadtable() |
| | | } else if (type === 'maingrid' && tab.supMenu) { |
| | | this.setState({ |
| | | refreshtabs: [tab.supMenu] |
| | | }, () => { |
| | | this.setState({ |
| | | refreshtabs: null |
| | | }) |
| | | }) |
| | | } else if (type === 'equaltab' && tab.equalTab && tab.equalTab.length > 0) { |
| | | this.setState({ |
| | | refreshtabs: tab.equalTab |
| | | }, () => { |
| | | this.setState({ |
| | | refreshtabs: null |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | Tab={_tab} |
| | | MenuID={_tab.linkTab} |
| | | SupMenuID={this.props.MenuID} |
| | | refreshtabs={this.state.refreshtabs} |
| | | ContainerId={this.state.ContainerId} |
| | | BID={this.state.BIDs[_tab.supMenu] || ''} |
| | | BData={this.state.BIDs[_tab.supMenu + 'data'] || ''} |
| | | handleTableId={this.handleTableId} |
| | | handleMainTable={this.handleMainTable} |
| | | handleMainTable={(type) => this.handleMainTable(type, _tab)} |
| | | /> : null} |
| | | </TabPane> |
| | | ) |
| | |
| | | visible={this.state.visible} |
| | | onCancel={this.popclose} |
| | | footer={[ |
| | | <Button key="cancel" onClick={this.popclose}>{this.state.dict['main.close']}</Button> |
| | | <Button key="close" onClick={this.popclose}>{this.state.dict['main.close']}</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |