f67ab687 by lihua

fix: 华为云obs数据库类型接口联调

1 parent 3a5b041c
......@@ -1718,7 +1718,7 @@ onBeforeMount(() => {
if (res.code == proxy.$passCode) {
dataSourceList.value = res.data || [];
let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid');
item && (item.options = dataSourceList.value);
item && (item.options = dataSourceList.value.filter(d => d.databaseType !== 'obs'));
} else {
proxy.$ElMessage.error(res.msg);
}
......
......@@ -333,8 +333,8 @@ const contents: any = ref({
{
type: 'radio-group',
label: '是否https协议',
field: 'isHttps',
default: '',
field: 'isHttpsProtocol',
default: 'Y',
required: true,
visible: false,
options: [
......@@ -955,7 +955,7 @@ const dialogInfo = ref({
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
textBtns: [{ type: "primary", label: "连通测试", value: "connect" }],
},
......@@ -1007,9 +1007,9 @@ const setFormItems = (name, info: any = null) => {
child.default = info[child.field] ?? "";
}
});
} else if (item.field == 'isHttps') {
} else if (item.field == 'isHttpsProtocol') {
item.visible = info.databaseType == "obs";
item.default = info[item.field] || "N";
item.default = info[item.field] || "Y";
} else if (item.field == 'bizSystem') {
item.visible = info.systemLayer == '业务系统';
item.default = info[item.field] || "";
......@@ -1019,6 +1019,8 @@ const setFormItems = (name, info: any = null) => {
if (item.field == 'host') {
item.label = info.databaseType == "obs" ? "地址" : "服务器";
contentFormInfo.rules.host[0].message = info.databaseType == "obs" ? "请填写地址" : "请填写服务器IP地址";
} else if (item.field == 'port') {
item.visible = info.databaseType != "obs";
} else if (item.field == 'logonUser') {
item.label = info.databaseType == "obs" ? "凭证ID" : "用户名";
contentFormInfo.rules.logonUser[0].message = info.databaseType == "obs" ? "请填写凭证ID" : "请填写用户名";
......@@ -1029,9 +1031,6 @@ const setFormItems = (name, info: any = null) => {
item.label = info.databaseType == "obs" ? "桶名称" : "数据库名";
contentFormInfo.rules.databaseNameEn[0].message = info.databaseType == "obs" ? "请填写桶名称" : "请填写数据库名";
}
else {
item.default = info[item.field] || "";
}
});
} else {
formItems.value.map((item) => {
......@@ -1257,10 +1256,12 @@ const dialogBtnClick = (btn, info) => {
feLoadUrl: info.feLoadUrl,
beLoadUrl: info.beLoadUrl,
dorisJdbcUrl: info.dorisJdbcUrl,
isHttps: info.isHttps,
isHttpsProtocol: info.isHttpsProtocol,
};
dialogInfo.value.footer.btns[1].loading = true;
addDataSource(params)
.then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
if (res.code == proxy.$passCode) {
getFirstPageData();
ElMessage({
......@@ -1277,6 +1278,7 @@ const dialogBtnClick = (btn, info) => {
}
})
.catch(() => {
dialogInfo.value.footer.btns[1].loading = false;
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
});
} else {
......@@ -1292,11 +1294,13 @@ const dialogBtnClick = (btn, info) => {
feLoadUrl: info.feLoadUrl,
beLoadUrl: info.beLoadUrl,
dorisJdbcUrl: info.dorisJdbcUrl,
isHttps: info.isHttps,
isHttpsProtocol: info.isHttpsProtocol,
};
params.guid = currTableData.value.guid;
dialogInfo.value.footer.btns[1].loading = true;
updateDataSource(params)
.then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
if (res.code == proxy.$passCode) {
getTableData();
ElMessage({
......@@ -1313,6 +1317,7 @@ const dialogBtnClick = (btn, info) => {
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
})
.catch(() => {
dialogInfo.value.footer.btns[1].loading = false;
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
});
}
......@@ -1325,7 +1330,7 @@ const dialogBtnClick = (btn, info) => {
logonUser: info.logonUser,
password: info.password,
linkage: info.linkage,
isHttps: info.isHttps,
isHttpsProtocol: info.isHttpsProtocol,
};
checkDataSourceConnectTest(params).then((res: any) => {
if (res.code == proxy.$passCode) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!