diff --git a/src/components/Tables/Base/Download/index.jsx b/src/components/Tables/Base/Download/index.jsx index 4523b30d..655f7968 100644 --- a/src/components/Tables/Base/Download/index.jsx +++ b/src/components/Tables/Base/Download/index.jsx @@ -31,6 +31,7 @@ export default class index extends Component { total: PropTypes.number, getValueRenderFunc: PropTypes.func.isRequired, resourceName: PropTypes.string, + extraName: PropTypes.string, getData: PropTypes.func, totalMax: PropTypes.number, }; @@ -41,6 +42,7 @@ export default class index extends Component { total: 0, totalMax: 10000, resourceName: '', + extraName: '', getData: () => Promise.resolve({ data: { @@ -171,10 +173,11 @@ export default class index extends Component { getFileName = (all) => { const timeStr = toLocalTimeFilter(new Date().getTime()); - const { resourceName } = this.props; + const { resourceName, extraName } = this.props; + const name = extraName ? `${extraName}-${resourceName}` : resourceName; return all - ? `${resourceName}-${t('all')}-${timeStr}.csv` - : `${resourceName}-${timeStr}.csv`; + ? `${name}-${t('all')}-${timeStr}.csv` + : `${name}-${timeStr}.csv`; }; exportCurrentData = (event, all) => { diff --git a/src/components/Tables/Base/index.jsx b/src/components/Tables/Base/index.jsx index 58497b26..634dcab4 100644 --- a/src/components/Tables/Base/index.jsx +++ b/src/components/Tables/Base/index.jsx @@ -74,6 +74,7 @@ export default class BaseTable extends React.Component { alwaysUpdate: PropTypes.bool, emptyText: PropTypes.oneOfType([PropTypes.string || PropTypes.func]), resourceName: PropTypes.string, + detailName: PropTypes.string, expandable: PropTypes.object, showTimeFilter: PropTypes.bool, timeFilter: PropTypes.any, @@ -102,6 +103,7 @@ export default class BaseTable extends React.Component { hideSearch: false, hideCustom: false, resourceName: '', + detailName: '', expandable: undefined, showTimeFilter: false, isPageByBack: false, @@ -784,6 +786,7 @@ export default class BaseTable extends React.Component { data, columns, resourceName, + detailName, getDownloadData, onClickAction, onCancelAction, @@ -800,6 +803,7 @@ export default class BaseTable extends React.Component { total, getValueRenderFunc, resourceName, + extraName: detailName, getData: getDownloadData, onBeginDownload: onClickAction, onFinishDownload: onCancelAction, diff --git a/src/containers/List/index.jsx b/src/containers/List/index.jsx index ed673e60..cbe05737 100644 --- a/src/containers/List/index.jsx +++ b/src/containers/List/index.jsx @@ -140,6 +140,14 @@ export default class BaseList extends React.Component { return !!detail; } + get detailName() { + if (!this.inDetailPage) { + return ''; + } + const { detailName } = this.props; + return detailName; + } + get shouldRefreshDetail() { return true; } @@ -462,6 +470,7 @@ export default class BaseList extends React.Component { const { autoRefresh, tableHeight } = this.state; return { resourceName: this.name, + detailName: this.detailName, data: this.getDataSource(), // data:data, columns: this.getColumns(), diff --git a/src/containers/TabDetail/index.jsx b/src/containers/TabDetail/index.jsx index 25cdc83f..c0bb1f86 100644 --- a/src/containers/TabDetail/index.jsx +++ b/src/containers/TabDetail/index.jsx @@ -369,6 +369,7 @@ export default class DetailBase extends React.Component { ) : (