2023-12-01 07:01:08 +08:00
|
|
|
export default {
|
2024-04-01 19:53:45 +08:00
|
|
|
computed: {
|
|
|
|
cardSelected() {
|
2024-04-02 16:40:05 +08:00
|
|
|
const item = this.dtComponent.selectedRows.find((i) => (i.code === this.params.code));
|
2024-04-01 19:53:45 +08:00
|
|
|
|
|
|
|
return !!item;
|
|
|
|
}
|
|
|
|
},
|
2023-12-01 07:01:08 +08:00
|
|
|
methods: {
|
|
|
|
itemSelected() {
|
2024-04-02 16:40:05 +08:00
|
|
|
const item = this.dtComponent.selectedRows.find((i) => (i.code === this.params.code));
|
2023-12-01 07:01:08 +08:00
|
|
|
|
|
|
|
if (item) {
|
2024-04-02 16:40:05 +08:00
|
|
|
this.dtComponent.selectedRows = this.dtComponent.selectedRows
|
2024-04-01 19:53:45 +08:00
|
|
|
.filter((i) => (i.code !== this.params.code));
|
2023-12-01 07:01:08 +08:00
|
|
|
} else {
|
2024-04-02 16:40:05 +08:00
|
|
|
this.dtComponent.selectedRows.push(this.params);
|
2023-12-01 07:01:08 +08:00
|
|
|
}
|
2023-12-11 16:18:22 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|