作者 RuoYi

导入表单击行数据时选中对应的复选框

@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 </el-form-item> 26 </el-form-item>
27 </el-form> 27 </el-form>
28 <el-row> 28 <el-row>
29 - <el-table :data="dbTableList" @selection-change="handleSelectionChange" height="260px"> 29 + <el-table @row-click="clickRow" ref="table" :data="dbTableList" @selection-change="handleSelectionChange" height="260px">
30 <el-table-column type="selection" width="55"></el-table-column> 30 <el-table-column type="selection" width="55"></el-table-column>
31 <el-table-column prop="tableName" label="表名称"></el-table-column> 31 <el-table-column prop="tableName" label="表名称"></el-table-column>
32 <el-table-column prop="tableComment" label="表描述"></el-table-column> 32 <el-table-column prop="tableComment" label="表描述"></el-table-column>
@@ -76,6 +76,9 @@ export default { @@ -76,6 +76,9 @@ export default {
76 this.getList(); 76 this.getList();
77 this.visible = true; 77 this.visible = true;
78 }, 78 },
  79 + clickRow(row) {
  80 + this.$refs.table.toggleRowSelection(row);
  81 + },
79 // 多选框选中数据 82 // 多选框选中数据
80 handleSelectionChange(selection) { 83 handleSelectionChange(selection) {
81 this.tables = selection.map(item => item.tableName); 84 this.tables = selection.map(item => item.tableName);