I5QFVD:支持选择视图表迁移同步

This commit is contained in:
inrgihc
2022-09-17 22:39:22 +08:00
parent 898106d409
commit ce8e23145a
63 changed files with 545 additions and 302 deletions

View File

@@ -92,6 +92,20 @@
:value="item"></el-option>
</el-select>
</el-form-item>
<el-form-item label="源端表类型"
label-width="240px"
:required=true
prop="tableType"
style="width:65%">
<el-select placeholder="请选择表类型"
@change="selectCreateChangedTableType"
v-model="createform.tableType">
<el-option label="物理表"
value="TABLE"></el-option>
<el-option label="视图表"
value="VIEW"></el-option>
</el-select>
</el-form-item>
<el-form-item label="配置方式"
label-width="240px"
:required=true
@@ -297,6 +311,7 @@
label="CRON表达式">{{createform.cronExpression}}</el-descriptions-item>
<el-descriptions-item label="源端数据源">[{{createform.sourceConnectionId}}]{{sourceConnection.name}}</el-descriptions-item>
<el-descriptions-item label="源端schema">{{createform.sourceSchema}}</el-descriptions-item>
<el-descriptions-item label="源端表类型">{{createform.tableType}}</el-descriptions-item>
<el-descriptions-item label="源端表选择方式">
<span v-if="createform.includeOrExclude == 'INCLUDE'">
包含表
@@ -434,6 +449,7 @@ export default {
cronExpression: "",
sourceConnectionId: '请选择',
sourceSchema: "",
tableType: "TABLE",
includeOrExclude: "",
sourceTables: [],
tableNameMapper: [],
@@ -476,6 +492,14 @@ export default {
trigger: "change"
}
],
tableType: [
{
required: true,
type: 'string',
message: "表类型必须选择",
trigger: "change"
}
],
includeOrExclude: [
{
required: true,
@@ -584,16 +608,55 @@ export default {
},
selectCreateChangedSourceSchema: function (value) {
this.sourceSchemaTables = [];
this.$http.get(
"/dbswitch/admin/api/v1/connection/tables/get/" + this.createform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在制定Schema下的表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
if ('TABLE' === this.createform.tableType) {
this.$http.get(
"/dbswitch/admin/api/v1/connection/tables/get/" + this.createform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的物理表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
} else {
this.$http.get(
"/dbswitch/admin/api/v1/connection/views/get/" + this.createform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的视图表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
}
},
selectCreateChangedTableType: function (value) {
this.sourceSchemaTables = [];
if ('TABLE' === value) {
this.$http.get(
"/dbswitch/admin/api/v1/connection/tables/get/" + this.createform.sourceConnectionId + "?schema=" + this.createform.sourceSchema
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的物理表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
} else {
this.$http.get(
"/dbswitch/admin/api/v1/connection/views/get/" + this.createform.sourceConnectionId + "?schema=" + this.createform.sourceSchema
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的视图表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
}
},
selectChangedTargetConnection: function (value) {
this.targetConnection = this.connectionNameList.find(
@@ -752,6 +815,7 @@ export default {
config: {
sourceConnectionId: this.createform.sourceConnectionId,
sourceSchema: this.createform.sourceSchema,
tableType: this.createform.tableType,
includeOrExclude: this.createform.includeOrExclude,
sourceTables: this.createform.sourceTables,
targetConnectionId: this.createform.targetConnectionId,

View File

@@ -92,6 +92,20 @@
:value="item"></el-option>
</el-select>
</el-form-item>
<el-form-item label="源端表类型"
label-width="240px"
:required=true
prop="tableType"
style="width:65%">
<el-select placeholder="请选择表类型"
@change="selectUpdateChangedTableType"
v-model="updateform.tableType">
<el-option label="物理表"
value="TABLE"></el-option>
<el-option label="视图表"
value="VIEW"></el-option>
</el-select>
</el-form-item>
<el-form-item label="配置方式"
label-width="240px"
:required=true
@@ -297,6 +311,7 @@
label="CRON表达式">{{updateform.cronExpression}}</el-descriptions-item>
<el-descriptions-item label="源端数据源">[{{updateform.sourceConnectionId}}]{{sourceConnection.name}}</el-descriptions-item>
<el-descriptions-item label="源端schema">{{updateform.sourceSchema}}</el-descriptions-item>
<el-descriptions-item label="源端表类型">{{updateform.tableType}}</el-descriptions-item>
<el-descriptions-item label="源端表选择方式">
<span v-if="updateform.includeOrExclude == 'INCLUDE'">
包含表
@@ -440,6 +455,7 @@ export default {
cronExpression: "",
sourceConnectionId: '请选择',
sourceSchema: "",
tableType:"TABLE",
includeOrExclude: "",
sourceTables: [],
tableNameMapper: [],
@@ -482,6 +498,14 @@ export default {
trigger: "change"
}
],
tableType: [
{
required: true,
type: 'string',
message: "表类型必须选择",
trigger: "change"
}
],
includeOrExclude: [
{
required: true,
@@ -589,6 +613,7 @@ export default {
cronExpression: detail.cronExpression,
sourceConnectionId: detail.configuration.sourceConnectionId,
sourceSchema: detail.configuration.sourceSchema,
tableType: detail.configuration.tableType,
includeOrExclude: detail.configuration.includeOrExclude,
sourceTables: detail.configuration.sourceTables,
tableNameMapper: detail.configuration.tableNameMapper,
@@ -632,16 +657,55 @@ export default {
},
selectUpdateChangedSourceSchema: function (value) {
this.sourceSchemaTables = [];
this.$http.get(
"/dbswitch/admin/api/v1/connection/tables/get/" + this.updateform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在制定Schema下的表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
if ('TABLE' === this.updateform.tableType) {
this.$http.get(
"/dbswitch/admin/api/v1/connection/tables/get/" + this.updateform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的物理表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
} else {
this.$http.get(
"/dbswitch/admin/api/v1/connection/views/get/" + this.updateform.sourceConnectionId + "?schema=" + value
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的视图表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
}
},
selectUpdateChangedTableType: function (value) {
this.sourceSchemaTables = [];
if ('TABLE' === value) {
this.$http.get(
"/dbswitch/admin/api/v1/connection/tables/get/" + this.updateform.sourceConnectionId + "?schema=" + this.updateform.sourceSchema
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的物理表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
} else {
this.$http.get(
"/dbswitch/admin/api/v1/connection/views/get/" + this.updateform.sourceConnectionId + "?schema=" + this.updateform.sourceSchema
).then(res => {
if (0 === res.data.code) {
this.sourceSchemaTables = res.data.data;
} else {
this.$message.error("查询来源端数据库在指定Schema下的视图表列表失败," + res.data.message);
this.sourceSchemaTables = [];
}
});
}
},
selectChangedTargetConnection: function (value) {
this.targetConnection = this.connectionNameList.find(
@@ -809,6 +873,7 @@ export default {
config: {
sourceConnectionId: this.updateform.sourceConnectionId,
sourceSchema: this.updateform.sourceSchema,
tableType: this.updateform.tableType,
includeOrExclude: this.updateform.includeOrExclude,
sourceTables: this.updateform.sourceTables,
targetConnectionId: this.updateform.targetConnectionId,