<a-table
:pagination="false"
rowKey="id"
:columns="columns"
size="middle"
:data-source="tableData"
:row-selection="{
columnTitle: ' ',
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
onSelect: onSelect,
getCheckboxProps: getCheckboxProps,
}"
bordered
>
</a-table>
selectedRowKeys:[],
onSelectChange(selectedRowKeys) {
this.selectedRowKeys=selectedRowKeys;
},
onSelect(record, selected, selectedRows) {
console.log(selectedRows, record, selected, 77777);
if (selected) {
record.showflag = true;
this.selectedRows.push(record);
} else {
record.showflag = false;
this.selectedRows.map((x, item) => {
if (x.id === record.id) {
this.selectedRows.splice(item, 1);
}
});
}
},
getCheckboxProps(record) {
return {
props: {
disabled: !record.isFinish,
},
};
},
|