fix(接口测试): 修复复制数据源名称,名称显示不正确的缺陷
--bug=1037631 --user=王孝刚 【项目管理】环境管理-数据库-复制数据源-名称显示不正确 https://www.tapd.cn/55049933/s/1481238
This commit is contained in:
parent
bf3ddfec21
commit
4e08283e27
|
@ -222,6 +222,13 @@
|
|||
if (errors) {
|
||||
return;
|
||||
}
|
||||
const isExist = store.currentEnvDetailInfo.config.dataSources.some(
|
||||
(item) => item.dataSource === form.value.dataSource && item.id !== form.value.id
|
||||
);
|
||||
if (isExist) {
|
||||
Message.error(t('project.environmental.database.nameIsExist'));
|
||||
return;
|
||||
}
|
||||
const { driverId } = form.value;
|
||||
try {
|
||||
const index = store.currentEnvDetailInfo.config.dataSources.findIndex((item: any) => item.id === form.value.id);
|
||||
|
@ -230,7 +237,6 @@
|
|||
} else if (index > -1 && props.isCopy) {
|
||||
const insertItem = {
|
||||
...form.value,
|
||||
dataSource: `copy_${form.value.dataSource}`,
|
||||
id: getGenerateId(),
|
||||
driver: driverOption.value.find((item) => item.value === driverId)?.label,
|
||||
};
|
||||
|
@ -262,12 +268,20 @@
|
|||
(item) => item.id === props.currentId
|
||||
) as DataSourceItem;
|
||||
if (currentItem) {
|
||||
form.value = {
|
||||
...currentItem,
|
||||
};
|
||||
if (props.isCopy) {
|
||||
form.value = {
|
||||
...currentItem,
|
||||
id: '',
|
||||
dataSource: `copy_${currentItem.dataSource}`,
|
||||
};
|
||||
} else {
|
||||
form.value = {
|
||||
...currentItem,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
formReset();
|
||||
}
|
||||
} else {
|
||||
formReset();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -123,4 +123,5 @@ export default {
|
|||
'project.environmental.env.deleteGroup': 'Whether to delete the environment group `{name}`?',
|
||||
'project.environmental.env.deleteGroupTip':
|
||||
'Deleting it will cause scenes that reference this environment group to fail to execute properly!',
|
||||
'project.environmental.database.nameIsExist': 'Database name already exists',
|
||||
};
|
||||
|
|
|
@ -127,4 +127,5 @@ export default {
|
|||
'project.environmental.env.deleteTip': '删除后会导致引用此环境的场景无法正常执行',
|
||||
'project.environmental.env.deleteGroup': '是否删除环境组 `{name}`?',
|
||||
'project.environmental.env.deleteGroupTip': '删除后会导致引用此环境组的场景无法正常执行',
|
||||
'project.environmental.database.nameIsExist': '数据源名称已存在',
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue