diff --git a/src/components/table/table-head.vue b/src/components/table/table-head.vue index 2a0eb8110..444b458ac 100644 --- a/src/components/table/table-head.vue +++ b/src/components/table/table-head.vue @@ -302,8 +302,35 @@ const finalLeft = parseInt(resizeProxy.style.left, 10); const columnWidth = finalLeft - startColumnLeft; + let _column, rightColumn; + + const findDragColumn = (list) => { + list.forEach(item => { + if(item.__id === column.__id) { + _column = item + } else if (item.children && item.children.length) { + findDragColumn(item.children); + } + }) + } + + findDragColumn(table.columns); + + const findRightColumn = (item) => { + if(item.children && item.children.length) { + const childLength = item.children.length; + findRightColumn(item.children[childLength - 1]) + } else { + rightColumn = item; + } + } + + if(_column && _column.children && _column.children.length) { + findRightColumn(_column.children[_column.children.length - 1]) + rightColumn.width = rightColumn.width + columnWidth - startLeft + startColumnLeft + } + - const _column = table.columns.find(item => item.__id === column.__id); if (_column) _column.width = columnWidth; table.$emit('on-column-width-resize', _column.width, startLeft - startColumnLeft, column, event); diff --git a/src/components/tree/tree.vue b/src/components/tree/tree.vue index 3e1b1c24f..529a3d2b6 100644 --- a/src/components/tree/tree.vue +++ b/src/components/tree/tree.vue @@ -144,8 +144,22 @@ if (node.checked == parent.checked && node.indeterminate == parent.indeterminate) return; // no need to update upwards if (node.checked == true) { - this.$set(parent, 'checked', parent[this.childrenKey].every(node => node.checked)); - this.$set(parent, 'indeterminate', !parent.checked); + const checkObj = parent[this.childrenKey].reduce((prev, next) => { + if(next.disabled) { + return prev + } else { + return { + checkedStatus: prev.checkedStatus && next.checked, + noCheckedStatus: prev.noCheckedStatus && !next.checked + } + } + }, { + checkedStatus: true, + noCheckedStatus: true + }) + this.$set(parent, 'checked', checkObj.checkedStatus); + const indeterminateStatus = !checkObj.noCheckedStatus && !checkObj.checkedStatus ? true : checkObj.noCheckedStatus && checkObj.checkedStatus + this.$set(parent, 'indeterminate', indeterminateStatus) } else { this.$set(parent, 'checked', false); this.$set(parent, 'indeterminate', parent[this.childrenKey].some(node => node.checked || node.indeterminate)); @@ -187,7 +201,9 @@ } if (node[this.childrenKey]) { node[this.childrenKey].forEach(child => { - this.updateTreeDown(child, changes); + if(!child.disabled) { + this.updateTreeDown(child, changes); + } }); } },