handlerIsScroll() {
this.$nextTick(() => {
let tableEven = this.$refs.table.bodyWrapper;
let scrollLeft = 0;
tableEven.addEventListener("scroll", () => {
scrollLeft = this.$refs.table.bodyWrapper.scrollLeft;
scrollLeft > 0 ? (this.isPositionLeft = true) : (this.isPositionLeft = false);
});
});
},
修改表格滚动条宽度
/deep/ .el-table{
.el-table__body-wrapper::-webkit-scrollbar {
height: 10px !important;
}
.el-table__fixed-body-wrapper {
max-height: 410px !important;
}
}
rowDrop() {
const tbody = document.querySelector(".drop-table .el-table__body-wrapper > table > tbody");
const _this = this;
this.tableSortable = Sortable.create(tbody, {
draggable: ".el-table__row",
filter: ".ignore-elements",
preventOnFilter: false,
scroll: true,
animation: 0,
onEnd({ newIndex, oldIndex }) {
const currRow = _this.evaluationList.list.splice(oldIndex, 1)[0];
_this.evaluationList.list.splice(newIndex, 0, currRow);
_this.evaluationList.list.map((item, index) => (item.sortNum = index + 1));
},
});
},
this.tableSortable && this.tableSortable.destroy();