refactor(接口测试): 数据库配置添加清空按钮
This commit is contained in:
parent
8333c3f77d
commit
c0329ce42a
|
@ -58,7 +58,11 @@
|
||||||
this.currentConfig = new DatabaseConfig();
|
this.currentConfig = new DatabaseConfig();
|
||||||
},
|
},
|
||||||
rowSelect(config) {
|
rowSelect(config) {
|
||||||
this.currentConfig = config;
|
//防止清除后再点击该行无响应
|
||||||
|
this.currentConfig = {};
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.currentConfig = config;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,4 +80,8 @@
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-table {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -39,9 +39,10 @@
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<el-button type="primary" v-show="currentConfig.id" size="small" @click="validate()">{{$t('commons.validate')}}</el-button>
|
<el-button type="primary" v-show="currentConfig.id" size="small" @click="validate">{{$t('commons.validate')}}</el-button>
|
||||||
<el-button type="primary" v-show="currentConfig.id" size="small" @click="save('update')">{{$t('commons.update')}}</el-button>
|
<el-button type="primary" v-show="currentConfig.id" size="small" @click="save('update')">{{$t('commons.update')}}</el-button>
|
||||||
<el-button type="primary" size="small" @click="save('add')">{{$t('commons.add')}}</el-button>
|
<el-button type="primary" v-show="currentConfig.id" size="small" @click="clear">{{$t('commons.clear')}}</el-button>
|
||||||
|
<el-button type="primary" v-show="!currentConfig.id" size="small" @click="save('add')">{{$t('commons.add')}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
@ -127,6 +128,9 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
clear() {
|
||||||
|
this.currentConfig = new DatabaseConfig();
|
||||||
|
},
|
||||||
validate() {
|
validate() {
|
||||||
this.result = this.$post('/api/database/validate', this.currentConfig, () => {
|
this.result = this.$post('/api/database/validate', this.currentConfig, () => {
|
||||||
this.$success(this.$t('commons.connection_successful'));
|
this.$success(this.$t('commons.connection_successful'));
|
||||||
|
|
Loading…
Reference in New Issue