给单据列表增加左右拖拽的功能
This commit is contained in:
@@ -6,11 +6,15 @@
|
||||
import { filterObj,getNowFormatStr } from '@/utils/util';
|
||||
import { deleteAction, getAction, postAction, downFile, getFileAccessHttpUrl } from '@/api/manage'
|
||||
import Vue from 'vue'
|
||||
import VueDraggableResizable from 'vue-draggable-resizable'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import {mixinDevice} from '@/utils/mixin.js'
|
||||
|
||||
export const JeecgListMixin = {
|
||||
mixins: [mixinDevice],
|
||||
components: {
|
||||
VueDraggableResizable
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
//token header
|
||||
@@ -393,6 +397,44 @@ export const JeecgListMixin = {
|
||||
this.scroll.y = document.documentElement.clientHeight-searchWrapperDomLen-operatorDomLen-basicLength
|
||||
}
|
||||
},
|
||||
//拖拽组件
|
||||
handleDrag(column){
|
||||
return {
|
||||
header: {
|
||||
cell: (h, props, children) => {
|
||||
const { key, ...restProps } = props
|
||||
const col = column.find((col) => {
|
||||
const k = col.dataIndex || col.key
|
||||
return k === key
|
||||
})
|
||||
|
||||
if (!col || !col.width) {
|
||||
return h('th', { ...restProps }, [...children])
|
||||
}
|
||||
|
||||
const dragProps = {
|
||||
key: col.dataIndex || col.key,
|
||||
class: 'table-draggable-handle',
|
||||
attrs: {
|
||||
w: 10,
|
||||
x: col.width,
|
||||
z: 1,
|
||||
axis: 'x',
|
||||
draggable: true,
|
||||
resizable: false,
|
||||
},
|
||||
on: {
|
||||
dragging: (x, y) => {
|
||||
col.width = Math.max(x, 1)
|
||||
},
|
||||
},
|
||||
}
|
||||
const drag = h(VueDraggableResizable, { ...dragProps })
|
||||
return h('th', { ...restProps, class: 'resize-table-th' }, [...children, drag])
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 表格增加合计行 */
|
||||
tableAddTotalRow(columns, dataSource) {
|
||||
if(dataSource.length>0 && this.ipagination.pageSize%10===1) {
|
||||
|
||||
Reference in New Issue
Block a user