变量初始化

This commit is contained in:
暮光:城中城
2021-04-19 15:06:13 +08:00
parent a153809649
commit e0e59cc82e
2 changed files with 17 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
-- ==导出注意== -- 每次发版时注意事项 ---
-- 1. datetime(0) 低版本不支持此语法改为datetime -- 1. datetime(0) 低版本不支持此语法改为datetime
-- 2. utf8mb4 低版本不支持此字符集改为utf8 -- 2. utf8mb4 低版本不支持此字符集改为utf8
-- 3. 加字段后记得排查是否有insert语句需要同步修改 -- 3. 加字段后记得排查是否有insert语句需要同步修改

View File

@@ -191,11 +191,13 @@
}, },
addDatasource() { addDatasource() {
this.datasourceDialogVisible = true; this.datasourceDialogVisible = true;
this.testDatasourceErrLoading = false;
this.newDatasource = {name: "", driverClassName: "", sourceUrl: "", sourceName: "", sourcePassword: "", groupName: ""}; this.newDatasource = {name: "", driverClassName: "", sourceUrl: "", sourceName: "", sourcePassword: "", groupName: ""};
}, },
editDatasource(row) { editDatasource(row) {
this.newDatasource = JSON.parse(JSON.stringify(row)); this.newDatasource = JSON.parse(JSON.stringify(row));
this.datasourceDialogVisible = true; this.datasourceDialogVisible = true;
this.testDatasourceErrLoading = false;
}, },
deleteDatasource(row) { deleteDatasource(row) {
this.$confirm('确定要删除此数据源吗?', '提示', { this.$confirm('确定要删除此数据源吗?', '提示', {
@@ -220,16 +222,20 @@
}); });
}, },
testDatasource() { testDatasource() {
this.testDatasourceErrLoading = true; this.testDatasourceErrLoading = true;
datasourceApi.queryTestDatasource(this.newDatasource).then(res => { datasourceApi.queryTestDatasource(this.newDatasource).then(res => {
this.testDatasourceErrLoading = false; this.testDatasourceErrLoading = false;
if (res.errCode == 200) { if (res.errCode == 200) {
this.$message.success("连接成功!"); this.$message.success("连接成功!");
} else { } else {
this.testDatasourceErrVisible = true; this.testDatasourceErrVisible = true;
this.testDatasourceErrInfo = res.errMsg || ''; this.testDatasourceErrInfo = res.errMsg || '';
} }
}); }).catch(err => {
this.testDatasourceErrLoading = false;
this.testDatasourceErrVisible = true;
this.testDatasourceErrInfo = err.message || '请求出错';
});
}, },
driverClassNameChange() { driverClassNameChange() {
if (this.newDatasource.driverClassName == 'com.mysql.jdbc.Driver') { if (this.newDatasource.driverClassName == 'com.mysql.jdbc.Driver') {