|
@@ -100,10 +100,10 @@ export default {
|
|
|
* @description 所有列表已选择的数据id
|
|
* @description 所有列表已选择的数据id
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
- selection_all:{
|
|
|
|
|
- type: Array,
|
|
|
|
|
- default: ()=>[]
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ selectionAll: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ default: null
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/* 表格換颜色*/
|
|
/* 表格換颜色*/
|
|
@@ -263,8 +263,11 @@ export default {
|
|
|
const buttonKey = action.key
|
|
const buttonKey = action.key
|
|
|
let selection = null// 选中数据
|
|
let selection = null// 选中数据
|
|
|
if (position === 'toolbar') { // 工具栏
|
|
if (position === 'toolbar') { // 工具栏
|
|
|
- // selection = this.getSelectedIds()
|
|
|
|
|
- selection = this.selection_all.map(i=>i.id_) // 默认给所有已选择的数据id
|
|
|
|
|
|
|
+ if (this.selectionAll) {
|
|
|
|
|
+ selection = this.selectionAll.map(i => i.id_) // 默认给所有已选择的数据id
|
|
|
|
|
+ } else {
|
|
|
|
|
+ selection = this.getSelectedIds()
|
|
|
|
|
+ }
|
|
|
} else { // 管理列
|
|
} else { // 管理列
|
|
|
selection = data ? this.getPkValue(data) : null
|
|
selection = data ? this.getPkValue(data) : null
|
|
|
}
|
|
}
|