更改多个项目或清单选择问题 修复ref相同导致的bug

This commit is contained in:
yanyizhou
2021-09-01 16:45:21 +08:00
parent 5d9bb87aa7
commit db34dcd791
3 changed files with 15 additions and 15 deletions
@@ -305,7 +305,7 @@
:header-cell-style="{background: '#f5f1f1', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="selectListChange"
ref="selection"
ref="listSelection"
>
<el-table-column
type="selection"
@@ -535,8 +535,8 @@ export default {
selectListChange(data) {
// 单选
if (data.length > 1) {
this.$refs.selection.clearSelection()
this.$refs.selection.toggleRowSelection(data.pop())
this.$refs.listSelection.clearSelection()
this.$refs.listSelection.toggleRowSelection(data.pop())
}
this.multipleSelection = data
@@ -179,7 +179,7 @@
:header-cell-style="{background: '#f5f1f1', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="selectProjectChange"
ref="selection"
ref="projectSelection"
>
<el-table-column
type="selection"
@@ -282,7 +282,7 @@
:header-cell-style="{background: '#f5f1f1', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="selectListChange"
ref="selection"
ref="listSelection"
>
<el-table-column
type="selection"
@@ -594,8 +594,8 @@ export default {
selectListChange(data) {
// 单选
if (data.length > 1) {
this.$refs.selection.clearSelection()
this.$refs.selection.toggleRowSelection(data.pop())
this.$refs.listSelection.clearSelection()
this.$refs.listSelection.toggleRowSelection(data.pop())
}
this.multipleSelection = data
@@ -605,8 +605,8 @@ export default {
selectProjectChange(data) {
// 单选
if (data.length > 1) {
this.$refs.selection.clearSelection()
this.$refs.selection.toggleRowSelection(data.pop())
this.$refs.projectSelection.clearSelection()
this.$refs.projectSelection.toggleRowSelection(data.pop())
}
this.multipleSelection = data
@@ -178,7 +178,7 @@
:header-cell-style="{background: '#f5f1f1', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="selectProjectChange"
ref="selection"
ref="projectSelection"
>
<el-table-column
type="selection"
@@ -281,7 +281,7 @@
:header-cell-style="{background: '#f5f1f1', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="selectListChange"
ref="selection"
ref="listSelection"
>
<el-table-column
type="selection"
@@ -593,8 +593,8 @@ export default {
selectListChange(data) {
// 单选
if (data.length > 1) {
this.$refs.selection.clearSelection()
this.$refs.selection.toggleRowSelection(data.pop())
this.$refs.listSelection.clearSelection()
this.$refs.listSelection.toggleRowSelection(data.pop())
}
this.multipleSelection = data
@@ -604,8 +604,8 @@ export default {
selectProjectChange(data) {
// 单选
if (data.length > 1) {
this.$refs.selection.clearSelection()
this.$refs.selection.toggleRowSelection(data.pop())
this.$refs.projectSelection.clearSelection()
this.$refs.projectSelection.toggleRowSelection(data.pop())
}
this.multipleSelection = data