mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-05 04:03:45 +08:00
Merge pull request #7402 from wandji20/wb-SCI-10553
Fix Card selector issues [SCI-10553]
This commit is contained in:
commit
b80aa87c17
3 changed files with 12 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
|||
<input
|
||||
type="checkbox"
|
||||
class="sci-checkbox"
|
||||
:checked="cardSelected"
|
||||
@change="itemSelected"
|
||||
/>
|
||||
<label :for="params.id" class="sci-checkbox-label"></label>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<input
|
||||
type="checkbox"
|
||||
class="sci-checkbox"
|
||||
:checked="cardSelected"
|
||||
@change="itemSelected"
|
||||
/>
|
||||
<label :for="params.id" class="sci-checkbox-label"></label>
|
||||
|
@ -49,6 +50,7 @@
|
|||
<input
|
||||
type="checkbox"
|
||||
class="sci-checkbox"
|
||||
:checked="cardSelected"
|
||||
@change="itemSelected"
|
||||
/>
|
||||
<label :for="params.id" class="sci-checkbox-label"></label>
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
export default {
|
||||
computed: {
|
||||
cardSelected() {
|
||||
const item = this.dtComponent.selectedRows.find((i) => (i.code === this.params.code));
|
||||
|
||||
return !!item;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
itemSelected() {
|
||||
const item = this.dtComponent.selectedRows.find((i) => (i.id === this.params.id));
|
||||
const item = this.dtComponent.selectedRows.find((i) => (i.code === this.params.code));
|
||||
|
||||
if (item) {
|
||||
this.dtComponent.selectedRows = this.dtComponent.selectedRows
|
||||
.filter((i) => (i.id !== this.params.id));
|
||||
.filter((i) => (i.code !== this.params.code));
|
||||
} else {
|
||||
this.dtComponent.selectedRows.push(this.params);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue