From b584dbd6d90bdf9ea8985c432c884189ff5d1809 Mon Sep 17 00:00:00 2001
From: lwj <3529558005@qq.com>
Date: Fri, 23 Aug 2024 00:48:38 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=BA=90?=
=?UTF-8?q?=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/etl/switch.js | 11 ++++++++++-
src/views/etl/switch/index.vue | 34 ++++++++++++++++++++++++++++++++--
2 files changed, 42 insertions(+), 3 deletions(-)
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实例)",