| | |
| | | import React, {Component} from 'react' |
| | | import { Spin, notification, ConfigProvider } from 'antd' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | import { Spin, notification } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | |
| | | MenuId: '', |
| | | type: 'CustomPage' |
| | | } |
| | | |
| | | reloading = false |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { params, path } = this.props.match |
| | |
| | | MKEmitter.addListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.addListener('closeTabView', this.closeTabView) |
| | | |
| | | if (window.GLOB.forcedUpdate) { |
| | | MKEmitter.addListener('reloadTabs', this.reloadTabs) |
| | | } |
| | | |
| | | if (window.GLOB.sysType !== 'cloud') { |
| | | Object.defineProperty(window, 'debugger', { |
| | | configurable: true, |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.removeListener('reloadTabs', this.reloadTabs) |
| | | MKEmitter.removeListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | reloadTabs = () => { |
| | | if (this.reloading) return |
| | | |
| | | this.reloading = true |
| | | |
| | | Api.getAppVersion(true).then(() => { |
| | | window.location.reload() |
| | | }, (message) => { |
| | | notification.error({ |
| | | top: 92, |
| | | message: message || '系统配置更新失败!', |
| | | duration: 10 |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | modifyTabs = (tab) => { |
| | |
| | | |
| | | return ( |
| | | <div className="main-iframe"> |
| | | <ConfigProvider locale={zhCN}> |
| | | {loading ? <Spin size="large" /> : null} |
| | | {!loading && type === 'CustomPage' ? <CustomPage MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | {!loading && type === 'BaseTable' ? <BaseTable MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | </ConfigProvider> |
| | | {loading ? <Spin size="large" /> : null} |
| | | {!loading && type === 'CustomPage' ? <CustomPage MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | {!loading && type === 'BaseTable' ? <BaseTable MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | <ImgScale /> |
| | | </div> |
| | | ) |