Skip to content

Commit

Permalink
feat(frontend): 集群标准化 TencentBlueKing#4654
Browse files Browse the repository at this point in the history
  • Loading branch information
JustaCattt committed Nov 21, 2024
1 parent 99bb53b commit 5940447
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
}
interface Emits {
(e: 'change', value: Record<string, ClusterInfo[]>): void;
(e: 'change', value: ClusterInfo[]): void;
}
const props = defineProps<Props>();
Expand All @@ -108,11 +108,7 @@
});
const panelTabActive = ref();
const lastValues = reactive<NonNullable<Record<string, ClusterInfo[]>>>({
[ClusterTypes.TENDBHA]: [],
[ClusterTypes.TENDBSINGLE]: [],
[ClusterTypes.TENDBCLUSTER]: [],
});
const lastValues = reactive<Record<string, ClusterInfo[]>>({});
// const renderCom = computed(
// () => {
Expand Down Expand Up @@ -154,7 +150,7 @@
};
const handleSubmit = () => {
emits('change', lastValues);
emits('change', Object.values(lastValues).flat());
handleClose();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@
};
// 从集群选择器选择确认后
const handelClusterChange = (data: Record<string, ClusterInfo[]>) => {
selected.value = data;
const handelClusterChange = (data: ClusterInfo[]) => {
const newList = Object.values(data)
.flat()
.reduce<IDataRow[]>((result, item) => {
const domain = item.immute_domain;
if (!domainMemo[domain]) {
result.push(createRowData(item));
domainMemo[domain] = true;
result.push(createRowData(item));
selected.value[item.cluster_type].push(item);
}
return result;
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@
};
// 从集群选择器选择确认后
const handelClusterChange = (data: Record<string, ClusterInfo[]>) => {
selected.value = data;
const handelClusterChange = (data: ClusterInfo[]) => {
const newList = Object.values(data)
.flat()
.reduce<IDataRow[]>((result, item) => {
const domain = item.immute_domain;
if (!domainMemo[domain]) {
result.push(createRowData(item));
domainMemo[domain] = true;
result.push(createRowData(item));
selected.value[item.cluster_type].push(item);
}
return result;
}, []);
Expand Down

0 comments on commit 5940447

Please sign in to comment.