-
-
-
-
-
-
+
+
+
+
-
- 查询
-
-
+
+ 查询
刷新
@@ -105,7 +101,7 @@ export default {
DbType: "",
},
searchform: {
- DbName: "",
+ dbName: "",
tableName: "",
},
codeform: {
@@ -122,6 +118,9 @@ export default {
// trigger: "blur",
// },
// ],
+ dbName: [
+ { required: true, message: "请选择数据库名称", trigger: "blur" },
+ ],
replaceTableNameStr: [
{ min: 0, max: 50, message: "长度小于50个字符", trigger: "blur" },
],
@@ -166,15 +165,13 @@ export default {
* 加载页面table数据
*/
loadTableData: function () {
- if (this.searchform.dataBaseName !== "") {
+ if (this.codeform.dataBaseName !== "") {
this.tableloading = true;
var seachdata = {
pageNum: this.pagination.pageNum,
PageSize: this.pagination.pagesize,
- tableName: this.searchform.tableName,
- dbName: this.searchform.DbName,
- // Order: this.sortableData.order,
- // Sort: this.sortableData.sort,
+ tableName: this.codeform.tableName,
+ dbName: this.codeform.dbName,
};
codeGetTableList(seachdata).then((res) => {
this.tableData = res.data.result;
@@ -187,9 +184,15 @@ export default {
* 点击查询
*/
handleSearch: function () {
- this.tableloading = true;
- this.pagination.pageNum = 1;
- this.loadTableData();
+ this.$refs["codeform"].validate((valid) => {
+ if (valid) {
+ this.tableloading = true;
+ this.pagination.pageNum = 1;
+ this.loadTableData();
+ }else{
+ return false;
+ }
+ });
},
handleShowTable: function () {
this.pagination.pageNum = 1;
@@ -231,7 +234,7 @@ export default {
const pageLoading = Loading.service(loadop);
var seachdata = {
- dbName: this.searchform.DbName,
+ dbName: this.codeform.dbName,
tables: row.name, // this.currentSelected.toString(),
baseSpace: this.codeform.baseSpace,
replaceTableNameStr: this.codeform.replaceTableNameStr,