fix: 数据源修改

This commit is contained in:
100011797 2023-03-24 16:17:40 +08:00
parent d45ff4431b
commit cfa898e12b
2 changed files with 17 additions and 18 deletions

View File

@ -367,23 +367,22 @@ const clickDel = (row: any) => {
const clickSave = () => {
formRef.value.validate().then((_data: any) => {
console.log(_data)
// const columns = cloneDeep(table.data);
// columns.forEach((item) => delete item.index);
// if (!columns.length) {
// onlyMessage('', 'error');
// return;
// }
// const params = {
// name: leftData.selectedKeys[0],
// columns,
// };
// saveTable_api(id, params).then((resp) => {
// if (resp.status === 200) {
// message.success('');
// queryTables(params.name);
// }
// });
const columns = cloneDeep(table.data);
columns.forEach((item) => delete item.index);
if (!columns.length) {
onlyMessage('请配置数据源字段', 'error');
return;
}
const params = {
name: leftData.selectedKeys[0],
columns,
};
saveTable_api(id, params).then((resp) => {
if (resp.status === 200) {
message.success('操作成功');
queryTables(params.name);
}
});
});
};

View File

@ -204,7 +204,7 @@ const dialogTitle = computed(() =>
const loading = ref(false);
const checkUrl = (_rule: Rule, value: string): Promise<any> => {
if (!value) return Promise.reject('请输入URL');
if (!value) return Promise.resolve();
const arr = value.split(':');
if (arr?.[0] === 'jdbc' || arr?.[0] === 'r2dbc') {
return Promise.resolve();