增加数据源列表
parent
da018224c8
commit
b584dbd6d9
|
@ -31,7 +31,7 @@ export function insertAdd(data){
|
||||||
//获取基本信息
|
//获取基本信息
|
||||||
export function getInfo(id){
|
export function getInfo(id){
|
||||||
return request({
|
return request({
|
||||||
url: "/source/source/id",
|
url: "/source/source/"+id,
|
||||||
method: "get",
|
method: "get",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -47,4 +47,13 @@ export function connectionTest(data){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//删除
|
||||||
|
export function deleteSource(ids){
|
||||||
|
return request({
|
||||||
|
url: "/source/source/"+ids,
|
||||||
|
method: "delete",
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,15 @@
|
||||||
>新增
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
icon="el-icon-delete"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
@click="deleteSourceByIds()"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
|
||||||
<el-dialog title="添加数据源接入" :visible.sync="dialogFormVisible">
|
<el-dialog title="添加数据源接入" :visible.sync="dialogFormVisible">
|
||||||
|
|
||||||
|
@ -208,6 +217,7 @@ import {selectSourceList} from "@/api/etl/switch";
|
||||||
import {selectSourceExport} from "@/api/etl/switch";
|
import {selectSourceExport} from "@/api/etl/switch";
|
||||||
import {connectionTest} from "@/api/etl/switch";
|
import {connectionTest} from "@/api/etl/switch";
|
||||||
import {insertAdd} from "@/api/etl/switch";
|
import {insertAdd} from "@/api/etl/switch";
|
||||||
|
import {deleteSource} from "@/api/etl/switch";
|
||||||
import {getInfo} from "@/api/etl/switch";
|
import {getInfo} from "@/api/etl/switch";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -218,6 +228,7 @@ export default {
|
||||||
//这里存放数据"
|
//这里存放数据"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
ids:[],
|
||||||
dialogFormVisible:false,
|
dialogFormVisible:false,
|
||||||
SourceReq:{
|
SourceReq:{
|
||||||
|
|
||||||
|
@ -234,6 +245,20 @@ export default {
|
||||||
watch: {},
|
watch: {},
|
||||||
//方法集合",
|
//方法集合",
|
||||||
methods: {
|
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(){
|
textP(){
|
||||||
connectionTest(this.sourceAddReq).then(res=>{
|
connectionTest(this.sourceAddReq).then(res=>{
|
||||||
if (res.code===200){
|
if (res.code===200){
|
||||||
|
@ -245,7 +270,9 @@ export default {
|
||||||
},
|
},
|
||||||
addSource(){
|
addSource(){
|
||||||
insertAdd(this.sourceAddReq).then(res=>{
|
insertAdd(this.sourceAddReq).then(res=>{
|
||||||
|
if(res.code===200){
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//测试连接
|
//测试连接
|
||||||
|
@ -271,7 +298,10 @@ export default {
|
||||||
selectSourceExport(this.SourceReq).then();
|
selectSourceExport(this.SourceReq).then();
|
||||||
},
|
},
|
||||||
handleSelectionChange(row){
|
handleSelectionChange(row){
|
||||||
|
this.ids=[];
|
||||||
|
for (let rowKey in row) {
|
||||||
|
this.ids.push(row[rowKey].id)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
|
Loading…
Reference in New Issue