| | |
| | | const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent')) |
| | | const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent')) |
| | | |
| | | // 自定义标签 |
| | | const SecretKeyTable = asyncSpinComponent(() => import('./secretKeyTable')) |
| | | |
| | | const { TabPane } = Tabs |
| | | const { TreeNode } = Tree |
| | | const { Paragraph } = Typography |
| | |
| | | } |
| | | // 去除空行标签 |
| | | config.tabgroups = config.tabgroups.filter(group => group.sublist.length > 0) |
| | | |
| | | // HS下自定义处理的标签 |
| | | if (this.props.menuType === 'HS') { |
| | | config.tabgroups.forEach(group => { |
| | | group.sublist = group.sublist.map(tab => { |
| | | if (tab.linkTab === '1586577325055l2ng7t75g7i4ek2ng8o') { |
| | | tab.type = 'SecretKeyTable' |
| | | } |
| | | return tab |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | // 视图权限 |
| | | config.charts = config.charts.filter(item => { |
| | |
| | | const { setting, arr_field, BIDs, search, orderBy, BID, pageIndex, pageSize } = this.state |
| | | let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0)) |
| | | |
| | | this.setState({ |
| | | selectedData: [], |
| | | BIDs: { |
| | | ...BIDs, |
| | | mainTable: '', |
| | | mainTabledata: '' |
| | | } |
| | | }) |
| | | |
| | | if (requireFields.length > 0) { |
| | | let labels = requireFields.map(item => item.label) |
| | | labels = Array.from(new Set(labels)) |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | param.menuname = this.props.MenuName || '' |
| | | } |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | this.setState({ |
| | |
| | | return item |
| | | }), |
| | | total: result.total, |
| | | selectedData: [], |
| | | loading: false, |
| | | pickup: false, |
| | | BIDs: { |
| | | ...BIDs, |
| | | mainTable: '', |
| | | mainTabledata: '' |
| | | } |
| | | pickup: false |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType, this.props.dataManager) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | param.menuname = this.props.MenuName || '' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (nextProps.refreshTab && nextProps.refreshTab.MenuID === this.props.MenuID) { |
| | | if (nextProps.refreshTab.position === 'grid') { |
| | | this.reloadtable() |
| | | } else if (nextProps.refreshTab.position === 'view') { |
| | | this.reloadview() |
| | | } |
| | | this.reloadview() |
| | | this.props.refreshTabView('') |
| | | } else if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) { |
| | | let selectTab = nextProps.tabviews.filter(tab => tab.selected)[0] |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { menuType } = this.props |
| | | const { menuType, MenuName } = this.props |
| | | const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, userConfig, tabActive, chartId, search, selectedData } = this.state |
| | | |
| | | return ( |
| | |
| | | BID={BID} |
| | | setting={setting} |
| | | actions={actions} |
| | | MenuName={MenuName} |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | selectedData={selectedData} |
| | |
| | | {this.props.menuType !== 'HS' ? <SettingComponent |
| | | config={config} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | MenuName={this.props.MenuName} |
| | | permAction={this.props.permAction} |
| | | permRoles={this.props.permRoles} |
| | | userConfig={this.state.userConfig} |
| | |
| | | config={config} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuName={MenuName} |
| | | pageSize={pageSize} |
| | | dict={this.state.dict} |
| | | data={this.state.data} |
| | |
| | | BID={BID} |
| | | plot={item} |
| | | config={config} |
| | | MenuName={MenuName} |
| | | tableId="mainTable" |
| | | data={this.state.data} |
| | | MenuID={this.props.MenuID} |
| | |
| | | BID={BID} |
| | | plot={item} |
| | | config={config} |
| | | MenuName={MenuName} |
| | | data={this.state.data} |
| | | getexceloutparam={this.getexceloutparam} |
| | | loading={this.state.loading} |
| | |
| | | {_tab.label} |
| | | </span> |
| | | } key={_tab.uuid}> |
| | | {_tab.type === 'SubTable' ? |
| | | <SubTable |
| | | Tab={_tab} |
| | | MenuID={_tab.linkTab} |
| | | mainSearch={_tab.searchPass === 'true' ? search : null} |
| | | userConfig={userConfig ? userConfig[_tab.uuid] : null} |
| | | 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={(type) => this.handleMainTable(type, _tab)} |
| | | /> : null} |
| | | {_tab.type === 'SecretKeyTable' ? |
| | | <SecretKeyTable |
| | | 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'] || ''} |
| | | handleMainTable={(type) => this.handleMainTable(type, _tab)} |
| | | /> : null} |
| | | <SubTable |
| | | Tab={_tab} |
| | | MenuID={_tab.linkTab} |
| | | mainSearch={_tab.searchPass === 'true' ? search : null} |
| | | userConfig={userConfig ? userConfig[_tab.uuid] : null} |
| | | 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={(type) => this.handleMainTable(type, _tab)} |
| | | /> |
| | | </TabPane> |
| | | ) |
| | | })} |