|
|
@@ -6,7 +6,8 @@
|
|
|
<!-- 数据表格 -->
|
|
|
|
|
|
|
|
|
- <ele-pro-table ref="table" :columns="columns" :datasource="datasource" @selection-change="selectListChange" row-key="id">
|
|
|
+ <ele-pro-table ref="table" :columns="columns" :datasource="datasource" @selection-change="selectListChange"
|
|
|
+ row-key="id">
|
|
|
<!-- 状态列 -->
|
|
|
|
|
|
<!-- 操作列 -->
|
|
|
@@ -57,7 +58,7 @@ export default {
|
|
|
width: 45,
|
|
|
align: 'center',
|
|
|
selectable: (row, index) => {
|
|
|
- return !this.tableData.some((it) => it.sourceTaskId == row.id || it.id == row.id);
|
|
|
+ return !this.tableData.some((it) => it.sourceTaskId == row.id);
|
|
|
},
|
|
|
|
|
|
reserveSelection: true,
|
|
|
@@ -191,29 +192,33 @@ export default {
|
|
|
|
|
|
// 表格某一行的单击事件
|
|
|
selectListChange(selection) {
|
|
|
-
|
|
|
- if(this.isRadio) {
|
|
|
+ if (this.isRadio) {
|
|
|
if (Array.isArray(selection) && selection.length > 1) {//点击勾选框
|
|
|
- this.$refs.table.toggleRowSelection(selection[0],false);
|
|
|
- this.$refs.table.toggleRowSelection(selection[1],true);
|
|
|
-
|
|
|
- }else if(!Array.isArray(selection)){//点击行
|
|
|
- this.$refs.table.toggleRowSelection(selection,false);
|
|
|
- this.$refs.table.toggleRowSelection(selection,true);
|
|
|
+ this.$refs.table.toggleRowSelection(selection[0], false);
|
|
|
+ this.$refs.table.toggleRowSelection(selection[1], true);
|
|
|
|
|
|
- }else{
|
|
|
- this.rowData = []
|
|
|
- this.rowData = Array.isArray(selection)?selection[0]:selection;
|
|
|
+ } else if (!Array.isArray(selection)) {//点击行
|
|
|
+ this.$refs.table.toggleRowSelection(selection, false);
|
|
|
+ this.$refs.table.toggleRowSelection(selection, true);
|
|
|
|
|
|
+ } else {
|
|
|
+ this.rowData = []
|
|
|
+ this.rowData = Array.isArray(selection) ? selection[0] : selection;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.selection = selection
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
getRowData() {
|
|
|
- return this.rowData
|
|
|
+ return this.rowData
|
|
|
+ },
|
|
|
+
|
|
|
+ getSelection() {
|
|
|
+ return this.selection
|
|
|
}
|
|
|
|
|
|
}
|