Commit 1eb11b8b by 莫晓莉

777

parent ada47077
......@@ -47,3 +47,12 @@ export function getRepositoryTypeList(data) {
method: 'post'
})
}
// 检查是否可以连接上资源库
export function checkConnect(data) {
return request({
url: 'kettle/repository/checkConnect',
data,
method: 'post'
})
}
......@@ -96,6 +96,16 @@
</el-option>
</el-select>
</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-select v-model="form.databaseAccess" clearable placeholder="请选择">
<el-option
......@@ -126,11 +136,11 @@
</el-row>
<span slot="footer" class="dialog-footer">
<el-button class="btn-brush" type="success" icon="el-icon-check" @click="closeModal">测试链接</el-button>
<el-button v-if="curId" class="btn-brush" type="success" icon="el-icon-check" @click="update()">修改</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-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 class="btn-brush" type="success" icon="el-icon-plus" @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="closeModal()">取消</el-button>
</span>
</el-dialog>
<!-- 新增和编辑弹窗end -->
......@@ -145,7 +155,8 @@ import {
update,
deleteList,
getRepositoryTypeList,
getAccess
getAccess,
checkConnect
} from "@/api/oracle/oracle";
// import { getToken } from "@/utils/auth";
export default {
......@@ -221,22 +232,17 @@ export default {
],
},
options: [{
value: '选项1',
label: '黄金糕'
code: '选项1',
}, {
value: '选项2',
label: '双皮奶'
code: '选项2',
}, {
value: '选项3',
label: '蚵仔煎'
code: '选项3',
}, {
value: '选项4',
label: '龙须面'
code: '选项4',
}, {
value: '选项5',
label: '北京烤鸭'
code: '选项5',
}],
value: '',
// value: '',
dialogMsgAdd:'添加数据库资源库',
dialogMsgEdit:'编辑数据库资源库',
curId:null,
......@@ -310,15 +316,12 @@ export default {
},
// 模态框操作
closeModal() {
this.centerDialogVisible = !this.centerDialogVisible
if (!this.centerDialogVisible) {
// 关闭时的操作
this.row = {}
this.form = {}
this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果
console.log('打开弹窗------------------',this.centerDialogVisible);
this.centerDialogVisible = !this.centerDialogVisible;
this.row = {};
this.form = {};
this.curId=null;
this.$refs['formName'].clearValidate();//移除该表单项的校验结果
}
this.$refs['formName'].resetFields();//对该表单项进行重置,将其值重置为初始值并移除校验结果
},
......@@ -333,12 +336,6 @@ export default {
this.getKettleRepositoryList();
},
// 新增数据库资源库
// addModal() {
//       console.log('新增时候id为null');
// this.centerDialogVisible=true;
//       
//     },
//编辑数据库资源库
editModal(row) {
this.curId=row.id;
......@@ -385,6 +382,24 @@ export default {
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