Skip to content

Commit

Permalink
fix(frontend): 开区集群选择交互调整 TencentBlueKing#5235
Browse files Browse the repository at this point in the history
  • Loading branch information
jinquantianxia authored and zhangzhw8 committed Jun 28, 2024
1 parent 69c65f7 commit c07769e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
const currentBizId = window.PROJECT_CONFIG.BIZ_ID;
// 集群域名是否已存在表格的映射表
// const domainMemo: Record<string, boolean> = {};
const domainMemo: Record<string, boolean> = {};
const handleHostChange = (hostList: HostDetails[]) => {
if (checkListEmpty(tableData.value)) {
Expand Down Expand Up @@ -157,20 +157,20 @@
selectedClusters.value = selected;
const list = Object.keys(selected).reduce((list: TendbhaModel[], key) => list.concat(...selected[key]), []);
const newList = list.reduce((result, item) => {
// const domain = item.master_domain;
// if (!domainMemo[domain]) {
const row = createRowData({
clusterData: {
id: item.id,
master_domain: item.master_domain,
bk_biz_id: item.bk_biz_id,
bk_cloud_id: item.bk_cloud_id,
bk_cloud_name: item.bk_cloud_name,
},
});
result.push(row);
// domainMemo[domain] = true;
// }
const domain = item.master_domain;
if (!domainMemo[domain]) {
const row = createRowData({
clusterData: {
id: item.id,
master_domain: domain,
bk_biz_id: item.bk_biz_id,
bk_cloud_id: item.bk_cloud_id,
bk_cloud_name: item.bk_cloud_name,
},
});
result.push(row);
domainMemo[domain] = true;
}
return result;
}, [] as IDataRow[]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
const currentBizId = window.PROJECT_CONFIG.BIZ_ID;
// 集群域名是否已存在表格的映射表
const domainMemo: Record<string, boolean> = {};
const handleHostChange = (hostList: HostDetails[]) => {
if (checkListEmpty(tableData.value)) {
return;
Expand Down Expand Up @@ -150,16 +153,20 @@
selectedClusters.value = selected;
const list = selected[ClusterTypes.TENDBCLUSTER];
const newList = list.reduce((result, item) => {
const row = createRowData({
clusterData: {
id: item.id,
master_domain: item.master_domain,
bk_biz_id: item.bk_biz_id,
bk_cloud_id: item.bk_cloud_id,
bk_cloud_name: item.bk_cloud_name,
},
});
result.push(row);
const domain = item.master_domain;
if (!domainMemo[domain]) {
const row = createRowData({
clusterData: {
id: item.id,
master_domain: domain,
bk_biz_id: item.bk_biz_id,
bk_cloud_id: item.bk_cloud_id,
bk_cloud_name: item.bk_cloud_name,
},
});
result.push(row);
domainMemo[domain] = true;
}
return result;
}, [] as IDataRow[]);
if (checkListEmpty(tableData.value)) {
Expand Down

0 comments on commit c07769e

Please sign in to comment.