[update] 解决标准表格调整列宽会触发排序的问题
This commit is contained in:
@@ -256,7 +256,8 @@ export default {
|
||||
cell: this.initDrag(this.columns)
|
||||
}
|
||||
},
|
||||
selfScroll: {}
|
||||
selfScroll: {},
|
||||
resizing: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -457,6 +458,7 @@ export default {
|
||||
}
|
||||
// 开始拖拽监听
|
||||
const onDragging = (x) => {
|
||||
this.resizing = true
|
||||
const beforeWidth = col.width
|
||||
const scroll = cloneDeep(this.scroll) || {}
|
||||
draggingState[key] = 0
|
||||
@@ -484,6 +486,9 @@ export default {
|
||||
// 停止拖拽监听
|
||||
const onDragstop = () => {
|
||||
draggingState[key] = thDom.getBoundingClientRect().width
|
||||
setTimeout(() => {
|
||||
this.resizing = false
|
||||
}, 200)
|
||||
}
|
||||
// 控制最小拖拽宽度
|
||||
const onDrag = (x) => {
|
||||
|
||||
@@ -225,6 +225,18 @@ export const ConfigurableTableMixin = {
|
||||
})
|
||||
},
|
||||
tableOnChange (pagination, filters, sorter) {
|
||||
// debugger;
|
||||
console.log(this.$refs.tableRef.resizing)
|
||||
if (this.$refs.tableRef.resizing) {
|
||||
const classNameOne = window.event.target.parentNode.children[0].children[0].children[1].children[0].children[0].className
|
||||
const classNameTwo = window.event.target.parentNode.children[0].children[0].children[1].children[0].children[1].className
|
||||
const target = window.event.target
|
||||
this.$nextTick(() => {
|
||||
target.parentNode.children[0].children[0].children[1].children[0].children[0].className = classNameOne
|
||||
target.parentNode.children[0].children[0].children[1].children[0].children[1].className = classNameTwo
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log(sorter)
|
||||
if (Object.keys(sorter).length > 0) {
|
||||
if (sorter.field.split('_')[sorter.field.split('_').length - 1] === 'dictText') {
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
<div>
|
||||
<j-table
|
||||
v-if="columns && columns.length > 0"
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:can-drag="true"
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
<div>
|
||||
<j-table
|
||||
v-if="columns && columns.length > 0"
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:can-drag="true"
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
<div>
|
||||
<j-table
|
||||
v-if="columns && columns.length > 0"
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:can-drag="true"
|
||||
|
||||
Reference in New Issue
Block a user