Commit 1eb11b8b by 莫晓莉

777

parent ada47077
...@@ -47,3 +47,12 @@ export function getRepositoryTypeList(data) { ...@@ -47,3 +47,12 @@ export function getRepositoryTypeList(data) {
method: 'post' method: 'post'
}) })
} }
// 检查是否可以连接上资源库
export function checkConnect(data) {
return request({
url: 'kettle/repository/checkConnect',
data,
method: 'post'
})
}
...@@ -96,6 +96,16 @@ ...@@ -96,6 +96,16 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="资源库类型:" prop="type">
<el-select v-model="form.type" clearable placeholder="请选择">
<el-option
v-for="item in options"
:key="item.code"
:label="item.code"
:value="item.code">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="数据库数据访问模式:" prop="databaseAccess"> <el-form-item label="数据库数据访问模式:" prop="databaseAccess">
<el-select v-model="form.databaseAccess" clearable placeholder="请选择"> <el-select v-model="form.databaseAccess" clearable placeholder="请选择">
<el-option <el-option
...@@ -126,11 +136,11 @@ ...@@ -126,11 +136,11 @@
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button class="btn-brush" type="success" icon="el-icon-check" @click="closeModal">测试链接</el-button> <el-button class="btn-brush" type="success" icon="el-icon-check" @click="testLink()">测试链接</el-button>
<el-button v-if="curId" class="btn-brush" type="success" icon="el-icon-check" @click="update()">修改</el-button> <el-button v-if="curId" class="btn-brush" type="success" icon="el-icon-check" @click="update()">保存</el-button>
<el-button v-else class="btn-brush" type="success" icon="el-icon-check" @click="submitForm()">保存</el-button> <el-button v-else class="btn-brush" type="success" icon="el-icon-check" @click="submitForm()">保存</el-button>
<el-button v-if="curId" class="btn-brush" type="success" icon="el-icon-check" @click="centerDialogVisible = false">重置</el-button> <el-button v-if="curId" class="btn-brush" type="success" icon="el-icon-check" @click="resetForm()">重置</el-button>
<el-button class="btn-brush" type="success" icon="el-icon-plus" @click="centerDialogVisible = false">取消</el-button> <el-button class="btn-brush" type="success" icon="el-icon-plus" @click="closeModal()">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 新增和编辑弹窗end --> <!-- 新增和编辑弹窗end -->
...@@ -145,7 +155,8 @@ import { ...@@ -145,7 +155,8 @@ import {
update, update,
deleteList, deleteList,
getRepositoryTypeList, getRepositoryTypeList,
getAccess getAccess,
checkConnect
} from "@/api/oracle/oracle"; } from "@/api/oracle/oracle";
// import { getToken } from "@/utils/auth"; // import { getToken } from "@/utils/auth";
export default { export default {
...@@ -221,22 +232,17 @@ export default { ...@@ -221,22 +232,17 @@ export default {
], ],
}, },
options: [{ options: [{
value: '选项1', code: '选项1',
label: '黄金糕'
}, { }, {
value: '选项2', code: '选项2',
label: '双皮奶'
}, { }, {
value: '选项3', code: '选项3',
label: '蚵仔煎'
}, { }, {
value: '选项4', code: '选项4',
label: '龙须面'
}, { }, {
value: '选项5', code: '选项5',
label: '北京烤鸭'
}], }],
value: '', // value: '',
dialogMsgAdd:'添加数据库资源库', dialogMsgAdd:'添加数据库资源库',
dialogMsgEdit:'编辑数据库资源库', dialogMsgEdit:'编辑数据库资源库',
curId:null, curId:null,
...@@ -310,15 +316,12 @@ export default { ...@@ -310,15 +316,12 @@ export default {
}, },
// 模态框操作 // 模态框操作
closeModal() { closeModal() {
this.centerDialogVisible = !this.centerDialogVisible console.log('打开弹窗------------------',this.centerDialogVisible);
if (!this.centerDialogVisible) { this.centerDialogVisible = !this.centerDialogVisible;
// 关闭时的操作 this.row = {};
this.row = {} this.form = {};
this.form = {}
this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果
this.curId=null; this.curId=null;
this.$refs['formName'].clearValidate();//移除该表单项的校验结果 this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果
}
}, },
...@@ -333,12 +336,6 @@ export default { ...@@ -333,12 +336,6 @@ export default {
this.getKettleRepositoryList(); this.getKettleRepositoryList();
}, },
// 新增数据库资源库
// addModal() {
//       console.log('新增时候id为null');
// this.centerDialogVisible=true;
//       
//     },
//编辑数据库资源库 //编辑数据库资源库
editModal(row) { editModal(row) {
this.curId=row.id; this.curId=row.id;
...@@ -385,6 +382,24 @@ export default { ...@@ -385,6 +382,24 @@ export default {
this.$message.error(res.errMsg) this.$message.error(res.errMsg)
} }
}) })
},
// 重置
resetForm() {
this.form={};
this.$refs['formName'].resetFields();
console.log('重置后this.curId============',this.curId);
this.form.id=this.curId;
},
//测试链接
testLink(){
checkConnect(this.form).then(res=>{
if (res.success) {
this.$message.success('链接成功!');
}else {
this.$message.error(res.errMsg);
}
})
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment