| | |
| | | |
| | | class SubTabModalTable extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.any, // 类型,calendar需特殊处理 |
| | | Tab: PropTypes.any, // 日历标签信息或标签按钮信息 |
| | | BID: PropTypes.string, // 上级数据ID |
| | | BData: PropTypes.any, // 上级数据 |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | mainSearch: PropTypes.any, // 主表搜索条件 |
| | | SupMenuID: PropTypes.string, // 上级菜单Id |
| | | refreshSupView: PropTypes.any, // 刷新上级菜单 |
| | | closeModalView: PropTypes.any // 关闭模态框 |
| | | } |
| | | |
| | | state = { |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction, type, Tab } = this.props |
| | | const { permAction, Tab } = this.props |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | // 版本兼容 |
| | | config = UtilsUpdate.updateSubTable(config) |
| | | |
| | | // 仅支持exec、prompt、pop 三种类型按钮 |
| | | // 不支持funcbutton、popview 类型按钮 |
| | | let labels = [] |
| | | if (type === 'calendar') { |
| | | config.action = config.action.filter(item => { |
| | | if (['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType)) return true |
| | | config.action = config.action.filter(item => { |
| | | if (['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut', 'innerpage'].includes(item.OpenType)) return true |
| | | |
| | | labels.push(item.label) |
| | | labels.push(item.label) |
| | | |
| | | return false |
| | | }) |
| | | |
| | | } else { |
| | | config.action = config.action.filter(item => { |
| | | if (['exec', 'prompt', 'pop'].includes(item.OpenType)) return true |
| | | |
| | | labels.push(item.label) |
| | | |
| | | return false |
| | | }) |
| | | } |
| | | return false |
| | | }) |
| | | |
| | | if (window.GLOB.systemType !== 'production' && labels.length > 0) { |
| | | notification.warning({ |
| | |
| | | }) |
| | | } |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 按钮操作完成后(成功或失败),页面刷新,重置页码及选择项 |
| | | */ |
| | | refreshbyaction = (position, btn) => { |
| | | if (position === 'grid' || position === 'view' || position === 'maingrid') { |
| | | this.reloadtable(btn) |
| | | this.props.refreshSupView() |
| | | } else if (position === 'trigger') { // 日历子表触发标签点击事件 |
| | | this.props.closeModalView && this.props.closeModalView() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 导出Excel时,获取页面搜索排序等参数 |
| | | */ |
| | | getexceloutparam = (menuId, btnId) => { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 按钮执行完成后页面刷新 |
| | | * @param {*} menuId // 菜单Id |
| | | * @param {*} position // 刷新位置 |
| | | * @param {*} btn // 执行的按钮 |
| | | */ |
| | | refreshByButtonResult = (menuId, position, btn) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | this.reloadtable(btn) |
| | | MKEmitter.emit('refreshPopButton', this.props.Tab.uuid) |
| | | } |
| | | |
| | | /** |
| | | * @description 图表视图切换 |
| | | */ |
| | | changeChart = (uuid) => { |
| | |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('getexceloutparam', this.getexceloutparam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | } |
| | | |
| | | /** |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('getexceloutparam', this.getexceloutparam) |
| | | MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | } |
| | | |
| | | render() { |
| | |
| | | BData={this.props.BData} |
| | | selectedData={selectedData} |
| | | MenuID={this.props.SupMenuID} |
| | | refreshdata={this.refreshbyaction} |
| | | /> |
| | | </div> |
| | | <SubTable |
| | |
| | | setting={setting} |
| | | columns={columns} |
| | | pageSize={pageSize} |
| | | BID={this.props.BID} |
| | | data={this.state.data} |
| | | dict={this.state.dict} |
| | | BData={this.props.BData} |
| | |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | refreshbyaction={this.refreshbyaction} |
| | | chgSelectData={this.changeSelectedData} |
| | | handleTableId={() => {}} |
| | | /> |
| | |
| | | data={this.state.data} |
| | | BData={this.props.BData} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbyaction} |
| | | handleTableId={() => {}} |
| | | /> |
| | | </Col> |