fix(structure): initialize dialogs and edit clickhouse columns

This commit is contained in:
t8y2
2026-05-19 13:31:42 +08:00
parent 5b3b69f7fb
commit 69ee7f2d8b
18 changed files with 325 additions and 120 deletions
@@ -412,21 +412,25 @@ watch(sourceTable, (table, previous) => {
}
});
watch(targetTable, () => clearResult());
watch(open, async (value) => {
if (!value) return;
result.value = null;
syncSql.value = "";
if (props.prefillConnectionId) {
sourceConnectionId.value = props.prefillConnectionId;
await loadDatabases(props.prefillConnectionId, "source");
if (props.prefillDatabase) sourceDatabase.value = props.prefillDatabase;
if (props.prefillDatabase) await loadSchemas("source", props.prefillSchema);
if (props.prefillTable) {
await loadTables("source");
if (sourceTables.value.includes(props.prefillTable)) sourceTable.value = props.prefillTable;
watch(
open,
async (value) => {
if (!value) return;
result.value = null;
syncSql.value = "";
if (props.prefillConnectionId) {
sourceConnectionId.value = props.prefillConnectionId;
await loadDatabases(props.prefillConnectionId, "source");
if (props.prefillDatabase) sourceDatabase.value = props.prefillDatabase;
if (props.prefillDatabase) await loadSchemas("source", props.prefillSchema);
if (props.prefillTable) {
await loadTables("source");
if (sourceTables.value.includes(props.prefillTable)) sourceTable.value = props.prefillTable;
}
}
}
});
},
{ immediate: true },
);
</script>
<template>
@@ -356,23 +356,27 @@ watch(targetDatabase, (database) => {
watch(sourceSchema, () => resetResult());
watch(targetSchema, () => resetResult());
watch(open, async (val) => {
if (val) {
step.value = "select";
diffs.value = [];
syncErrors.value = [];
executedCount.value = 0;
executeTotal.value = 0;
if (props.prefillConnectionId) {
sourceConnectionId.value = props.prefillConnectionId;
await loadDatabases(props.prefillConnectionId, "source");
if (props.prefillDatabase) {
sourceDatabase.value = props.prefillDatabase;
await loadSchemas("source", props.prefillSchema);
watch(
open,
async (val) => {
if (val) {
step.value = "select";
diffs.value = [];
syncErrors.value = [];
executedCount.value = 0;
executeTotal.value = 0;
if (props.prefillConnectionId) {
sourceConnectionId.value = props.prefillConnectionId;
await loadDatabases(props.prefillConnectionId, "source");
if (props.prefillDatabase) {
sourceDatabase.value = props.prefillDatabase;
await loadSchemas("source", props.prefillSchema);
}
}
}
}
});
},
{ immediate: true },
);
</script>
<template>