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

fix config list sort and search problem (#5223)

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