Commit a8727f10 by ym

禁止选中项

1 parent cd8197d3
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection" type="selection"
width="55" width="55"
:selectable="checkSelectable"
:reserve-selection="true" :reserve-selection="true"
> >
</el-table-column> </el-table-column>
...@@ -197,6 +198,16 @@ export default { ...@@ -197,6 +198,16 @@ export default {
// type: String, // type: String,
// default: '' // default: ''
// }, // },
// 设置禁止选中的行数据
checkSelectKey: {
type: String,
default: "",
},
// 设置禁止选中的值
checkSelectVal: {
type: Array,
default: () => [],
},
// 后端返回列表参数名 // 后端返回列表参数名
listName: { listName: {
type: String, type: String,
...@@ -241,7 +252,14 @@ export default { ...@@ -241,7 +252,14 @@ export default {
} }
}) })
}, },
// 设置禁止选中的行数据
checkSelectable(row) {
if (this.tableParams.checkSelectKey && this.tableParams.checkSelectVal.length>0) {
return this.tableParams.checkSelectVal.indexOf(row[this.tableParams.checkSelectKey]) == -1;
}else {
return true;
}
},
// 排序 // 排序
sortChange({ column, prop, order }) { sortChange({ column, prop, order }) {
this.$emit('sortChange', { column, prop, order }) this.$emit('sortChange', { column, prop, order })
...@@ -320,4 +338,8 @@ export default { ...@@ -320,4 +338,8 @@ export default {
/* -webkit-line-clamp: 2; */ /* -webkit-line-clamp: 2; */
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.el-table-column--selection .cell {
padding-left: 14px!important;
padding-right: 14px!important;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!