vxe-table 3.11.38 → 3.12.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/render/index.js +47 -12
- package/es/table/src/body.js +81 -35
- package/es/table/src/footer.js +54 -18
- package/es/table/src/header.js +58 -10
- package/es/table/src/methods.js +159 -118
- package/es/table/src/table.js +5 -13
- package/es/table/style.css +3 -5
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +3 -5
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +464 -272
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/render/index.js +47 -12
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +101 -56
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +67 -30
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +71 -18
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +167 -137
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +5 -15
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +3 -5
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +5 -3
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +3 -5
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/render/index.ts +48 -12
- package/packages/table/src/body.ts +84 -35
- package/packages/table/src/footer.ts +58 -18
- package/packages/table/src/header.ts +62 -11
- package/packages/table/src/methods.ts +163 -126
- package/packages/table/src/table.ts +6 -15
- package/packages/ui/index.ts +4 -2
- package/styles/components/table.scss +1 -3
- /package/es/{iconfont.1735003904481.ttf → iconfont.1735106128767.ttf} +0 -0
- /package/es/{iconfont.1735003904481.woff → iconfont.1735106128767.woff} +0 -0
- /package/es/{iconfont.1735003904481.woff2 → iconfont.1735106128767.woff2} +0 -0
- /package/lib/{iconfont.1735003904481.ttf → iconfont.1735106128767.ttf} +0 -0
- /package/lib/{iconfont.1735003904481.woff → iconfont.1735106128767.woff} +0 -0
- /package/lib/{iconfont.1735003904481.woff2 → iconfont.1735106128767.woff2} +0 -0
package/lib/table/src/header.js
CHANGED
|
@@ -11,7 +11,8 @@ var _dom = require("../../ui/src/dom");
|
|
|
11
11
|
var _util = require("./util");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const {
|
|
14
|
-
renderer
|
|
14
|
+
renderer,
|
|
15
|
+
renderEmptyElement
|
|
15
16
|
} = _ui.VxeUI;
|
|
16
17
|
const cellType = 'header';
|
|
17
18
|
const renderRows = (h, _vm, cols, $rowIndex) => {
|
|
@@ -124,6 +125,7 @@ const renderRows = (h, _vm, cols, $rowIndex) => {
|
|
|
124
125
|
'is--sortable': column.sortable,
|
|
125
126
|
'col--filter': !!column.filters,
|
|
126
127
|
'is--filter-active': hasFilter,
|
|
128
|
+
'is--drag-active': !column.fixed && !isDisabledDrag,
|
|
127
129
|
'is--drag-disabled': isDisabledDrag,
|
|
128
130
|
'col--current': currentColumn === column
|
|
129
131
|
}, (0, _utils.getClass)(headerClassName, params), (0, _utils.getClass)(headerCellClassName, params)],
|
|
@@ -252,41 +254,92 @@ var _default = exports.default = {
|
|
|
252
254
|
elemStore[`${prefix}repair`] = null;
|
|
253
255
|
},
|
|
254
256
|
render(h) {
|
|
257
|
+
const props = this;
|
|
258
|
+
const $xeTable = this.$parent;
|
|
259
|
+
const tableProps = $xeTable;
|
|
260
|
+
const tableReactData = $xeTable;
|
|
261
|
+
const tableInternalData = $xeTable;
|
|
262
|
+
const {
|
|
263
|
+
tId
|
|
264
|
+
} = $xeTable;
|
|
255
265
|
const {
|
|
256
|
-
_e,
|
|
257
|
-
$parent: $xetable,
|
|
258
266
|
fixedType,
|
|
259
|
-
|
|
260
|
-
tableColumn
|
|
261
|
-
|
|
267
|
+
fixedColumn,
|
|
268
|
+
tableColumn
|
|
269
|
+
} = props;
|
|
270
|
+
const {
|
|
271
|
+
headerColumn
|
|
262
272
|
} = this;
|
|
263
273
|
const {
|
|
264
|
-
tId,
|
|
265
|
-
isGroup,
|
|
266
|
-
visibleColumn,
|
|
267
274
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
275
|
+
spanMethod,
|
|
276
|
+
footerSpanMethod
|
|
277
|
+
} = tableProps;
|
|
278
|
+
const {
|
|
279
|
+
isGroup,
|
|
268
280
|
scrollXLoad,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
281
|
+
scrollYLoad,
|
|
282
|
+
scrollbarWidth,
|
|
283
|
+
dragCol
|
|
284
|
+
} = tableReactData;
|
|
285
|
+
const {
|
|
286
|
+
visibleColumn,
|
|
287
|
+
fullColumnIdData
|
|
288
|
+
} = tableInternalData;
|
|
289
|
+
let renderHeaderList = headerColumn;
|
|
272
290
|
let renderColumnList = tableColumn;
|
|
273
291
|
if (isGroup) {
|
|
274
292
|
renderColumnList = visibleColumn;
|
|
275
293
|
} else {
|
|
276
|
-
// 如果是使用优化模式
|
|
277
294
|
if (fixedType) {
|
|
278
|
-
|
|
279
|
-
|
|
295
|
+
// 如果是使用优化模式
|
|
296
|
+
if (scrollXLoad || scrollYLoad || allColumnHeaderOverflow) {
|
|
297
|
+
// 如果不支持优化模式
|
|
298
|
+
if (spanMethod || footerSpanMethod) {
|
|
299
|
+
renderColumnList = visibleColumn;
|
|
300
|
+
} else {
|
|
301
|
+
renderColumnList = fixedColumn || [];
|
|
302
|
+
}
|
|
303
|
+
} else {
|
|
304
|
+
renderColumnList = visibleColumn;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
renderHeaderList = [renderColumnList];
|
|
308
|
+
}
|
|
309
|
+
if (!fixedType) {
|
|
310
|
+
// 列拖拽
|
|
311
|
+
if (scrollXLoad && dragCol) {
|
|
312
|
+
if (renderColumnList.length > 2) {
|
|
313
|
+
const dCowRest = fullColumnIdData[dragCol.id];
|
|
314
|
+
if (dCowRest) {
|
|
315
|
+
const dcIndex = dCowRest._index;
|
|
316
|
+
const firstCol = renderColumnList[0];
|
|
317
|
+
const lastCol = renderColumnList[renderColumnList.length - 1];
|
|
318
|
+
const firstColRest = fullColumnIdData[firstCol.id];
|
|
319
|
+
const lastColRest = fullColumnIdData[lastCol.id];
|
|
320
|
+
if (firstColRest && lastColRest) {
|
|
321
|
+
const fcIndex = firstColRest._index;
|
|
322
|
+
const lcIndex = lastColRest._index;
|
|
323
|
+
console.log(dragCol.id, dcIndex, fcIndex, lcIndex, renderColumnList.length);
|
|
324
|
+
if (dcIndex < fcIndex) {
|
|
325
|
+
renderColumnList = [dragCol].concat(renderColumnList);
|
|
326
|
+
renderHeaderList = [[dragCol].concat(renderHeaderList[0])].concat(renderHeaderList.slice(1));
|
|
327
|
+
} else if (dcIndex > lcIndex) {
|
|
328
|
+
renderColumnList = renderColumnList.concat([dragCol]);
|
|
329
|
+
renderHeaderList = [renderHeaderList[0].concat([dragCol])].concat(renderHeaderList.slice(1));
|
|
330
|
+
}
|
|
331
|
+
console.log(renderColumnList.length);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
280
334
|
}
|
|
281
335
|
}
|
|
282
|
-
headerGroups = [renderColumnList];
|
|
283
336
|
}
|
|
284
337
|
return h('div', {
|
|
285
338
|
class: ['vxe-table--header-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
|
286
339
|
attrs: {
|
|
287
340
|
xid: tId
|
|
288
341
|
}
|
|
289
|
-
}, [fixedType ?
|
|
342
|
+
}, [fixedType ? renderEmptyElement($xeTable) : h('div', {
|
|
290
343
|
class: 'vxe-body--x-space',
|
|
291
344
|
ref: 'xSpace'
|
|
292
345
|
}), h('table', {
|
|
@@ -321,7 +374,7 @@ var _default = exports.default = {
|
|
|
321
374
|
*/
|
|
322
375
|
h('thead', {
|
|
323
376
|
ref: 'thead'
|
|
324
|
-
}, renderHeads(h, this,
|
|
377
|
+
}, renderHeads(h, this, renderHeaderList))]),
|
|
325
378
|
/**
|
|
326
379
|
* 其他
|
|
327
380
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom"),_util=require("./util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_utils=require("../../ui/src/utils"),_dom=require("../../ui/src/dom"),_util=require("./util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{renderer,renderEmptyElement}=_ui.VxeUI,cellType="header",renderRows=(v,C,b,y)=>{let _=C.$parent,w=_.xegrid,$=C.fixedType,{resizable:z,border:W,columnKey:M,headerCellClassName:H,headerCellStyle:D,showHeaderOverflow:S,headerAlign:R,align:T,currentColumn:E,scrollXLoad:O,scrollYLoad:k,overflowX:U,scrollbarWidth:e,mouseConfig:I,columnOpts:A}=_,L=_.computeColumnDragOpts,q=L.disabledMethod;return b.map((e,l)=>{var{type:t,showHeaderOverflow:r,headerAlign:a,align:i,headerClassName:o,editRender:n,cellRender:d}=e,s=e.id,n=n||d,d=n?renderer.get(n.name):null,n=e.children&&e.children.length,u=$?e.fixed!==$&&!n:e.fixed&&U,r=_xeUtils.default.isUndefined(r)||_xeUtils.default.isNull(r)?S:r,a=a||(d?d.tableHeaderCellAlign:"")||R||i||(d?d.tableCellAlign:"")||T;let c="ellipsis"===r;i="title"===r,d=!0===r||"tooltip"===r;let p=i||d||c;var r=e.filters&&e.filters.some(e=>e.checked),h=_.getColumnIndex(e),m=_.getVTColumnIndex(e);let f={$table:_,$grid:w,$rowIndex:y,column:e,columnIndex:h,$columnIndex:l,_columnIndex:m,fixed:$,type:cellType,isHidden:u,hasFilter:r};var h={colid:s,colspan:1<e.colSpan?e.colSpan:null,rowspan:1<e.rowSpan?e.rowSpan:null},m={click:e=>_.triggerHeaderCellClickEvent(e,f),dblclick:e=>_.triggerHeaderCellDblclickEvent(e,f)},g=(O&&!p&&(c=p=!0),A.drag&&"cell"===L.trigger);let x=!1;g&&(x=!(!q||!q(f))),(I||g)&&(m.mousedown=e=>_.triggerHeaderCellMousedownEvent(e,f)),A.drag&&(m.dragstart=_.handleHeaderCellDragDragstartEvent,m.dragend=_.handleHeaderCellDragDragendEvent,m.dragover=_.handleHeaderCellDragDragoverEvent,g)&&(m.mouseup=_.handleHeaderCellDragMouseupEvent);g=!e.resizeWidth&&("auto"===e.minWidth||"auto"===e.width);return v("th",{class:["vxe-header--column",s,{["col--"+a]:a,["col--"+t]:t,"col--last":l===b.length-1,"col--fixed":e.fixed,"col--group":n,"col--ellipsis":p,"fixed--width":!g,"fixed--hidden":u,"is--sortable":e.sortable,"col--filter":!!e.filters,"is--filter-active":r,"is--drag-active":!e.fixed&&!x,"is--drag-disabled":x,"col--current":E===e},(0,_utils.getClass)(o,f),(0,_utils.getClass)(H,f)],attrs:h,style:D?_xeUtils.default.isFunction(D)?D(f):D:null,on:m,key:M||O||k||A.useKey||A.drag||n?s:l},[v("div",{class:["vxe-cell",{"c--title":i,"c--tooltip":d,"c--ellipsis":c}]},e.renderHeader(v,f)),u||n||!(_xeUtils.default.isBoolean(e.resizable)?e.resizable:A.resizable||z)?null:v("div",{class:["vxe-resizable",{"is--line":!W||"none"===W}],on:{mousedown:e=>C.resizeMousedown(e,f)}})])}).concat(e?[v("th",{key:"gr"+y,class:"vxe-header--gutter col--gutter"})]:[])};function renderHeads(r,a,e){let i=a.$parent;var l=i;let o=a.fixedType,n=i.computeColumnOpts,d=i.computeColumnDragOpts,{headerRowClassName:s,headerRowStyle:u}=l,c=i.isDragColMove;return e.map((e,l)=>{var t={$table:i,$rowIndex:l,fixed:o,type:cellType};return n.drag&&d.animation?r("transition-group",{key:l,props:{tag:"tr",name:"vxe-header--col-list"+(c?"":"-disabled"),class:["vxe-header--row",s?_xeUtils.default.isFunction(s)?s(t):s:""],style:u?_xeUtils.default.isFunction(u)?u(t):u:null}},renderRows(r,a,e,l)):r("tr",{key:l,class:["vxe-header--row",s?_xeUtils.default.isFunction(s)?s(t):s:""],style:u?_xeUtils.default.isFunction(u)?u(t):u:null},renderRows(r,a,e,l))})}var _default=exports.default={name:"VxeTableHeader",props:{tableData:Array,tableColumn:Array,tableGroupColumn:Array,fixedColumn:Array,size:String,fixedType:String},data(){return{headerColumn:[]}},watch:{tableColumn(){this.uploadColumn()}},created(){this.uploadColumn()},mounted(){var{$parent:e,$el:l,$refs:t,fixedType:r}=this,e=e.elemStore,r=`${r||"main"}-header-`;e[r+"wrapper"]=l,e[r+"table"]=t.table,e[r+"colgroup"]=t.colgroup,e[r+"list"]=t.thead,e[r+"xSpace"]=t.xSpace,e[r+"repair"]=t.repair},destroyed(){var{$parent:e,fixedType:l}=this,e=e.elemStore,l=`${l||"main"}-header-`;e[l+"wrapper"]=null,e[l+"table"]=null,e[l+"colgroup"]=null,e[l+"list"]=null,e[l+"xSpace"]=null,e[l+"repair"]=null},render(t){var e=this.$parent,l=e.tId,{fixedType:r,fixedColumn:a,tableColumn:i}=this,o=this.headerColumn,{showHeaderOverflow:n,spanMethod:d,footerSpanMethod:s}=e,{isGroup:u,scrollXLoad:c,scrollYLoad:p,scrollbarWidth:h,dragCol:m}=e,{visibleColumn:f,fullColumnIdData:g}=e;let x=o,v=i;return u?v=f:(r&&(v=!(c||p||n)||d||s?f:a||[]),x=[v]),r||c&&m&&2<v.length&&(o=g[m.id])&&(i=o._index,u=v[0],p=v[v.length-1],n=g[u.id],d=g[p.id],n)&&d&&(s=n._index,f=d._index,console.log(m.id,i,s,f,v.length),i<s?(v=[m].concat(v),x=[[m].concat(x[0])].concat(x.slice(1))):f<i&&(v=v.concat([m]),x=[x[0].concat([m])].concat(x.slice(1))),console.log(v.length)),t("div",{class:["vxe-table--header-wrapper",r?`fixed-${r}--wrapper`:"body--wrapper"],attrs:{xid:l}},[r?renderEmptyElement(e):t("div",{class:"vxe-body--x-space",ref:"xSpace"}),t("table",{class:"vxe-table--header",attrs:{xid:l,cellspacing:0,cellpadding:0,border:0},ref:"table"},[t("colgroup",{ref:"colgroup"},v.map((e,l)=>t("col",{attrs:{name:e.id},key:l})).concat(h?[t("col",{attrs:{name:"col_gutter"}})]:[])),t("thead",{ref:"thead"},renderHeads(t,this,x))]),t("div",{class:"vxe-table--header-border-line",ref:"repair"})])},methods:{uploadColumn(){var e=this.$parent;this.headerColumn=e.isGroup?(0,_util.convertHeaderColumnToRows)(this.tableGroupColumn):[]},resizeMousedown(e,t){var l=this.$parent;let d=t.column,{$parent:r,fixedType:s}=this,a=l.visibleColumn,{tableBody:i,leftContainer:u,rightContainer:c}=r.$refs,p=l.$el,h=r.$refs.resizeBar,m=r.$refs.refCellResizeTip,f=this.$el,{target:o,clientX:g}=e,x=t.cell=o.parentNode,v=l.computeResizableOpts,C=0,b=i.$el;var l=(0,_dom.getOffsetPos)(o,p),n=o.clientWidth,y=Math.floor(n/2);let _=(0,_util.getColReMinWidth)(t)-y,w=l.left-x.clientWidth+n+_,$=l.left+y,z=document.onmousemove,W=document.onmouseup,M="left"===s,H="right"===s,D=0;if(M||H){var S=M?"nextElementSibling":"previousElementSibling";let e=x[S];for(;e&&!(0,_dom.hasClass)(e,"fixed--hidden");)(0,_dom.hasClass)(e,"col--group")||(D+=e.offsetWidth),e=e[S];H&&c&&($=c.offsetLeft+D)}function R(l){l.stopPropagation(),l.preventDefault();var t=l.clientX-g;let e=$+t;if(t=s?0:b.scrollLeft,M?e=Math.min(e,(c?c.offsetLeft:b.clientWidth)-D-_):H?(w=(u?u.clientWidth:0)+D+_,e=Math.min(e,$+x.clientWidth-_)):w=Math.max(b.scrollLeft,w),t=(C=Math.max(e,w))-t,h.style.left=t+"px",v.showDragTip&&m){var r=p.clientWidth,a=f.getBoundingClientRect(),i=h.clientWidth,o=m.clientWidth,n=m.clientHeight;let e=-o;t<o+i?e=o+i-t:r<t&&(e+=r-t),m.style.left=e+"px",m.style.top=Math.min(p.clientHeight-n,Math.max(0,l.clientY-a.y-n/2))+"px",m.textContent=d.renderWidth+(H?$-C:C-$)+"px"}}r._isResize=!0,(0,_dom.addClass)(r.$el,"drag--resize"),h.style.display="block",document.onmousemove=R,document.onmouseup=function(e){document.onmousemove=z,document.onmouseup=W;let l=d.renderWidth+(H?$-C:C-$);d.resizeWidth=l,"fixed"===v.dragMode&&a.forEach(e=>{e.id===d.id||e.resizeWidth||(e.resizeWidth=e.renderWidth)}),h.style.display="none",r._isResize=!1,r._lastResizeTime=Date.now(),r.analyColumnWidth(),r.recalculate(!0).then(()=>{r.saveCustomStore("update:visible"),r.updateCellAreas(),r.emitEvent("resizable-change",Object.assign(Object.assign({},t),{resizeWidth:l}),e),setTimeout(()=>r.recalculate(!0),300)}),(0,_dom.removeClass)(r.$el,"drag--resize")},R(e),r.closeMenu()}}};
|
package/lib/table/src/methods.js
CHANGED
|
@@ -21,8 +21,6 @@ const {
|
|
|
21
21
|
interceptor,
|
|
22
22
|
createEvent
|
|
23
23
|
} = _ui.VxeUI;
|
|
24
|
-
// const isWebkit = browse['-webkit'] && !browse.edge
|
|
25
|
-
// const debounceScrollYDuration = browse.msie ? 80 : 20
|
|
26
24
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
27
25
|
// 获取所有的列,排除分组
|
|
28
26
|
const getColumnList = columns => {
|
|
@@ -356,7 +354,7 @@ const calcCellHeight = $xeTable => {
|
|
|
356
354
|
const {
|
|
357
355
|
fullAllDataRowIdData
|
|
358
356
|
} = internalData;
|
|
359
|
-
const el = $xeTable.$
|
|
357
|
+
const el = $xeTable.$refs.refElem;
|
|
360
358
|
if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
|
|
361
359
|
let paddingTop = 0;
|
|
362
360
|
let paddingBottom = 0;
|
|
@@ -364,28 +362,27 @@ const calcCellHeight = $xeTable => {
|
|
|
364
362
|
tableData.forEach(row => {
|
|
365
363
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
366
364
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
367
|
-
const
|
|
368
|
-
if (rowRest &&
|
|
365
|
+
const cellList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]>.vxe-body--column>.vxe-cell`);
|
|
366
|
+
if (rowRest && cellList.length) {
|
|
369
367
|
let height = 0;
|
|
370
|
-
for (let i = 0; i <
|
|
371
|
-
const
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const cellElem = tdEl.querySelector('.vxe-cell');
|
|
376
|
-
if (!calcPadding) {
|
|
377
|
-
paddingTop = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingTop);
|
|
378
|
-
paddingBottom = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
379
|
-
calcPadding = true;
|
|
380
|
-
}
|
|
381
|
-
let cellHeight = paddingTop + paddingBottom;
|
|
382
|
-
if (cellElem) {
|
|
383
|
-
cellHeight += cellElem.offsetHeight;
|
|
384
|
-
}
|
|
385
|
-
height = Math.max(height, cellHeight);
|
|
368
|
+
for (let i = 0; i < cellList.length; i++) {
|
|
369
|
+
const cellElem = cellList[i];
|
|
370
|
+
const tdEl = cellElem.parentElement;
|
|
371
|
+
if (!tdEl || !tdEl.clientWidth) {
|
|
372
|
+
break;
|
|
386
373
|
}
|
|
374
|
+
if (!calcPadding) {
|
|
375
|
+
paddingTop = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingTop);
|
|
376
|
+
paddingBottom = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
377
|
+
calcPadding = true;
|
|
378
|
+
}
|
|
379
|
+
let cellHeight = paddingTop + paddingBottom;
|
|
380
|
+
if (cellElem) {
|
|
381
|
+
cellHeight += cellElem.clientHeight;
|
|
382
|
+
}
|
|
383
|
+
height = Math.max(height, cellHeight);
|
|
387
384
|
}
|
|
388
|
-
rowRest.height = height;
|
|
385
|
+
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
389
386
|
}
|
|
390
387
|
});
|
|
391
388
|
}
|
|
@@ -516,15 +513,22 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
516
513
|
prevDragToChild
|
|
517
514
|
} = internalData;
|
|
518
515
|
const wrapperRect = el.getBoundingClientRect();
|
|
516
|
+
const tableWidth = el.clientWidth;
|
|
517
|
+
const tableHeight = el.clientHeight;
|
|
519
518
|
if (trEl) {
|
|
520
519
|
const rdLineEl = $xeTable.$refs.refDragRowLineElem;
|
|
521
520
|
if (rdLineEl) {
|
|
522
521
|
if (showLine) {
|
|
523
522
|
const trRect = trEl.getBoundingClientRect();
|
|
523
|
+
let trHeight = trEl.clientHeight;
|
|
524
|
+
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
525
|
+
if (offsetTop + trHeight > tableHeight - scrollbarHeight) {
|
|
526
|
+
trHeight = tableHeight - offsetTop - scrollbarHeight;
|
|
527
|
+
}
|
|
524
528
|
rdLineEl.style.display = 'block';
|
|
525
|
-
rdLineEl.style.top = `${
|
|
526
|
-
rdLineEl.style.height = `${
|
|
527
|
-
rdLineEl.style.width = `${
|
|
529
|
+
rdLineEl.style.top = `${offsetTop}px`;
|
|
530
|
+
rdLineEl.style.height = `${trHeight}px`;
|
|
531
|
+
rdLineEl.style.width = `${tableWidth - scrollbarWidth}px`;
|
|
528
532
|
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
529
533
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
530
534
|
} else {
|
|
@@ -535,16 +539,31 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
535
539
|
const cdLineEl = $xeTable.$refs.refDragColLineElem;
|
|
536
540
|
if (cdLineEl) {
|
|
537
541
|
if (showLine) {
|
|
542
|
+
const leftContainerElem = $xeTable.$refs.leftContainer;
|
|
543
|
+
const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
|
|
544
|
+
const rightContainerElem = $xeTable.$refs.rightContainer;
|
|
545
|
+
const rightContainerWidth = rightContainerElem ? rightContainerElem.clientWidth : 0;
|
|
538
546
|
const thRect = thEl.getBoundingClientRect();
|
|
547
|
+
let thWidth = thEl.clientWidth;
|
|
539
548
|
const offsetTop = Math.max(0, thRect.y - wrapperRect.y);
|
|
549
|
+
const startX = leftContainerWidth;
|
|
550
|
+
let offsetLeft = thRect.x - wrapperRect.x;
|
|
551
|
+
if (offsetLeft < startX) {
|
|
552
|
+
thWidth -= startX - offsetLeft;
|
|
553
|
+
offsetLeft = startX;
|
|
554
|
+
}
|
|
555
|
+
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : scrollbarWidth);
|
|
556
|
+
if (offsetLeft + thWidth > endX) {
|
|
557
|
+
thWidth = endX - offsetLeft;
|
|
558
|
+
}
|
|
540
559
|
cdLineEl.style.display = 'block';
|
|
541
560
|
cdLineEl.style.top = `${offsetTop}px`;
|
|
542
|
-
cdLineEl.style.left = `${
|
|
543
|
-
cdLineEl.style.width = `${
|
|
561
|
+
cdLineEl.style.left = `${offsetLeft}px`;
|
|
562
|
+
cdLineEl.style.width = `${thWidth}px`;
|
|
544
563
|
if (prevDragToChild) {
|
|
545
564
|
cdLineEl.style.height = `${thRect.height}px`;
|
|
546
565
|
} else {
|
|
547
|
-
cdLineEl.style.height = `${
|
|
566
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - scrollbarHeight}px`;
|
|
548
567
|
}
|
|
549
568
|
cdLineEl.setAttribute('drag-pos', dragPos);
|
|
550
569
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
@@ -1030,7 +1049,7 @@ const Methods = {
|
|
|
1030
1049
|
return Promise.resolve(this.restoreCustomStorage()).then(() => {
|
|
1031
1050
|
this._isLoading = false;
|
|
1032
1051
|
this.cacheColumnMap();
|
|
1033
|
-
this.parseColumns().then(() => {
|
|
1052
|
+
this.parseColumns(true).then(() => {
|
|
1034
1053
|
if (this.scrollXLoad) {
|
|
1035
1054
|
this.loadScrollXData(true);
|
|
1036
1055
|
}
|
|
@@ -2902,15 +2921,11 @@ const Methods = {
|
|
|
2902
2921
|
/**
|
|
2903
2922
|
* 刷新列配置
|
|
2904
2923
|
*/
|
|
2905
|
-
refreshColumn(
|
|
2906
|
-
if (
|
|
2907
|
-
|
|
2908
|
-
this.collectColumn = columnList;
|
|
2909
|
-
const tableFullColumn = getColumnList(columnList);
|
|
2910
|
-
this.tableFullColumn = tableFullColumn;
|
|
2911
|
-
this.cacheColumnMap();
|
|
2924
|
+
refreshColumn(initSort) {
|
|
2925
|
+
if (initSort) {
|
|
2926
|
+
this.handleUpdateColumn();
|
|
2912
2927
|
}
|
|
2913
|
-
return this.parseColumns().then(() => {
|
|
2928
|
+
return this.parseColumns(true).then(() => {
|
|
2914
2929
|
return this.refreshScroll();
|
|
2915
2930
|
}).then(() => {
|
|
2916
2931
|
return this.recalculate();
|
|
@@ -2920,7 +2935,7 @@ const Methods = {
|
|
|
2920
2935
|
* 刷新列信息
|
|
2921
2936
|
* 将固定的列左边、右边分别靠边
|
|
2922
2937
|
*/
|
|
2923
|
-
parseColumns() {
|
|
2938
|
+
parseColumns(isReset) {
|
|
2924
2939
|
const $xeTable = this;
|
|
2925
2940
|
const props = $xeTable;
|
|
2926
2941
|
const internalData = $xeTable;
|
|
@@ -3024,12 +3039,14 @@ const Methods = {
|
|
|
3024
3039
|
(0, _log.warnLog)('vxe.error.scrollErrProp', ['footer-span-method']);
|
|
3025
3040
|
}
|
|
3026
3041
|
}
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3042
|
+
if (isReset) {
|
|
3043
|
+
const {
|
|
3044
|
+
visibleSize
|
|
3045
|
+
} = handleVirtualXVisible(this);
|
|
3046
|
+
scrollXStore.startIndex = 0;
|
|
3047
|
+
scrollXStore.endIndex = visibleSize;
|
|
3048
|
+
scrollXStore.visibleSize = visibleSize;
|
|
3049
|
+
}
|
|
3033
3050
|
}
|
|
3034
3051
|
// 如果列被显示/隐藏,则清除合并状态
|
|
3035
3052
|
// 如果列被设置为固定,则清除合并状态
|
|
@@ -3047,12 +3064,15 @@ const Methods = {
|
|
|
3047
3064
|
});
|
|
3048
3065
|
this.visibleColumn = visibleColumn;
|
|
3049
3066
|
this.handleTableColumn();
|
|
3050
|
-
|
|
3051
|
-
return this.
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3067
|
+
if (isReset) {
|
|
3068
|
+
return this.updateFooter().then(() => {
|
|
3069
|
+
return this.recalculate();
|
|
3070
|
+
}).then(() => {
|
|
3071
|
+
this.updateCellAreas();
|
|
3072
|
+
return this.recalculate();
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
3075
|
+
return this.updateFooter();
|
|
3056
3076
|
},
|
|
3057
3077
|
/**
|
|
3058
3078
|
* 指定列宽的列进行拆分
|
|
@@ -3383,56 +3403,6 @@ const Methods = {
|
|
|
3383
3403
|
this.checkScrolling();
|
|
3384
3404
|
}
|
|
3385
3405
|
},
|
|
3386
|
-
calcCellHeight() {
|
|
3387
|
-
const $xeTable = this;
|
|
3388
|
-
const props = $xeTable;
|
|
3389
|
-
const reactData = $xeTable;
|
|
3390
|
-
const internalData = $xeTable;
|
|
3391
|
-
const {
|
|
3392
|
-
showOverflow
|
|
3393
|
-
} = props;
|
|
3394
|
-
const {
|
|
3395
|
-
tableData,
|
|
3396
|
-
scrollXLoad,
|
|
3397
|
-
scrollYLoad
|
|
3398
|
-
} = reactData;
|
|
3399
|
-
const {
|
|
3400
|
-
fullAllDataRowIdData
|
|
3401
|
-
} = internalData;
|
|
3402
|
-
const el = $xeTable.$el;
|
|
3403
|
-
if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
|
|
3404
|
-
let paddingTop = 0;
|
|
3405
|
-
let paddingBottom = 0;
|
|
3406
|
-
let calcPadding = false;
|
|
3407
|
-
tableData.forEach(row => {
|
|
3408
|
-
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
3409
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
3410
|
-
const trList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`);
|
|
3411
|
-
if (rowRest && trList.length) {
|
|
3412
|
-
let height = 0;
|
|
3413
|
-
for (let i = 0; i < trList.length; i++) {
|
|
3414
|
-
const trEl = trList[i];
|
|
3415
|
-
const tdList = trEl.children;
|
|
3416
|
-
for (let j = 0; j < tdList.length; j++) {
|
|
3417
|
-
const tdEl = tdList[j];
|
|
3418
|
-
const cellElem = tdEl.querySelector('.vxe-cell');
|
|
3419
|
-
if (!calcPadding) {
|
|
3420
|
-
paddingTop = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingTop);
|
|
3421
|
-
paddingBottom = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
3422
|
-
calcPadding = true;
|
|
3423
|
-
}
|
|
3424
|
-
let cellHeight = paddingTop + paddingBottom;
|
|
3425
|
-
if (cellElem) {
|
|
3426
|
-
cellHeight += cellElem.offsetHeight;
|
|
3427
|
-
}
|
|
3428
|
-
height = Math.max(height, cellHeight);
|
|
3429
|
-
}
|
|
3430
|
-
}
|
|
3431
|
-
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
3432
|
-
}
|
|
3433
|
-
});
|
|
3434
|
-
}
|
|
3435
|
-
},
|
|
3436
3406
|
updateHeight() {
|
|
3437
3407
|
this.customHeight = calcTableHeight(this, 'height');
|
|
3438
3408
|
this.customMinHeight = calcTableHeight(this, 'minHeight');
|
|
@@ -3468,11 +3438,8 @@ const Methods = {
|
|
|
3468
3438
|
editStore,
|
|
3469
3439
|
currentRow,
|
|
3470
3440
|
mouseConfig,
|
|
3471
|
-
keyboardConfig,
|
|
3472
|
-
keyboardOpts,
|
|
3473
3441
|
spanMethod,
|
|
3474
|
-
|
|
3475
|
-
mergeFooterList,
|
|
3442
|
+
expandColumn,
|
|
3476
3443
|
footerSpanMethod,
|
|
3477
3444
|
isAllOverflow,
|
|
3478
3445
|
visibleColumn
|
|
@@ -3529,10 +3496,17 @@ const Methods = {
|
|
|
3529
3496
|
if (isGroup) {
|
|
3530
3497
|
renderColumnList = visibleColumn;
|
|
3531
3498
|
} else {
|
|
3532
|
-
// 如果是使用优化模式
|
|
3533
3499
|
if (fixedType) {
|
|
3534
|
-
|
|
3535
|
-
|
|
3500
|
+
// 如果是使用优化模式
|
|
3501
|
+
if (scrollXLoad || scrollYLoad || allColumnHeaderOverflow) {
|
|
3502
|
+
// 如果不支持优化模式
|
|
3503
|
+
if (spanMethod || footerSpanMethod) {
|
|
3504
|
+
renderColumnList = visibleColumn;
|
|
3505
|
+
} else {
|
|
3506
|
+
renderColumnList = fixedColumn || [];
|
|
3507
|
+
}
|
|
3508
|
+
} else {
|
|
3509
|
+
renderColumnList = visibleColumn;
|
|
3536
3510
|
}
|
|
3537
3511
|
}
|
|
3538
3512
|
}
|
|
@@ -3619,14 +3593,14 @@ const Methods = {
|
|
|
3619
3593
|
}
|
|
3620
3594
|
let tWidth = tableWidth;
|
|
3621
3595
|
let renderColumnList = tableColumn;
|
|
3622
|
-
// 如果是使用优化模式
|
|
3623
3596
|
if (fixedType) {
|
|
3624
|
-
//
|
|
3625
|
-
if (
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
} else {
|
|
3597
|
+
// 如果是使用优化模式
|
|
3598
|
+
if (scrollXLoad || scrollYLoad || allColumnOverflow && isAllOverflow) {
|
|
3599
|
+
// 如果不支持优化模式
|
|
3600
|
+
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
3629
3601
|
renderColumnList = visibleColumn;
|
|
3602
|
+
} else {
|
|
3603
|
+
renderColumnList = fixedColumn || [];
|
|
3630
3604
|
}
|
|
3631
3605
|
} else {
|
|
3632
3606
|
renderColumnList = visibleColumn;
|
|
@@ -3644,14 +3618,14 @@ const Methods = {
|
|
|
3644
3618
|
} else if (layout === 'footer') {
|
|
3645
3619
|
let tWidth = tableWidth;
|
|
3646
3620
|
let renderColumnList = tableColumn;
|
|
3647
|
-
// 如果是使用优化模式
|
|
3648
3621
|
if (fixedType) {
|
|
3649
|
-
//
|
|
3650
|
-
if (
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
} else {
|
|
3622
|
+
// 如果是使用优化模式
|
|
3623
|
+
if (scrollXLoad || scrollYLoad || allColumnFooterOverflow) {
|
|
3624
|
+
// 如果不支持优化模式
|
|
3625
|
+
if (spanMethod || footerSpanMethod) {
|
|
3654
3626
|
renderColumnList = visibleColumn;
|
|
3627
|
+
} else {
|
|
3628
|
+
renderColumnList = fixedColumn || [];
|
|
3655
3629
|
}
|
|
3656
3630
|
} else {
|
|
3657
3631
|
renderColumnList = visibleColumn;
|
|
@@ -6097,7 +6071,10 @@ const Methods = {
|
|
|
6097
6071
|
const triggerFilter = (0, _dom.getEventTargetNode)(evnt, cell, 'vxe-cell--filter').flag;
|
|
6098
6072
|
let triggerDrag = false;
|
|
6099
6073
|
if (!(triggerInput || triggerCheckbox || triggerSort || triggerFilter)) {
|
|
6100
|
-
|
|
6074
|
+
const {
|
|
6075
|
+
column
|
|
6076
|
+
} = params;
|
|
6077
|
+
if (columnOpts.drag && !column.fixed && trigger === 'cell' && !(disabledMethod && disabledMethod(params))) {
|
|
6101
6078
|
triggerDrag = true;
|
|
6102
6079
|
$xeTable.handleHeaderCellDragMousedownEvent(evnt, params);
|
|
6103
6080
|
}
|
|
@@ -6474,7 +6451,7 @@ const Methods = {
|
|
|
6474
6451
|
evnt.dataTransfer.setDragImage(img, 0, 0);
|
|
6475
6452
|
}
|
|
6476
6453
|
},
|
|
6477
|
-
|
|
6454
|
+
handleColDragSwapEvent(evnt, isSyncColumn, dragCol, prevDragCol, prevDragPos, prevDragToChild) {
|
|
6478
6455
|
const $xeTable = this;
|
|
6479
6456
|
const props = $xeTable;
|
|
6480
6457
|
const reactData = $xeTable;
|
|
@@ -6490,13 +6467,7 @@ const Methods = {
|
|
|
6490
6467
|
dragEndMethod
|
|
6491
6468
|
} = columnDragOpts;
|
|
6492
6469
|
const {
|
|
6493
|
-
|
|
6494
|
-
} = reactData;
|
|
6495
|
-
const {
|
|
6496
|
-
collectColumn,
|
|
6497
|
-
prevDragCol,
|
|
6498
|
-
prevDragPos,
|
|
6499
|
-
prevDragToChild
|
|
6470
|
+
collectColumn
|
|
6500
6471
|
} = internalData;
|
|
6501
6472
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
6502
6473
|
if (prevDragCol && dragCol) {
|
|
@@ -6504,7 +6475,7 @@ const Methods = {
|
|
|
6504
6475
|
if (prevDragCol !== dragCol) {
|
|
6505
6476
|
const oldColumn = dragCol;
|
|
6506
6477
|
const newColumn = prevDragCol;
|
|
6507
|
-
Promise.resolve(dragEndMethod ? dragEndMethod({
|
|
6478
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod({
|
|
6508
6479
|
oldColumn,
|
|
6509
6480
|
newColumn,
|
|
6510
6481
|
dragPos: prevDragPos,
|
|
@@ -6625,9 +6596,6 @@ const Methods = {
|
|
|
6625
6596
|
$xeTable.clearCopyCellArea();
|
|
6626
6597
|
}
|
|
6627
6598
|
}
|
|
6628
|
-
$xeTable.refreshColumn(true).then(() => {
|
|
6629
|
-
$xeTable.updateCellAreas();
|
|
6630
|
-
});
|
|
6631
6599
|
$xeTable.dispatchEvent('column-dragend', {
|
|
6632
6600
|
oldColumn,
|
|
6633
6601
|
newColumn,
|
|
@@ -6638,10 +6606,31 @@ const Methods = {
|
|
|
6638
6606
|
oldIndex: oafIndex
|
|
6639
6607
|
}
|
|
6640
6608
|
}, evnt);
|
|
6641
|
-
|
|
6609
|
+
if (isSyncColumn) {
|
|
6610
|
+
$xeTable.handleUpdateColumn();
|
|
6611
|
+
$xeTable.parseColumns(false).then(() => {
|
|
6612
|
+
$xeTable.updateCellAreas();
|
|
6613
|
+
return $xeTable.saveCustomStore('update:sort');
|
|
6614
|
+
});
|
|
6615
|
+
}
|
|
6642
6616
|
}).catch(() => {});
|
|
6643
6617
|
}
|
|
6644
6618
|
}
|
|
6619
|
+
return Promise.resolve();
|
|
6620
|
+
},
|
|
6621
|
+
handleHeaderCellDragDragendEvent(evnt) {
|
|
6622
|
+
const $xeTable = this;
|
|
6623
|
+
const reactData = $xeTable;
|
|
6624
|
+
const internalData = $xeTable;
|
|
6625
|
+
const {
|
|
6626
|
+
dragCol
|
|
6627
|
+
} = reactData;
|
|
6628
|
+
const {
|
|
6629
|
+
prevDragCol,
|
|
6630
|
+
prevDragPos,
|
|
6631
|
+
prevDragToChild
|
|
6632
|
+
} = internalData;
|
|
6633
|
+
$xeTable.handleColDragSwapEvent(evnt, true, dragCol, prevDragCol, prevDragPos, prevDragToChild);
|
|
6645
6634
|
hideDropTip($xeTable);
|
|
6646
6635
|
clearColDropOrigin($xeTable);
|
|
6647
6636
|
internalData.prevDragToChild = false;
|
|
@@ -6649,6 +6638,9 @@ const Methods = {
|
|
|
6649
6638
|
reactData.dragCol = null;
|
|
6650
6639
|
setTimeout(() => {
|
|
6651
6640
|
reactData.isDragColMove = false;
|
|
6641
|
+
$xeTable.recalculate().then(() => {
|
|
6642
|
+
$xeTable.loadScrollXData();
|
|
6643
|
+
});
|
|
6652
6644
|
}, 500);
|
|
6653
6645
|
},
|
|
6654
6646
|
handleHeaderCellDragDragoverEvent(evnt) {
|
|
@@ -6674,11 +6666,11 @@ const Methods = {
|
|
|
6674
6666
|
if (column) {
|
|
6675
6667
|
evnt.preventDefault();
|
|
6676
6668
|
const {
|
|
6677
|
-
|
|
6678
|
-
} =
|
|
6679
|
-
const offsetX =
|
|
6669
|
+
clientX
|
|
6670
|
+
} = evnt;
|
|
6671
|
+
const offsetX = clientX - thEl.getBoundingClientRect().x;
|
|
6680
6672
|
const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
|
|
6681
|
-
if (dragCol && dragCol.id === column.id || !isCrossDrag && column.parentId) {
|
|
6673
|
+
if (column.fixed || dragCol && dragCol.id === column.id || !isCrossDrag && column.parentId) {
|
|
6682
6674
|
showDropTip($xeTable, evnt, null, thEl, false, dragPos);
|
|
6683
6675
|
return;
|
|
6684
6676
|
}
|
|
@@ -6691,6 +6683,35 @@ const Methods = {
|
|
|
6691
6683
|
targetColumn: column,
|
|
6692
6684
|
dragPos
|
|
6693
6685
|
}, evnt);
|
|
6686
|
+
// 边缘滚动
|
|
6687
|
+
const el = $xeTable.$refs.refElem;
|
|
6688
|
+
if (!el) {
|
|
6689
|
+
return;
|
|
6690
|
+
}
|
|
6691
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
6692
|
+
const tableBody = $xeTable.$refs.tableBody;
|
|
6693
|
+
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
6694
|
+
const scrollTargetEl = xHandleEl || tableBodyElem;
|
|
6695
|
+
if (scrollTargetEl) {
|
|
6696
|
+
const wrapperRect = el.getBoundingClientRect();
|
|
6697
|
+
const tableWidth = el.clientWidth;
|
|
6698
|
+
const leftContainerElem = $xeTable.$refs.leftContainer;
|
|
6699
|
+
const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
|
|
6700
|
+
const rightContainerElem = $xeTable.$refs.rightContainer;
|
|
6701
|
+
const rightContainerWidth = rightContainerElem ? rightContainerElem.clientWidth : 0;
|
|
6702
|
+
const srartX = wrapperRect.x + leftContainerWidth;
|
|
6703
|
+
const endX = wrapperRect.x + tableWidth - rightContainerWidth;
|
|
6704
|
+
const distSize = 28;
|
|
6705
|
+
const startDistSize = clientX - srartX;
|
|
6706
|
+
const endDistSize = endX - clientX;
|
|
6707
|
+
if (startDistSize > 0 && startDistSize <= distSize) {
|
|
6708
|
+
const scrollRatio = Math.floor(tableWidth / (startDistSize > distSize / 2 ? 240 : 120));
|
|
6709
|
+
scrollTargetEl.scrollLeft -= scrollRatio * (distSize - startDistSize);
|
|
6710
|
+
} else if (endDistSize > 0 && endDistSize <= distSize) {
|
|
6711
|
+
const scrollRatio = Math.floor(tableWidth / (endDistSize > distSize / 2 ? 240 : 120));
|
|
6712
|
+
scrollTargetEl.scrollLeft += scrollRatio * (distSize - endDistSize);
|
|
6713
|
+
}
|
|
6714
|
+
}
|
|
6694
6715
|
}
|
|
6695
6716
|
},
|
|
6696
6717
|
handleHeaderCellDragMousedownEvent(evnt, params) {
|
|
@@ -8242,6 +8263,15 @@ const Methods = {
|
|
|
8242
8263
|
});
|
|
8243
8264
|
this.tableColumn = tableColumn;
|
|
8244
8265
|
},
|
|
8266
|
+
handleUpdateColumn() {
|
|
8267
|
+
const $xeTable = this;
|
|
8268
|
+
const internalData = $xeTable;
|
|
8269
|
+
const columnList = _xeUtils.default.orderBy(internalData.collectColumn, 'renderSortNumber');
|
|
8270
|
+
internalData.collectColumn = columnList;
|
|
8271
|
+
const tableFullColumn = getColumnList(columnList);
|
|
8272
|
+
internalData.tableFullColumn = tableFullColumn;
|
|
8273
|
+
$xeTable.cacheColumnMap();
|
|
8274
|
+
},
|
|
8245
8275
|
updateScrollXData() {
|
|
8246
8276
|
const $xeTable = this;
|
|
8247
8277
|
const props = $xeTable;
|