diff --git a/src/api/etl/switch.js b/src/api/etl/switch.js
index 5285931..783ed6b 100644
--- a/src/api/etl/switch.js
+++ b/src/api/etl/switch.js
@@ -31,7 +31,7 @@ export function insertAdd(data){
//获取基本信息
export function getInfo(id){
return request({
- url: "/source/source/id",
+ url: "/source/source/"+id,
method: "get",
})
}
@@ -47,4 +47,13 @@ export function connectionTest(data){
}
+//删除
+export function deleteSource(ids){
+ return request({
+ url: "/source/source/"+ids,
+ method: "delete",
+
+ })
+}
+
diff --git a/src/views/etl/switch/index.vue b/src/views/etl/switch/index.vue
index 77411c8..2420ea2 100644
--- a/src/views/etl/switch/index.vue
+++ b/src/views/etl/switch/index.vue
@@ -46,6 +46,15 @@
>新增
+ 删除
+
+
@@ -208,6 +217,7 @@ import {selectSourceList} from "@/api/etl/switch";
import {selectSourceExport} from "@/api/etl/switch";
import {connectionTest} from "@/api/etl/switch";
import {insertAdd} from "@/api/etl/switch";
+import {deleteSource} from "@/api/etl/switch";
import {getInfo} from "@/api/etl/switch";
export default {
@@ -218,6 +228,7 @@ export default {
//这里存放数据"
return {
+ ids:[],
dialogFormVisible:false,
SourceReq:{
@@ -234,6 +245,20 @@ export default {
watch: {},
//方法集合",
methods: {
+ deleteSourceByIds(){
+ deleteSource(this.ids).then(res=>{
+ if(res.code===200){
+ alert("删除成功");
+ }
+ })
+ },
+ handleDelete(row){
+ deleteSource(row.id).then(res=>{
+ if(res.code===200){
+ alert("删除成功");
+ }
+ })
+ },
textP(){
connectionTest(this.sourceAddReq).then(res=>{
if (res.code===200){
@@ -245,7 +270,9 @@ export default {
},
addSource(){
insertAdd(this.sourceAddReq).then(res=>{
-
+ if(res.code===200){
+ location.reload();
+ }
})
},
//测试连接
@@ -271,7 +298,10 @@ export default {
selectSourceExport(this.SourceReq).then();
},
handleSelectionChange(row){
-
+ this.ids=[];
+ for (let rowKey in row) {
+ this.ids.push(row[rowKey].id)
+ }
},
},
//生命周期 - 创建完成(可以访问当前this实例)",