File tree 3 files changed +9
-13
lines changed
dbm-ui/frontend/src/views/cluster-standardize/components
3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 96
96
}
97
97
98
98
interface Emits {
99
- (e: 'change', value: Record<string, ClusterInfo[]> ): void;
99
+ (e: 'change', value: ClusterInfo[]): void;
100
100
}
101
101
102
102
const props = defineProps<Props>();
108
108
});
109
109
110
110
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[]>>({});
116
112
117
113
// const renderCom = computed(
118
114
// () => {
154
150
};
155
151
156
152
const handleSubmit = () => {
157
- emits('change', lastValues);
153
+ emits('change', Object.values( lastValues).flat() );
158
154
handleClose();
159
155
};
160
156
Original file line number Diff line number Diff line change 122
122
};
123
123
124
124
// 从集群选择器选择确认后
125
- const handelClusterChange = (data: Record<string, ClusterInfo[]>) => {
126
- selected.value = data;
125
+ const handelClusterChange = (data: ClusterInfo[]) => {
127
126
const newList = Object.values(data)
128
127
.flat()
129
128
.reduce<IDataRow[]>((result, item) => {
130
129
const domain = item.immute_domain;
131
130
if (!domainMemo[domain]) {
132
- result.push(createRowData(item));
133
131
domainMemo[domain] = true;
132
+ result.push(createRowData(item));
133
+ selected.value[item.cluster_type].push(item);
134
134
}
135
135
return result;
136
136
}, []);
Original file line number Diff line number Diff line change 121
121
};
122
122
123
123
// 从集群选择器选择确认后
124
- const handelClusterChange = (data: Record<string, ClusterInfo[]>) => {
125
- selected.value = data;
124
+ const handelClusterChange = (data: ClusterInfo[]) => {
126
125
const newList = Object.values(data)
127
126
.flat()
128
127
.reduce<IDataRow[]>((result, item) => {
129
128
const domain = item.immute_domain;
130
129
if (!domainMemo[domain]) {
131
- result.push(createRowData(item));
132
130
domainMemo[domain] = true;
131
+ result.push(createRowData(item));
132
+ selected.value[item.cluster_type].push(item);
133
133
}
134
134
return result;
135
135
}, []);
You can’t perform that action at this time.
0 commit comments