| | |
| | | data: PropTypes.object, // 卡片数据 |
| | | selectKey: PropTypes.string, // 选择卡片的序号 |
| | | colMap: PropTypes.any, // 显示列信息,用于设置标记 |
| | | refreshdata: PropTypes.func, // 按钮操作后数据刷新 |
| | | switchCard: PropTypes.func // 卡片切换 |
| | | } |
| | | |
| | |
| | | * @description 获取按钮元素 |
| | | */ |
| | | getActionList = (actions, show) => { |
| | | const { BID, BData, Tab, setting, columns, ContainerId, data, MenuID } = this.props |
| | | const { BData, Tab, setting, columns, ContainerId, data, MenuID } = this.props |
| | | |
| | | return actions.map(item => { |
| | | if (['exec', 'prompt', 'pop'].includes(item.OpenType)) { |
| | | return ( |
| | | <NormalButton |
| | | key={item.uuid} |
| | | BID={BID} |
| | | BID={data.$$BID} |
| | | Tab={Tab} |
| | | btn={item} |
| | | show={show} |
| | |
| | | columns={columns} |
| | | selectedData={[data]} |
| | | ContainerId={ContainerId} |
| | | updateStatus={this.props.refreshdata} |
| | | /> |
| | | ) |
| | | } else if (item.OpenType === 'popview') { |
| | | return ( |
| | | <PopupButton |
| | | key={item.uuid} |
| | | BID={BID} |
| | | BID={data.$$BID} |
| | | Tab={Tab} |
| | | btn={item} |
| | | show={show} |
| | | BData={BData} |
| | | setting={setting} |
| | | selectedData={[data]} |
| | | updateStatus={this.props.refreshdata} |
| | | /> |
| | | ) |
| | | } else if (item.OpenType === 'tab' || item.OpenType === 'blank') { |
| | |
| | | MenuID={MenuID} |
| | | setting={setting} |
| | | selectedData={[data]} |
| | | updateStatus={this.props.refreshdata} |
| | | /> |
| | | ) |
| | | } else if (item.OpenType === 'innerpage' || item.OpenType === 'outerpage') { |
| | |
| | | show={show} |
| | | setting={setting} |
| | | selectedData={[data]} |
| | | updateStatus={this.props.refreshdata} |
| | | /> |
| | | ) |
| | | } else if (item.OpenType === 'funcbutton') { |
| | |
| | | return ( |
| | | <ChangeUserButton |
| | | key={item.uuid} |
| | | BID={BID} |
| | | BID={data.$$BID} |
| | | btn={item} |
| | | show={show} |
| | | setting={setting} |
| | | selectedData={[data]} |
| | | updateStatus={this.props.refreshdata} |
| | | /> |
| | | ) |
| | | } else if (item.funcType === 'print') { |
| | | return ( |
| | | <PrintButton |
| | | key={item.uuid} |
| | | BID={BID} |
| | | BID={data.$$BID} |
| | | Tab={Tab} |
| | | btn={item} |
| | | show={show} |
| | |
| | | setting={setting} |
| | | selectedData={[data]} |
| | | ContainerId={ContainerId} |
| | | updateStatus={this.props.refreshdata} |
| | | /> |
| | | ) |
| | | } |
| | |
| | | columns={this.props.columns} |
| | | selectedData={[]} |
| | | ContainerId={this.props.ContainerId} |
| | | updateStatus={this.props.refreshdata} |
| | | /> |
| | | </div> |
| | | </Card> : null} |
| | |
| | | tableId: PropTypes.string, |
| | | loading: PropTypes.bool, |
| | | data: PropTypes.array, |
| | | refreshdata: PropTypes.func, |
| | | handleTableId: PropTypes.func |
| | | } |
| | | |
| | |
| | | this.props.handleTableId(this.props.tableId, _id, data) |
| | | } |
| | | |
| | | /** |
| | | * @description 操作完成后,数据刷新 |
| | | */ |
| | | updateStatus = (type, positon, btn) => { |
| | | if (type === 'refresh') { |
| | | this.props.refreshdata(positon, btn) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { plot, data, loading, BID, BData, Tab, MenuID, config, columns, ContainerId } = this.props |
| | | const { card, colMap, selectKey, actionList } = this.state |
| | |
| | | show="icon" |
| | | btn={action} |
| | | setting={config.setting} |
| | | updateStatus={this.updateStatus} |
| | | /> |
| | | ) |
| | | } else { |
| | |
| | | show="icon" |
| | | btn={action} |
| | | setting={config.setting} |
| | | updateStatus={this.updateStatus} |
| | | /> |
| | | ) |
| | | } |
| | |
| | | setting={config.setting} |
| | | ContainerId={ContainerId} |
| | | switchCard={this.switchCard} |
| | | refreshdata={this.updateStatus} |
| | | /> |
| | | )) |
| | | } |
| | |
| | | setting={config.setting} |
| | | ContainerId={ContainerId} |
| | | switchCard={() => {}} |
| | | refreshdata={this.updateStatus} |
| | | /> : null |
| | | } |
| | | {(loading || !card.insertAction) && (!data || data.length === 0) ? <Empty description={false}/> : null} |