处理测试接口的校验问题,

处理候去db name 接口的参数问题
This commit is contained in:
任珮宇 2023-11-15 14:28:28 +08:00
parent 9c30a2d773
commit 7136b65158
2 changed files with 9 additions and 2 deletions

View File

@ -131,7 +131,6 @@ export default {
},
mounted() {
this.getDbList()
this.getDbNameList()
},
methods: {
filterOption(input, option) {
@ -141,6 +140,7 @@ export default {
getAction('/sysDatabase/sourceList').then((res) => {
if (res.success) {
this.name = this.$route.query.id || res.result[0].sourceId
this.getDbNameList()
this.DbOptions = res.result.map((item) => {
return {
label: item.sourceName,
@ -172,6 +172,7 @@ export default {
},
onDbChange(val) {
this.name = val
this.getDbNameList()
},
ondbNameChange(val) {
this.loading = true

View File

@ -83,7 +83,7 @@
v-decorator="[
'name',
{
rules: [{ required: true, message: 'Please input name!' }],
rules: [{ required: nameRequired, message: 'Please input name!' }],
initialVale: this.formVal.name,
},
]"
@ -237,6 +237,7 @@ export default {
},
data() {
return {
nameRequired: false,
loading: false,
isAdd: true,
visible: false,
@ -443,6 +444,7 @@ export default {
this.currentId = ''
},
onTest() {
this.nameRequired = false
this.form.validateFields((err, values) => {
if (!err) {
let loading = this.$message.loading('连接中……', 0)
@ -460,6 +462,10 @@ export default {
})
},
onSave() {
this.nameRequired = true
this.$nextTick(() => {
this.form.validateFields(['name'], { force: true })
})
this.form.validateFields((err, values) => {
if (!err) {
if (this.isAdd) {