f67ab687 by lihua

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

1 parent 3a5b041c
...@@ -1718,7 +1718,7 @@ onBeforeMount(() => { ...@@ -1718,7 +1718,7 @@ onBeforeMount(() => {
1718 if (res.code == proxy.$passCode) { 1718 if (res.code == proxy.$passCode) {
1719 dataSourceList.value = res.data || []; 1719 dataSourceList.value = res.data || [];
1720 let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); 1720 let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid');
1721 item && (item.options = dataSourceList.value); 1721 item && (item.options = dataSourceList.value.filter(d => d.databaseType !== 'obs'));
1722 } else { 1722 } else {
1723 proxy.$ElMessage.error(res.msg); 1723 proxy.$ElMessage.error(res.msg);
1724 } 1724 }
......
...@@ -333,8 +333,8 @@ const contents: any = ref({ ...@@ -333,8 +333,8 @@ const contents: any = ref({
333 { 333 {
334 type: 'radio-group', 334 type: 'radio-group',
335 label: '是否https协议', 335 label: '是否https协议',
336 field: 'isHttps', 336 field: 'isHttpsProtocol',
337 default: '', 337 default: 'Y',
338 required: true, 338 required: true,
339 visible: false, 339 visible: false,
340 options: [ 340 options: [
...@@ -955,7 +955,7 @@ const dialogInfo = ref({ ...@@ -955,7 +955,7 @@ const dialogInfo = ref({
955 footer: { 955 footer: {
956 btns: [ 956 btns: [
957 { type: "default", label: "取消", value: "cancel" }, 957 { type: "default", label: "取消", value: "cancel" },
958 { type: "primary", label: "确定", value: "submit" }, 958 { type: "primary", label: "确定", value: "submit", loading: false },
959 ], 959 ],
960 textBtns: [{ type: "primary", label: "连通测试", value: "connect" }], 960 textBtns: [{ type: "primary", label: "连通测试", value: "connect" }],
961 }, 961 },
...@@ -1007,9 +1007,9 @@ const setFormItems = (name, info: any = null) => { ...@@ -1007,9 +1007,9 @@ const setFormItems = (name, info: any = null) => {
1007 child.default = info[child.field] ?? ""; 1007 child.default = info[child.field] ?? "";
1008 } 1008 }
1009 }); 1009 });
1010 } else if (item.field == 'isHttps') { 1010 } else if (item.field == 'isHttpsProtocol') {
1011 item.visible = info.databaseType == "obs"; 1011 item.visible = info.databaseType == "obs";
1012 item.default = info[item.field] || "N"; 1012 item.default = info[item.field] || "Y";
1013 } else if (item.field == 'bizSystem') { 1013 } else if (item.field == 'bizSystem') {
1014 item.visible = info.systemLayer == '业务系统'; 1014 item.visible = info.systemLayer == '业务系统';
1015 item.default = info[item.field] || ""; 1015 item.default = info[item.field] || "";
...@@ -1019,6 +1019,8 @@ const setFormItems = (name, info: any = null) => { ...@@ -1019,6 +1019,8 @@ const setFormItems = (name, info: any = null) => {
1019 if (item.field == 'host') { 1019 if (item.field == 'host') {
1020 item.label = info.databaseType == "obs" ? "地址" : "服务器"; 1020 item.label = info.databaseType == "obs" ? "地址" : "服务器";
1021 contentFormInfo.rules.host[0].message = info.databaseType == "obs" ? "请填写地址" : "请填写服务器IP地址"; 1021 contentFormInfo.rules.host[0].message = info.databaseType == "obs" ? "请填写地址" : "请填写服务器IP地址";
1022 } else if (item.field == 'port') {
1023 item.visible = info.databaseType != "obs";
1022 } else if (item.field == 'logonUser') { 1024 } else if (item.field == 'logonUser') {
1023 item.label = info.databaseType == "obs" ? "凭证ID" : "用户名"; 1025 item.label = info.databaseType == "obs" ? "凭证ID" : "用户名";
1024 contentFormInfo.rules.logonUser[0].message = info.databaseType == "obs" ? "请填写凭证ID" : "请填写用户名"; 1026 contentFormInfo.rules.logonUser[0].message = info.databaseType == "obs" ? "请填写凭证ID" : "请填写用户名";
...@@ -1029,9 +1031,6 @@ const setFormItems = (name, info: any = null) => { ...@@ -1029,9 +1031,6 @@ const setFormItems = (name, info: any = null) => {
1029 item.label = info.databaseType == "obs" ? "桶名称" : "数据库名"; 1031 item.label = info.databaseType == "obs" ? "桶名称" : "数据库名";
1030 contentFormInfo.rules.databaseNameEn[0].message = info.databaseType == "obs" ? "请填写桶名称" : "请填写数据库名"; 1032 contentFormInfo.rules.databaseNameEn[0].message = info.databaseType == "obs" ? "请填写桶名称" : "请填写数据库名";
1031 } 1033 }
1032 else {
1033 item.default = info[item.field] || "";
1034 }
1035 }); 1034 });
1036 } else { 1035 } else {
1037 formItems.value.map((item) => { 1036 formItems.value.map((item) => {
...@@ -1257,10 +1256,12 @@ const dialogBtnClick = (btn, info) => { ...@@ -1257,10 +1256,12 @@ const dialogBtnClick = (btn, info) => {
1257 feLoadUrl: info.feLoadUrl, 1256 feLoadUrl: info.feLoadUrl,
1258 beLoadUrl: info.beLoadUrl, 1257 beLoadUrl: info.beLoadUrl,
1259 dorisJdbcUrl: info.dorisJdbcUrl, 1258 dorisJdbcUrl: info.dorisJdbcUrl,
1260 isHttps: info.isHttps, 1259 isHttpsProtocol: info.isHttpsProtocol,
1261 }; 1260 };
1261 dialogInfo.value.footer.btns[1].loading = true;
1262 addDataSource(params) 1262 addDataSource(params)
1263 .then((res: any) => { 1263 .then((res: any) => {
1264 dialogInfo.value.footer.btns[1].loading = false;
1264 if (res.code == proxy.$passCode) { 1265 if (res.code == proxy.$passCode) {
1265 getFirstPageData(); 1266 getFirstPageData();
1266 ElMessage({ 1267 ElMessage({
...@@ -1277,6 +1278,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -1277,6 +1278,7 @@ const dialogBtnClick = (btn, info) => {
1277 } 1278 }
1278 }) 1279 })
1279 .catch(() => { 1280 .catch(() => {
1281 dialogInfo.value.footer.btns[1].loading = false;
1280 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) 1282 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
1281 }); 1283 });
1282 } else { 1284 } else {
...@@ -1292,11 +1294,13 @@ const dialogBtnClick = (btn, info) => { ...@@ -1292,11 +1294,13 @@ const dialogBtnClick = (btn, info) => {
1292 feLoadUrl: info.feLoadUrl, 1294 feLoadUrl: info.feLoadUrl,
1293 beLoadUrl: info.beLoadUrl, 1295 beLoadUrl: info.beLoadUrl,
1294 dorisJdbcUrl: info.dorisJdbcUrl, 1296 dorisJdbcUrl: info.dorisJdbcUrl,
1295 isHttps: info.isHttps, 1297 isHttpsProtocol: info.isHttpsProtocol,
1296 }; 1298 };
1297 params.guid = currTableData.value.guid; 1299 params.guid = currTableData.value.guid;
1300 dialogInfo.value.footer.btns[1].loading = true;
1298 updateDataSource(params) 1301 updateDataSource(params)
1299 .then((res: any) => { 1302 .then((res: any) => {
1303 dialogInfo.value.footer.btns[1].loading = false;
1300 if (res.code == proxy.$passCode) { 1304 if (res.code == proxy.$passCode) {
1301 getTableData(); 1305 getTableData();
1302 ElMessage({ 1306 ElMessage({
...@@ -1313,6 +1317,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -1313,6 +1317,7 @@ const dialogBtnClick = (btn, info) => {
1313 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) 1317 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
1314 }) 1318 })
1315 .catch(() => { 1319 .catch(() => {
1320 dialogInfo.value.footer.btns[1].loading = false;
1316 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) 1321 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
1317 }); 1322 });
1318 } 1323 }
...@@ -1325,7 +1330,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -1325,7 +1330,7 @@ const dialogBtnClick = (btn, info) => {
1325 logonUser: info.logonUser, 1330 logonUser: info.logonUser,
1326 password: info.password, 1331 password: info.password,
1327 linkage: info.linkage, 1332 linkage: info.linkage,
1328 isHttps: info.isHttps, 1333 isHttpsProtocol: info.isHttpsProtocol,
1329 }; 1334 };
1330 checkDataSourceConnectTest(params).then((res: any) => { 1335 checkDataSourceConnectTest(params).then((res: any) => {
1331 if (res.code == proxy.$passCode) { 1336 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!