Skip to content

Commit 5940447

Browse files
committed
feat(frontend): 集群标准化 #4654
1 parent 99bb53b commit 5940447

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

dbm-ui/frontend/src/views/cluster-standardize/components/cluster-selector/Index.vue

+3-7
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
}
9797

9898
interface Emits {
99-
(e: 'change', value: Record<string, ClusterInfo[]>): void;
99+
(e: 'change', value: ClusterInfo[]): void;
100100
}
101101

102102
const props = defineProps<Props>();
@@ -108,11 +108,7 @@
108108
});
109109

110110
const panelTabActive = ref();
111-
const lastValues = reactive<NonNullable<Record<string, ClusterInfo[]>>>({
112-
[ClusterTypes.TENDBHA]: [],
113-
[ClusterTypes.TENDBSINGLE]: [],
114-
[ClusterTypes.TENDBCLUSTER]: [],
115-
});
111+
const lastValues = reactive<Record<string, ClusterInfo[]>>({});
116112

117113
// const renderCom = computed(
118114
// () => {
@@ -154,7 +150,7 @@
154150
};
155151

156152
const handleSubmit = () => {
157-
emits('change', lastValues);
153+
emits('change', Object.values(lastValues).flat());
158154
handleClose();
159155
};
160156

dbm-ui/frontend/src/views/cluster-standardize/components/mysql/Index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@
122122
};
123123

124124
// 从集群选择器选择确认后
125-
const handelClusterChange = (data: Record<string, ClusterInfo[]>) => {
126-
selected.value = data;
125+
const handelClusterChange = (data: ClusterInfo[]) => {
127126
const newList = Object.values(data)
128127
.flat()
129128
.reduce<IDataRow[]>((result, item) => {
130129
const domain = item.immute_domain;
131130
if (!domainMemo[domain]) {
132-
result.push(createRowData(item));
133131
domainMemo[domain] = true;
132+
result.push(createRowData(item));
133+
selected.value[item.cluster_type].push(item);
134134
}
135135
return result;
136136
}, []);

dbm-ui/frontend/src/views/cluster-standardize/components/tendbcluster/Index.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@
121121
};
122122

123123
// 从集群选择器选择确认后
124-
const handelClusterChange = (data: Record<string, ClusterInfo[]>) => {
125-
selected.value = data;
124+
const handelClusterChange = (data: ClusterInfo[]) => {
126125
const newList = Object.values(data)
127126
.flat()
128127
.reduce<IDataRow[]>((result, item) => {
129128
const domain = item.immute_domain;
130129
if (!domainMemo[domain]) {
131-
result.push(createRowData(item));
132130
domainMemo[domain] = true;
131+
result.push(createRowData(item));
132+
selected.value[item.cluster_type].push(item);
133133
}
134134
return result;
135135
}, []);

0 commit comments

Comments
 (0)