| | |
| | | }, |
| | | |
| | | sourceData() { |
| | | return this.data.filter(item => this.value.indexOf(item[this.props.key]) === -1); |
| | | return this.data.filter(item => this.value.indexOf(item) === -1); |
| | | }, |
| | | |
| | | targetData() { |
| | | if (this.targetOrder === 'original') { |
| | | return this.data.filter(item => this.value.indexOf(item[this.props.key]) > -1); |
| | | console.log('11111') |
| | | return this.data.filter(item => this.value.indexOf(item) > -1 |
| | | ); |
| | | } else { |
| | | console.log('22222') |
| | | return this.value.reduce((arr, cur) => { |
| | | const val = this.dataObj[cur]; |
| | | if (val) { |
| | |
| | | this.leftChecked.indexOf(itemKey) > -1 && |
| | | this.value.indexOf(itemKey) === -1 |
| | | ) { |
| | | // itemsToBeMoved.push(itemKey) |
| | | itemsToBeMoved = [itemKey] |
| | | // itemsToBeMoved = [itemKey] |
| | | itemsToBeMoved = [item] |
| | | console.log(itemsToBeMoved) |
| | | } |
| | | }); |
| | | // currentValue = this.targetOrder === 'unshift' |
| | | // ? itemsToBeMoved.concat(currentValue) |
| | | // : currentValue.concat(itemsToBeMoved); |
| | | currentValue = itemsToBeMoved |
| | | // currentValue = itemsToBeMoved |
| | | currentValue = itemsToBeMoved |
| | | this.$emit('input', currentValue); |
| | | this.$emit('change', currentValue, 'right', this.leftChecked); |
| | | }, |