未验证 提交 6ce15037 编写于 作者: H haoyann 提交者: GitHub

fix config list sort and search problem (#5223)

上级 5146fad2
...@@ -223,11 +223,25 @@ class ConfigurationManagement extends React.Component { ...@@ -223,11 +223,25 @@ class ConfigurationManagement extends React.Component {
navTo(url, record) { navTo(url, record) {
this.serverId = getParams('serverId') || ''; this.serverId = getParams('serverId') || '';
this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数 this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数
this.props.history.push( switch (url) {
`${url}?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${ case '/historyRollback':
record.group url = `${url}?historyServerId=${this.serverId || ''}&historyDataId=${
}&namespace=${this.tenant}` record.dataId
); }&historyGroup=${record.group}&namespace=${this.tenant}`;
break;
case '/listeningToQuery':
url = `${url}?listeningServerId=${this.serverId || ''}&listeningDataId=${
record.dataId
}&listeningGroup=${record.group}&namespace=${this.tenant}`;
break;
case '/pushTrajectory':
url = `${url}?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${
record.group
}&namespace=${this.tenant}`;
break;
default:
}
this.props.history.push(url);
} }
openLoading() { openLoading() {
...@@ -442,12 +456,14 @@ class ConfigurationManagement extends React.Component { ...@@ -442,12 +456,14 @@ class ConfigurationManagement extends React.Component {
} }
onChangeSort(dataIndex, order) { onChangeSort(dataIndex, order) {
this.dataSource.sort(function(a, b) { const { configurations = {} } = this.props;
configurations.pageItems.sort(function(a, b) {
if (order === 'asc') { if (order === 'asc') {
return (a[dataIndex] + '').localeCompare(b[dataIndex] + ''); return (a[dataIndex] + '').localeCompare(b[dataIndex] + '');
} }
return (b[dataIndex] + '').localeCompare(a[dataIndex] + ''); return (b[dataIndex] + '').localeCompare(a[dataIndex] + '');
}); });
this.forceUpdate();
} }
handlePageSizeChange(pageSize) { handlePageSizeChange(pageSize) {
...@@ -1411,7 +1427,7 @@ class ConfigurationManagement extends React.Component { ...@@ -1411,7 +1427,7 @@ class ConfigurationManagement extends React.Component {
ref="dataTable" ref="dataTable"
loading={this.state.loading} loading={this.state.loading}
rowSelection={this.state.rowSelection} rowSelection={this.state.rowSelection}
onSort={this.onChangeSort} onSort={this.onChangeSort.bind(this)}
> >
<Table.Column sortable={true} title={'Data Id'} dataIndex={'dataId'} /> <Table.Column sortable={true} title={'Data Id'} dataIndex={'dataId'} />
<Table.Column sortable={true} title={'Group'} dataIndex={'group'} /> <Table.Column sortable={true} title={'Group'} dataIndex={'group'} />
......
...@@ -37,12 +37,12 @@ class HistoryRollback extends React.Component { ...@@ -37,12 +37,12 @@ class HistoryRollback extends React.Component {
this.field = new Field(this); this.field = new Field(this);
this.appName = getParams('appName') || ''; this.appName = getParams('appName') || '';
this.preAppName = this.appName; this.preAppName = this.appName;
this.group = getParams('group') || ''; this.group = getParams('historyGroup') || '';
this.preGroup = this.group; this.preGroup = this.group;
this.dataId = getParams('dataId') || ''; this.dataId = getParams('historyDataId') || '';
this.preDataId = this.dataId; this.preDataId = this.dataId;
this.serverId = getParams('serverId') || ''; this.serverId = getParams('historyServerId') || '';
this.state = { this.state = {
value: '', value: '',
visible: false, visible: false,
...@@ -59,13 +59,6 @@ class HistoryRollback extends React.Component { ...@@ -59,13 +59,6 @@ class HistoryRollback extends React.Component {
selectValue: [], selectValue: [],
loading: false, loading: false,
}; };
const obj = {
dataId: this.dataId || '',
group: this.preGroup || '',
appName: this.appName || '',
serverId: this.serverId || '',
};
setParams(obj);
} }
componentDidMount() { componentDidMount() {
......
...@@ -55,9 +55,9 @@ class ListeningToQuery extends React.Component { ...@@ -55,9 +55,9 @@ class ListeningToQuery extends React.Component {
dataSource: [], dataSource: [],
}; };
this.field = new Field(this); this.field = new Field(this);
this.group = getParams('group') || ''; this.group = getParams('listeningGroup') || '';
this.dataId = getParams('dataId') || ''; this.dataId = getParams('listeningDataId') || '';
this.serverId = getParams('serverId') || ''; this.serverId = getParams('listeningServerId') || '';
this.tenant = getParams('namespace') || ''; this.tenant = getParams('namespace') || '';
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册