vxe-table 3.10.15 → 3.11.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/README.md +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +5 -1
- package/es/table/module/edit/mixin.js +24 -15
- package/es/table/module/validator/mixin.js +31 -10
- package/es/table/src/body.js +40 -24
- package/es/table/src/cell.js +75 -32
- package/es/table/src/footer.js +159 -131
- package/es/table/src/header.js +128 -90
- package/es/table/src/methods.js +292 -66
- package/es/table/src/props.js +5 -1
- package/es/table/src/table.js +64 -20
- package/es/table/style.css +33 -20
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +9 -4
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +33 -20
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.umd.js +945 -460
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +5 -1
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/edit/mixin.js +24 -15
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +31 -10
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/body.js +31 -15
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +82 -35
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +198 -161
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +169 -128
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +321 -69
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +5 -1
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +70 -20
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +33 -20
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +9 -4
- 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 +33 -20
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +3 -3
- package/packages/table/module/custom/mixin.ts +5 -1
- package/packages/table/module/edit/mixin.ts +24 -15
- package/packages/table/module/validator/mixin.ts +33 -10
- package/packages/table/src/body.ts +43 -25
- package/packages/table/src/cell.ts +120 -67
- package/packages/table/src/footer.ts +164 -150
- package/packages/table/src/header.ts +136 -90
- package/packages/table/src/methods.ts +304 -68
- package/packages/table/src/props.ts +5 -1
- package/packages/table/src/table.ts +71 -19
- package/packages/ui/index.ts +8 -3
- package/styles/components/table.scss +42 -35
- /package/es/{iconfont.1731574584971.ttf → iconfont.1731890707082.ttf} +0 -0
- /package/es/{iconfont.1731574584971.woff → iconfont.1731890707082.woff} +0 -0
- /package/es/{iconfont.1731574584971.woff2 → iconfont.1731890707082.woff2} +0 -0
- /package/lib/{iconfont.1731574584971.ttf → iconfont.1731890707082.ttf} +0 -0
- /package/lib/{iconfont.1731574584971.woff → iconfont.1731890707082.woff} +0 -0
- /package/lib/{iconfont.1731574584971.woff2 → iconfont.1731890707082.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.
|
|
2223
|
+
const version = "3.11.0";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2257,8 +2257,11 @@ core_.VxeUI.setConfig({
|
|
|
2257
2257
|
// trigger: 'default'
|
|
2258
2258
|
strict: true
|
|
2259
2259
|
},
|
|
2260
|
-
|
|
2261
|
-
|
|
2260
|
+
rowDragConfig: {
|
|
2261
|
+
showIcon: true
|
|
2262
|
+
},
|
|
2263
|
+
columnDragConfig: {
|
|
2264
|
+
showIcon: true
|
|
2262
2265
|
},
|
|
2263
2266
|
checkboxConfig: {
|
|
2264
2267
|
// trigger: 'default',
|
|
@@ -2355,7 +2358,8 @@ core_.VxeUI.setConfig({
|
|
|
2355
2358
|
},
|
|
2356
2359
|
areaConfig: {
|
|
2357
2360
|
autoClear: true,
|
|
2358
|
-
selectCellByHeader: true
|
|
2361
|
+
selectCellByHeader: true,
|
|
2362
|
+
selectCellByBody: true
|
|
2359
2363
|
},
|
|
2360
2364
|
clipConfig: {
|
|
2361
2365
|
isCopy: true,
|
|
@@ -2452,6 +2456,7 @@ core_.VxeUI.setIcon({
|
|
|
2452
2456
|
TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
|
|
2453
2457
|
TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
|
|
2454
2458
|
TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
|
|
2459
|
+
TABLE_DRAG_COLUMN: iconPrefix + 'drag-handle',
|
|
2455
2460
|
// toolbar
|
|
2456
2461
|
TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
|
|
2457
2462
|
TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
|
|
@@ -2769,7 +2774,7 @@ function isNodeElement(elem) {
|
|
|
2769
2774
|
const {
|
|
2770
2775
|
log: log_log
|
|
2771
2776
|
} = core_.VxeUI;
|
|
2772
|
-
const log_version = `table v${"3.
|
|
2777
|
+
const log_version = `table v${"3.11.0"}`;
|
|
2773
2778
|
const warnLog = log_log.create('warn', log_version);
|
|
2774
2779
|
const errLog = log_log.create('error', log_version);
|
|
2775
2780
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3518,12 +3523,17 @@ function renderCellDragIcon(h, params) {
|
|
|
3518
3523
|
const {
|
|
3519
3524
|
$table
|
|
3520
3525
|
} = params;
|
|
3521
|
-
const
|
|
3526
|
+
const tableProps = $table;
|
|
3522
3527
|
const {
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
const
|
|
3528
|
+
dragConfig
|
|
3529
|
+
} = tableProps;
|
|
3530
|
+
const rowDragOpts = $table.computeRowDragOpts;
|
|
3531
|
+
const {
|
|
3532
|
+
icon,
|
|
3533
|
+
disabledMethod
|
|
3534
|
+
} = rowDragOpts;
|
|
3535
|
+
const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null);
|
|
3536
|
+
const isDisabled = rDisabledMethod && rDisabledMethod(params);
|
|
3527
3537
|
return h('span', {
|
|
3528
3538
|
key: 'dg',
|
|
3529
3539
|
class: ['vxe-cell--drag-handle', {
|
|
@@ -3538,14 +3548,13 @@ function renderCellDragIcon(h, params) {
|
|
|
3538
3548
|
mouseup: $table.handleCellDragMouseupEvent
|
|
3539
3549
|
}
|
|
3540
3550
|
}, [h('i', {
|
|
3541
|
-
class: rowIcon || cell_getIcon().TABLE_DRAG_ROW
|
|
3551
|
+
class: icon || (dragConfig ? dragConfig.rowIcon : '') || cell_getIcon().TABLE_DRAG_ROW
|
|
3542
3552
|
})]);
|
|
3543
3553
|
}
|
|
3544
3554
|
function renderCellBaseVNs(h, params, content) {
|
|
3545
3555
|
const {
|
|
3546
3556
|
$table,
|
|
3547
3557
|
column,
|
|
3548
|
-
row,
|
|
3549
3558
|
level
|
|
3550
3559
|
} = params;
|
|
3551
3560
|
const {
|
|
@@ -3553,25 +3562,64 @@ function renderCellBaseVNs(h, params, content) {
|
|
|
3553
3562
|
} = column;
|
|
3554
3563
|
const tableProps = $table;
|
|
3555
3564
|
const {
|
|
3556
|
-
treeConfig
|
|
3565
|
+
treeConfig,
|
|
3566
|
+
dragConfig
|
|
3557
3567
|
} = tableProps;
|
|
3558
3568
|
const rowOpts = $table.computeRowOpts;
|
|
3559
|
-
const
|
|
3569
|
+
const rowDragOpts = $table.computeRowDragOpts;
|
|
3560
3570
|
const {
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
} =
|
|
3571
|
+
showIcon,
|
|
3572
|
+
visibleMethod
|
|
3573
|
+
} = rowDragOpts;
|
|
3574
|
+
const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
|
|
3564
3575
|
const vns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content];
|
|
3565
|
-
if (dragSort && rowOpts.drag && showRowIcon && (!
|
|
3566
|
-
row,
|
|
3567
|
-
column
|
|
3568
|
-
}))) {
|
|
3576
|
+
if (dragSort && rowOpts.drag && (showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params))) {
|
|
3569
3577
|
if (!treeConfig || !level) {
|
|
3570
3578
|
vns.unshift(renderCellDragIcon(h, params));
|
|
3571
3579
|
}
|
|
3572
3580
|
}
|
|
3573
3581
|
return vns;
|
|
3574
3582
|
}
|
|
3583
|
+
function renderHeaderCellDragIcon(h, params) {
|
|
3584
|
+
const {
|
|
3585
|
+
$table,
|
|
3586
|
+
column
|
|
3587
|
+
} = params;
|
|
3588
|
+
const columnOpts = $table.computeColumnOpts;
|
|
3589
|
+
const columnDragOpts = $table.computeColumnDragOpts;
|
|
3590
|
+
const {
|
|
3591
|
+
showIcon,
|
|
3592
|
+
icon,
|
|
3593
|
+
visibleMethod,
|
|
3594
|
+
disabledMethod
|
|
3595
|
+
} = columnDragOpts;
|
|
3596
|
+
const isDisabled = disabledMethod && disabledMethod(params);
|
|
3597
|
+
if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
|
|
3598
|
+
if (!(column.fixed || column.parentId)) {
|
|
3599
|
+
return h('span', {
|
|
3600
|
+
key: 'dg',
|
|
3601
|
+
class: ['vxe-cell--drag-handle', {
|
|
3602
|
+
'is--disabled': isDisabled
|
|
3603
|
+
}],
|
|
3604
|
+
on: {
|
|
3605
|
+
mousedown(evnt) {
|
|
3606
|
+
if (!isDisabled) {
|
|
3607
|
+
$table.handleHeaderCellDragMousedownEvent(evnt, params);
|
|
3608
|
+
}
|
|
3609
|
+
},
|
|
3610
|
+
mouseup: $table.handleHeaderCellDragMouseupEvent
|
|
3611
|
+
}
|
|
3612
|
+
}, [h('i', {
|
|
3613
|
+
class: icon || cell_getIcon().TABLE_DRAG_COLUMN
|
|
3614
|
+
})]);
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
return renderEmptyElement($table);
|
|
3618
|
+
}
|
|
3619
|
+
function renderHeaderCellBaseVNs(h, params, content) {
|
|
3620
|
+
const vns = [renderTitlePrefixIcon(h, params), renderHeaderCellDragIcon(h, params), ...(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(content) ? content : [content]), renderTitleSuffixIcon(h, params)];
|
|
3621
|
+
return vns;
|
|
3622
|
+
}
|
|
3575
3623
|
function renderTitleContent(h, params, content) {
|
|
3576
3624
|
const {
|
|
3577
3625
|
$table,
|
|
@@ -3751,7 +3799,7 @@ const Cell = {
|
|
|
3751
3799
|
return createColumn($xetable, _vm, renMaps);
|
|
3752
3800
|
},
|
|
3753
3801
|
/**
|
|
3754
|
-
*
|
|
3802
|
+
* 列头标题
|
|
3755
3803
|
*/
|
|
3756
3804
|
renderHeaderTitle(h, params) {
|
|
3757
3805
|
const {
|
|
@@ -3777,7 +3825,7 @@ const Cell = {
|
|
|
3777
3825
|
return renderTitleContent(h, params, formatText(column.getTitle(), 1));
|
|
3778
3826
|
},
|
|
3779
3827
|
renderDefaultHeader(h, params) {
|
|
3780
|
-
return
|
|
3828
|
+
return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params));
|
|
3781
3829
|
},
|
|
3782
3830
|
renderDefaultCell(h, params) {
|
|
3783
3831
|
const {
|
|
@@ -3898,7 +3946,7 @@ const Cell = {
|
|
|
3898
3946
|
}, cellVNodes)])];
|
|
3899
3947
|
},
|
|
3900
3948
|
/**
|
|
3901
|
-
*
|
|
3949
|
+
* 序号
|
|
3902
3950
|
*/
|
|
3903
3951
|
renderSeqHeader(h, params) {
|
|
3904
3952
|
const {
|
|
@@ -3908,7 +3956,7 @@ const Cell = {
|
|
|
3908
3956
|
const {
|
|
3909
3957
|
slots
|
|
3910
3958
|
} = column;
|
|
3911
|
-
return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : formatText(column.getTitle(), 1));
|
|
3959
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : formatText(column.getTitle(), 1)));
|
|
3912
3960
|
},
|
|
3913
3961
|
renderSeqCell(h, params) {
|
|
3914
3962
|
const {
|
|
@@ -3947,9 +3995,9 @@ const Cell = {
|
|
|
3947
3995
|
} = column;
|
|
3948
3996
|
const headerSlot = slots ? slots.header : null;
|
|
3949
3997
|
const titleSlot = slots ? slots.title : null;
|
|
3950
|
-
return renderTitleContent(h, params, headerSlot ? $table.callSlot(headerSlot, params, h) : [h('span', {
|
|
3998
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, params, headerSlot ? $table.callSlot(headerSlot, params, h) : [h('span', {
|
|
3951
3999
|
class: 'vxe-radio--label'
|
|
3952
|
-
}, titleSlot ? $table.callSlot(titleSlot, params, h) : formatText(column.getTitle(), 1))]);
|
|
4000
|
+
}, titleSlot ? $table.callSlot(titleSlot, params, h) : formatText(column.getTitle(), 1))]));
|
|
3953
4001
|
},
|
|
3954
4002
|
renderRadioCell(h, params) {
|
|
3955
4003
|
const {
|
|
@@ -4063,14 +4111,14 @@ const Cell = {
|
|
|
4063
4111
|
indeterminate: isAllCheckboxIndeterminate
|
|
4064
4112
|
};
|
|
4065
4113
|
if (headerSlot) {
|
|
4066
|
-
return renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h));
|
|
4114
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)));
|
|
4067
4115
|
}
|
|
4068
4116
|
if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
|
|
4069
|
-
return renderTitleContent(h, checkboxParams, [h('span', {
|
|
4117
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [h('span', {
|
|
4070
4118
|
class: 'vxe-checkbox--label'
|
|
4071
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)]);
|
|
4119
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)]));
|
|
4072
4120
|
}
|
|
4073
|
-
return renderTitleContent(h, checkboxParams, [h('span', {
|
|
4121
|
+
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [h('span', {
|
|
4074
4122
|
class: ['vxe-cell--checkbox', {
|
|
4075
4123
|
'is--checked': isAllCheckboxSelected,
|
|
4076
4124
|
'is--disabled': isAllCheckboxDisabled,
|
|
@@ -4084,7 +4132,7 @@ const Cell = {
|
|
|
4084
4132
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? cell_getIcon().TABLE_CHECKBOX_CHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
4085
4133
|
})].concat(titleSlot || headerTitle ? [h('span', {
|
|
4086
4134
|
class: 'vxe-checkbox--label'
|
|
4087
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)] : []))]);
|
|
4135
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)] : []))]));
|
|
4088
4136
|
},
|
|
4089
4137
|
renderCheckboxCell(h, params) {
|
|
4090
4138
|
const {
|
|
@@ -4356,13 +4404,13 @@ const Cell = {
|
|
|
4356
4404
|
* 排序和筛选
|
|
4357
4405
|
*/
|
|
4358
4406
|
renderSortAndFilterHeader(h, params) {
|
|
4359
|
-
return
|
|
4407
|
+
return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params).concat(Cell.renderSortIcon(h, params)));
|
|
4360
4408
|
},
|
|
4361
4409
|
/**
|
|
4362
4410
|
* 排序
|
|
4363
4411
|
*/
|
|
4364
4412
|
renderSortHeader(h, params) {
|
|
4365
|
-
return Cell.
|
|
4413
|
+
return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params).concat(Cell.renderSortIcon(h, params)));
|
|
4366
4414
|
},
|
|
4367
4415
|
renderSortIcon(h, params) {
|
|
4368
4416
|
const {
|
|
@@ -4409,7 +4457,7 @@ const Cell = {
|
|
|
4409
4457
|
* 筛选
|
|
4410
4458
|
*/
|
|
4411
4459
|
renderFilterHeader(h, params) {
|
|
4412
|
-
return Cell.
|
|
4460
|
+
return renderHeaderCellBaseVNs(h, params, Cell.renderHeaderTitle(h, params).concat(Cell.renderFilterIcon(h, params)));
|
|
4413
4461
|
},
|
|
4414
4462
|
renderFilterIcon(h, params) {
|
|
4415
4463
|
const {
|
|
@@ -4470,11 +4518,15 @@ const Cell = {
|
|
|
4470
4518
|
isRequired = columnRules.some(rule => rule.required);
|
|
4471
4519
|
}
|
|
4472
4520
|
}
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4521
|
+
let editIconVNs = [];
|
|
4522
|
+
if (isEnableConf(editConfig)) {
|
|
4523
|
+
editIconVNs = [isRequired && editOpts.showAsterisk ? h('i', {
|
|
4524
|
+
class: 'vxe-cell--required-icon'
|
|
4525
|
+
}) : renderEmptyElement($table), isEnableConf(editRender) && editOpts.showIcon ? h('i', {
|
|
4526
|
+
class: ['vxe-cell--edit-icon', editOpts.icon || cell_getIcon().TABLE_EDIT]
|
|
4527
|
+
}) : renderEmptyElement($table)];
|
|
4528
|
+
}
|
|
4529
|
+
return renderHeaderCellBaseVNs(h, params, editIconVNs.concat(Cell.renderHeaderTitle(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []));
|
|
4478
4530
|
},
|
|
4479
4531
|
// 行格编辑模式
|
|
4480
4532
|
renderRowEdit(h, params) {
|
|
@@ -5164,66 +5216,124 @@ function updateRowDropOrigin($xeTable, row) {
|
|
|
5164
5216
|
});
|
|
5165
5217
|
}
|
|
5166
5218
|
}
|
|
5167
|
-
|
|
5219
|
+
const updateRowDropTipContent = ($xeTable, tdEl) => {
|
|
5220
|
+
const reactData = $xeTable;
|
|
5221
|
+
const props = $xeTable;
|
|
5222
|
+
const {
|
|
5223
|
+
dragConfig
|
|
5224
|
+
} = props;
|
|
5225
|
+
const {
|
|
5226
|
+
dragRow
|
|
5227
|
+
} = reactData;
|
|
5228
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
5229
|
+
const {
|
|
5230
|
+
tooltipMethod
|
|
5231
|
+
} = rowDragOpts;
|
|
5232
|
+
const rTooltipMethod = tooltipMethod || (dragConfig ? dragConfig.rowTooltipMethod : null);
|
|
5233
|
+
let tipContent = '';
|
|
5234
|
+
if (rTooltipMethod) {
|
|
5235
|
+
tipContent = `${rTooltipMethod({
|
|
5236
|
+
row: dragRow
|
|
5237
|
+
}) || ''}`;
|
|
5238
|
+
} else {
|
|
5239
|
+
tipContent = methods_getI18n('vxe.table.dragTip', [tdEl.textContent || '']);
|
|
5240
|
+
}
|
|
5241
|
+
reactData.dragTipText = tipContent;
|
|
5242
|
+
};
|
|
5243
|
+
const updateColDropOrigin = ($xeTable, column) => {
|
|
5168
5244
|
const el = $xeTable.$el;
|
|
5169
5245
|
if (el) {
|
|
5170
|
-
const clss = '
|
|
5171
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(
|
|
5172
|
-
|
|
5246
|
+
const clss = 'col--drag-origin';
|
|
5247
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[colid="${column.id}"]`), elem => {
|
|
5248
|
+
addClass(elem, clss);
|
|
5173
5249
|
});
|
|
5174
5250
|
}
|
|
5175
|
-
}
|
|
5176
|
-
|
|
5251
|
+
};
|
|
5252
|
+
const clearColDropOrigin = $xeTable => {
|
|
5177
5253
|
const el = $xeTable.$el;
|
|
5178
5254
|
if (el) {
|
|
5179
|
-
const clss = '
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
elem.setAttribute('drag-pos', dragPos);
|
|
5255
|
+
const clss = 'col--drag-origin';
|
|
5256
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`), elem => {
|
|
5257
|
+
elem.draggable = false;
|
|
5258
|
+
removeClass(elem, clss);
|
|
5184
5259
|
});
|
|
5185
5260
|
}
|
|
5186
|
-
}
|
|
5187
|
-
|
|
5188
|
-
const
|
|
5189
|
-
|
|
5190
|
-
|
|
5261
|
+
};
|
|
5262
|
+
const updateColDropTipContent = ($xeTable, tdEl) => {
|
|
5263
|
+
const reactData = $xeTable;
|
|
5264
|
+
const {
|
|
5265
|
+
dragCol
|
|
5266
|
+
} = reactData;
|
|
5267
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
5268
|
+
const {
|
|
5269
|
+
tooltipMethod
|
|
5270
|
+
} = columnDragOpts;
|
|
5271
|
+
let tipContent = '';
|
|
5272
|
+
if (tooltipMethod) {
|
|
5273
|
+
tipContent = `${tooltipMethod({
|
|
5274
|
+
column: dragCol
|
|
5275
|
+
}) || ''}`;
|
|
5276
|
+
} else {
|
|
5277
|
+
tipContent = methods_getI18n('vxe.table.dragTip', [tdEl.textContent || '']);
|
|
5191
5278
|
}
|
|
5192
|
-
|
|
5279
|
+
reactData.dragTipText = tipContent;
|
|
5280
|
+
};
|
|
5281
|
+
function showDropTip($xeTable, evnt, trEl, thEl, dragPos) {
|
|
5282
|
+
const reactData = $xeTable;
|
|
5283
|
+
const el = $xeTable.$refs.refElem;
|
|
5193
5284
|
if (!el) {
|
|
5194
5285
|
return;
|
|
5195
5286
|
}
|
|
5287
|
+
const {
|
|
5288
|
+
scrollbarWidth,
|
|
5289
|
+
scrollbarHeight
|
|
5290
|
+
} = reactData;
|
|
5291
|
+
const wrapperRect = el.getBoundingClientRect();
|
|
5292
|
+
if (trEl) {
|
|
5293
|
+
const rdLineEl = $xeTable.$refs.refDragRowLineElem;
|
|
5294
|
+
if (rdLineEl) {
|
|
5295
|
+
const trRect = trEl.getBoundingClientRect();
|
|
5296
|
+
let top = Math.max(1, trRect.y - wrapperRect.y);
|
|
5297
|
+
if (dragPos === 'bottom') {
|
|
5298
|
+
top = Math.min(wrapperRect.height - 1, trRect.y - wrapperRect.y + trRect.height);
|
|
5299
|
+
}
|
|
5300
|
+
rdLineEl.style.top = `${top}px`;
|
|
5301
|
+
rdLineEl.style.width = `${wrapperRect.width - scrollbarWidth}px`;
|
|
5302
|
+
rdLineEl.style.display = 'block';
|
|
5303
|
+
}
|
|
5304
|
+
} else if (thEl) {
|
|
5305
|
+
const cdLineEl = $xeTable.$refs.refDragColLineElem;
|
|
5306
|
+
if (cdLineEl) {
|
|
5307
|
+
const thRect = thEl.getBoundingClientRect();
|
|
5308
|
+
let left = Math.max(1, thRect.x - wrapperRect.x);
|
|
5309
|
+
if (dragPos === 'right') {
|
|
5310
|
+
left = Math.min(wrapperRect.width - 2, thRect.x - wrapperRect.x + thRect.width);
|
|
5311
|
+
}
|
|
5312
|
+
cdLineEl.style.left = `${left}px`;
|
|
5313
|
+
cdLineEl.style.height = `${wrapperRect.height - scrollbarHeight}px`;
|
|
5314
|
+
cdLineEl.style.display = 'block';
|
|
5315
|
+
}
|
|
5316
|
+
}
|
|
5317
|
+
const rdTipEl = $xeTable.$refs.refDragTipElem;
|
|
5196
5318
|
if (rdTipEl) {
|
|
5197
|
-
const wrapperRect = el.getBoundingClientRect();
|
|
5198
5319
|
rdTipEl.style.display = 'block';
|
|
5199
5320
|
rdTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
|
|
5200
5321
|
rdTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - rdTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
|
|
5201
5322
|
}
|
|
5202
5323
|
}
|
|
5203
|
-
const
|
|
5204
|
-
const rdTipEl = $xeTable.$refs.
|
|
5324
|
+
const hideDropTip = $xeTable => {
|
|
5325
|
+
const rdTipEl = $xeTable.$refs.refDragTipElem;
|
|
5326
|
+
const rdLineEl = $xeTable.$refs.refDragRowLineElem;
|
|
5327
|
+
const cdLineEl = $xeTable.$refs.refDragColLineElem;
|
|
5205
5328
|
if (rdTipEl) {
|
|
5206
5329
|
rdTipEl.style.display = '';
|
|
5207
5330
|
}
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
} = reactData;
|
|
5214
|
-
const dragOpts = $xeTable.computeDragOpts;
|
|
5215
|
-
const {
|
|
5216
|
-
rowTooltipMethod
|
|
5217
|
-
} = dragOpts;
|
|
5218
|
-
let tipContent = '';
|
|
5219
|
-
if (rowTooltipMethod) {
|
|
5220
|
-
tipContent = `${rowTooltipMethod({
|
|
5221
|
-
row: dragRow
|
|
5222
|
-
}) || ''}`;
|
|
5223
|
-
} else {
|
|
5224
|
-
tipContent = methods_getI18n('vxe.table.dragTip', [tdEl.textContent || '']);
|
|
5331
|
+
if (rdLineEl) {
|
|
5332
|
+
rdLineEl.style.display = '';
|
|
5333
|
+
}
|
|
5334
|
+
if (cdLineEl) {
|
|
5335
|
+
cdLineEl.style.display = '';
|
|
5225
5336
|
}
|
|
5226
|
-
reactData.dragTipText = tipContent;
|
|
5227
5337
|
};
|
|
5228
5338
|
const Methods = {
|
|
5229
5339
|
callSlot(slotFunc, params, h, vNodes) {
|
|
@@ -5428,6 +5538,7 @@ const Methods = {
|
|
|
5428
5538
|
editStore.removeMaps = {};
|
|
5429
5539
|
const sYLoad = this.updateScrollYStatus(fullData);
|
|
5430
5540
|
this.scrollYLoad = sYLoad;
|
|
5541
|
+
this.isDragRowMove = false;
|
|
5431
5542
|
// 全量数据
|
|
5432
5543
|
this.tableFullData = fullData;
|
|
5433
5544
|
this.tableFullTreeData = treeData;
|
|
@@ -5619,6 +5730,7 @@ const Methods = {
|
|
|
5619
5730
|
const tableFullColumn = getColumnList(collectColumn);
|
|
5620
5731
|
this.tableFullColumn = tableFullColumn;
|
|
5621
5732
|
this._isLoading = true;
|
|
5733
|
+
this.isDragColMove = false;
|
|
5622
5734
|
this.initColumnSort();
|
|
5623
5735
|
return Promise.resolve(this.restoreCustomStorage()).then(() => {
|
|
5624
5736
|
this._isLoading = false;
|
|
@@ -8282,7 +8394,14 @@ const Methods = {
|
|
|
8282
8394
|
if (isClear ||
|
|
8283
8395
|
// 如果点击了当前表格之外
|
|
8284
8396
|
!getEventTargetNode(evnt, $el).flag) {
|
|
8285
|
-
setTimeout(() =>
|
|
8397
|
+
setTimeout(() => {
|
|
8398
|
+
this.handleClearEdit(evnt).then(() => {
|
|
8399
|
+
// 如果存在校验,点击了表格之外则清除
|
|
8400
|
+
if (!this.isActivated && editRules && validOpts.autoClear) {
|
|
8401
|
+
this.validErrorMaps = {};
|
|
8402
|
+
}
|
|
8403
|
+
});
|
|
8404
|
+
});
|
|
8286
8405
|
}
|
|
8287
8406
|
});
|
|
8288
8407
|
}
|
|
@@ -8359,8 +8478,8 @@ const Methods = {
|
|
|
8359
8478
|
if (isEsc) {
|
|
8360
8479
|
this.preventEvent(evnt, 'event.keydown', null, () => {
|
|
8361
8480
|
this.emitEvent('keydown-start', {}, evnt);
|
|
8362
|
-
if (keyboardConfig && mouseConfig && mouseOpts.area && this.
|
|
8363
|
-
this.
|
|
8481
|
+
if (keyboardConfig && mouseConfig && mouseOpts.area && this.handleKeyboardCellAreaEvent) {
|
|
8482
|
+
this.handleKeyboardCellAreaEvent(evnt);
|
|
8364
8483
|
} else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
|
|
8365
8484
|
evnt.stopPropagation();
|
|
8366
8485
|
// 如果按下了 Esc 键,关闭快捷菜单、筛选
|
|
@@ -8370,7 +8489,7 @@ const Methods = {
|
|
|
8370
8489
|
// 如果是激活编辑状态,则取消编辑
|
|
8371
8490
|
if (actived.row) {
|
|
8372
8491
|
const params = actived.args;
|
|
8373
|
-
this.
|
|
8492
|
+
this.handleClearEdit(evnt);
|
|
8374
8493
|
// 如果配置了选中功能,则为选中状态
|
|
8375
8494
|
if (mouseConfig && mouseOpts.selected) {
|
|
8376
8495
|
this.$nextTick(() => this.handleSelected(params, evnt));
|
|
@@ -8450,8 +8569,8 @@ const Methods = {
|
|
|
8450
8569
|
} else {
|
|
8451
8570
|
this.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, this.ctxMenuList);
|
|
8452
8571
|
}
|
|
8453
|
-
} else if (keyboardConfig && mouseConfig && mouseOpts.area && this.
|
|
8454
|
-
this.
|
|
8572
|
+
} else if (keyboardConfig && mouseConfig && mouseOpts.area && this.handleKeyboardCellAreaEvent) {
|
|
8573
|
+
this.handleKeyboardCellAreaEvent(evnt);
|
|
8455
8574
|
} else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
|
|
8456
8575
|
// 空格键支持选中复选框
|
|
8457
8576
|
evnt.preventDefault();
|
|
@@ -8482,7 +8601,7 @@ const Methods = {
|
|
|
8482
8601
|
// 如果是激活编辑状态,则取消编辑
|
|
8483
8602
|
if (actived.row) {
|
|
8484
8603
|
const params = actived.args;
|
|
8485
|
-
this.
|
|
8604
|
+
this.handleClearEdit(evnt);
|
|
8486
8605
|
// 如果配置了选中功能,则为选中状态
|
|
8487
8606
|
if (mouseConfig && mouseOpts.selected) {
|
|
8488
8607
|
this.$nextTick(() => this.handleSelected(params, evnt));
|
|
@@ -10317,6 +10436,9 @@ const Methods = {
|
|
|
10317
10436
|
this.emitEvent('sort-change', params, evnt);
|
|
10318
10437
|
}
|
|
10319
10438
|
},
|
|
10439
|
+
/**
|
|
10440
|
+
* 行拖拽
|
|
10441
|
+
*/
|
|
10320
10442
|
handleRowDragDragstartEvent(evnt) {
|
|
10321
10443
|
const img = new Image();
|
|
10322
10444
|
if (evnt.dataTransfer) {
|
|
@@ -10329,12 +10451,13 @@ const Methods = {
|
|
|
10329
10451
|
const reactData = $xeTable;
|
|
10330
10452
|
const internalData = $xeTable;
|
|
10331
10453
|
const {
|
|
10332
|
-
treeConfig
|
|
10454
|
+
treeConfig,
|
|
10455
|
+
dragConfig
|
|
10333
10456
|
} = props;
|
|
10334
|
-
const
|
|
10457
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
10335
10458
|
const {
|
|
10336
10459
|
dragEndMethod
|
|
10337
|
-
} =
|
|
10460
|
+
} = rowDragOpts;
|
|
10338
10461
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
10339
10462
|
const {
|
|
10340
10463
|
transform
|
|
@@ -10350,17 +10473,20 @@ const Methods = {
|
|
|
10350
10473
|
prevDragRow,
|
|
10351
10474
|
prevDragPos
|
|
10352
10475
|
} = internalData;
|
|
10476
|
+
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
10477
|
+
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
10353
10478
|
if (prevDragRow && dragRow) {
|
|
10354
10479
|
// 判断是否有拖动
|
|
10355
10480
|
if (prevDragRow !== dragRow) {
|
|
10356
|
-
Promise.resolve(
|
|
10481
|
+
Promise.resolve(dEndMethod ? dEndMethod({
|
|
10357
10482
|
oldRow: dragRow,
|
|
10358
|
-
newRow: prevDragRow
|
|
10483
|
+
newRow: prevDragRow,
|
|
10484
|
+
dragPos: prevDragPos,
|
|
10485
|
+
offsetIndex: dragOffsetIndex
|
|
10359
10486
|
}) : true).then(status => {
|
|
10360
10487
|
if (!status) {
|
|
10361
10488
|
return;
|
|
10362
10489
|
}
|
|
10363
|
-
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
10364
10490
|
let oafIndex = -1;
|
|
10365
10491
|
let nafIndex = -1;
|
|
10366
10492
|
if (treeConfig) {
|
|
@@ -10397,18 +10523,19 @@ const Methods = {
|
|
|
10397
10523
|
if (!(treeConfig && transform)) {
|
|
10398
10524
|
$xeTable.updateAfterDataIndex();
|
|
10399
10525
|
}
|
|
10400
|
-
$xeTable.updateFooter();
|
|
10401
10526
|
$xeTable.checkSelectionStatus();
|
|
10402
10527
|
if (reactData.scrollYLoad) {
|
|
10403
10528
|
$xeTable.updateScrollYSpace();
|
|
10404
10529
|
}
|
|
10405
10530
|
$xeTable.$nextTick().then(() => {
|
|
10406
10531
|
$xeTable.updateCellAreas();
|
|
10407
|
-
|
|
10532
|
+
$xeTable.recalculate();
|
|
10408
10533
|
});
|
|
10409
10534
|
$xeTable.dispatchEvent('row-dragend', {
|
|
10410
10535
|
oldRow: dragRow,
|
|
10411
10536
|
newRow: prevDragRow,
|
|
10537
|
+
dragPos: prevDragPos,
|
|
10538
|
+
offsetIndex: dragOffsetIndex,
|
|
10412
10539
|
_index: {
|
|
10413
10540
|
newIndex: nafIndex,
|
|
10414
10541
|
oldIndex: oafIndex
|
|
@@ -10417,10 +10544,10 @@ const Methods = {
|
|
|
10417
10544
|
}).catch(() => {});
|
|
10418
10545
|
}
|
|
10419
10546
|
}
|
|
10420
|
-
|
|
10547
|
+
hideDropTip($xeTable);
|
|
10421
10548
|
clearRowDropOrigin($xeTable);
|
|
10422
|
-
clearRowDropTarget($xeTable);
|
|
10423
10549
|
reactData.dragRow = null;
|
|
10550
|
+
reactData.dragCol = null;
|
|
10424
10551
|
setTimeout(() => {
|
|
10425
10552
|
reactData.isDragRowMove = false;
|
|
10426
10553
|
}, 500);
|
|
@@ -10429,10 +10556,16 @@ const Methods = {
|
|
|
10429
10556
|
const $xeTable = this;
|
|
10430
10557
|
const internalData = $xeTable;
|
|
10431
10558
|
const reactData = $xeTable;
|
|
10559
|
+
const {
|
|
10560
|
+
dragRow
|
|
10561
|
+
} = reactData;
|
|
10562
|
+
if (!dragRow) {
|
|
10563
|
+
evnt.preventDefault();
|
|
10564
|
+
return;
|
|
10565
|
+
}
|
|
10432
10566
|
const trEl = evnt.currentTarget;
|
|
10433
10567
|
const rowid = trEl.getAttribute('rowid');
|
|
10434
10568
|
const row = $xeTable.getRowById(rowid);
|
|
10435
|
-
clearRowDropTarget($xeTable);
|
|
10436
10569
|
if (row) {
|
|
10437
10570
|
evnt.preventDefault();
|
|
10438
10571
|
evnt.preventDefault();
|
|
@@ -10441,43 +10574,48 @@ const Methods = {
|
|
|
10441
10574
|
} = reactData;
|
|
10442
10575
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
|
|
10443
10576
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
10444
|
-
updateRowDropTarget($xeTable, row, dragPos);
|
|
10445
10577
|
internalData.prevDragRow = row;
|
|
10446
10578
|
internalData.prevDragPos = dragPos;
|
|
10579
|
+
showDropTip($xeTable, evnt, trEl, null, dragPos);
|
|
10447
10580
|
$xeTable.dispatchEvent('row-dragover', {
|
|
10448
10581
|
oldRow: dragRow,
|
|
10449
10582
|
targetRow: row,
|
|
10450
10583
|
dragPos
|
|
10451
10584
|
}, evnt);
|
|
10452
10585
|
}
|
|
10453
|
-
showRowDropTip(evnt, $xeTable);
|
|
10454
10586
|
},
|
|
10455
10587
|
handleCellDragMousedownEvent(evnt, params) {
|
|
10456
10588
|
const $xeTable = this;
|
|
10589
|
+
const props = $xeTable;
|
|
10457
10590
|
const reactData = $xeTable;
|
|
10458
10591
|
evnt.stopPropagation();
|
|
10459
|
-
const
|
|
10592
|
+
const {
|
|
10593
|
+
dragConfig
|
|
10594
|
+
} = props;
|
|
10595
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
10460
10596
|
const {
|
|
10461
10597
|
dragStartMethod
|
|
10462
|
-
} =
|
|
10598
|
+
} = rowDragOpts;
|
|
10463
10599
|
const {
|
|
10464
10600
|
row
|
|
10465
10601
|
} = params;
|
|
10466
10602
|
const dragEl = evnt.currentTarget;
|
|
10467
|
-
const tdEl = dragEl.
|
|
10468
|
-
const trEl = tdEl.
|
|
10603
|
+
const tdEl = dragEl.parentElement?.parentElement;
|
|
10604
|
+
const trEl = tdEl.parentElement;
|
|
10605
|
+
const dStartMethod = dragStartMethod || (dragConfig ? dragConfig.dragStartMethod : null);
|
|
10469
10606
|
reactData.isDragRowMove = false;
|
|
10470
10607
|
clearRowDropOrigin($xeTable);
|
|
10471
|
-
if (
|
|
10608
|
+
if (dStartMethod && !dStartMethod(params)) {
|
|
10472
10609
|
trEl.draggable = false;
|
|
10473
10610
|
reactData.dragRow = null;
|
|
10474
|
-
|
|
10611
|
+
reactData.dragCol = null;
|
|
10612
|
+
hideDropTip($xeTable);
|
|
10475
10613
|
return;
|
|
10476
10614
|
}
|
|
10477
10615
|
reactData.dragRow = row;
|
|
10616
|
+
reactData.dragCol = null;
|
|
10478
10617
|
trEl.draggable = true;
|
|
10479
10618
|
updateRowDropOrigin($xeTable, row);
|
|
10480
|
-
showRowDropTip(evnt, $xeTable);
|
|
10481
10619
|
updateRowDropTipContent($xeTable, tdEl);
|
|
10482
10620
|
$xeTable.dispatchEvent('row-dragstart', params, evnt);
|
|
10483
10621
|
},
|
|
@@ -10485,10 +10623,175 @@ const Methods = {
|
|
|
10485
10623
|
const $xeTable = this;
|
|
10486
10624
|
const reactData = $xeTable;
|
|
10487
10625
|
clearRowDropOrigin($xeTable);
|
|
10488
|
-
|
|
10626
|
+
hideDropTip($xeTable);
|
|
10489
10627
|
reactData.dragRow = null;
|
|
10628
|
+
reactData.dragCol = null;
|
|
10490
10629
|
reactData.isDragRowMove = false;
|
|
10491
10630
|
},
|
|
10631
|
+
/**
|
|
10632
|
+
* 列拖拽
|
|
10633
|
+
*/
|
|
10634
|
+
handleHeaderCellDragDragstartEvent(evnt) {
|
|
10635
|
+
const img = new Image();
|
|
10636
|
+
if (evnt.dataTransfer) {
|
|
10637
|
+
evnt.dataTransfer.setDragImage(img, 0, 0);
|
|
10638
|
+
}
|
|
10639
|
+
},
|
|
10640
|
+
handleHeaderCellDragDragendEvent(evnt) {
|
|
10641
|
+
const $xeTable = this;
|
|
10642
|
+
const props = $xeTable;
|
|
10643
|
+
const reactData = $xeTable;
|
|
10644
|
+
const internalData = $xeTable;
|
|
10645
|
+
const {
|
|
10646
|
+
mouseConfig
|
|
10647
|
+
} = props;
|
|
10648
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
10649
|
+
const {
|
|
10650
|
+
dragEndMethod
|
|
10651
|
+
} = columnDragOpts;
|
|
10652
|
+
const {
|
|
10653
|
+
dragCol
|
|
10654
|
+
} = reactData;
|
|
10655
|
+
const {
|
|
10656
|
+
collectColumn,
|
|
10657
|
+
prevDragCol,
|
|
10658
|
+
prevDragPos
|
|
10659
|
+
} = internalData;
|
|
10660
|
+
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
10661
|
+
if (prevDragCol && dragCol) {
|
|
10662
|
+
// 判断是否有拖动
|
|
10663
|
+
if (prevDragCol !== dragCol) {
|
|
10664
|
+
Promise.resolve(dragEndMethod ? dragEndMethod({
|
|
10665
|
+
oldColumn: dragCol,
|
|
10666
|
+
newColumn: prevDragCol,
|
|
10667
|
+
dragPos: prevDragPos,
|
|
10668
|
+
offsetIndex: dragOffsetIndex
|
|
10669
|
+
}) : true).then(status => {
|
|
10670
|
+
if (!status) {
|
|
10671
|
+
return;
|
|
10672
|
+
}
|
|
10673
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parent) => {
|
|
10674
|
+
if (!parent) {
|
|
10675
|
+
const sortIndex = index + 1;
|
|
10676
|
+
column.renderSortNumber = sortIndex;
|
|
10677
|
+
}
|
|
10678
|
+
});
|
|
10679
|
+
const oafIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(collectColumn, item => item.id === dragCol.id);
|
|
10680
|
+
const nafIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(collectColumn, item => item.id === prevDragCol.id) + dragOffsetIndex;
|
|
10681
|
+
const newTargetCol = collectColumn[nafIndex];
|
|
10682
|
+
if (newTargetCol) {
|
|
10683
|
+
// 插入最后位置
|
|
10684
|
+
dragCol.renderSortNumber = newTargetCol.renderSortNumber;
|
|
10685
|
+
newTargetCol.renderSortNumber = dragCol.renderSortNumber + 0.5;
|
|
10686
|
+
} else {
|
|
10687
|
+
// 插入新位置
|
|
10688
|
+
dragCol.renderSortNumber = collectColumn.length + 1.5;
|
|
10689
|
+
}
|
|
10690
|
+
reactData.isDragColMove = true;
|
|
10691
|
+
if (mouseConfig) {
|
|
10692
|
+
if ($xeTable.clearSelected) {
|
|
10693
|
+
$xeTable.clearSelected();
|
|
10694
|
+
}
|
|
10695
|
+
if ($xeTable.clearCellAreas) {
|
|
10696
|
+
$xeTable.clearCellAreas();
|
|
10697
|
+
$xeTable.clearCopyCellArea();
|
|
10698
|
+
}
|
|
10699
|
+
}
|
|
10700
|
+
$xeTable.analyColumnWidth();
|
|
10701
|
+
$xeTable.$nextTick().then(() => {
|
|
10702
|
+
$xeTable.updateCellAreas();
|
|
10703
|
+
$xeTable.refreshColumn(true);
|
|
10704
|
+
});
|
|
10705
|
+
$xeTable.dispatchEvent('column-dragend', {
|
|
10706
|
+
oldColumn: dragCol,
|
|
10707
|
+
newColumn: prevDragCol,
|
|
10708
|
+
dragPos: prevDragPos,
|
|
10709
|
+
offsetIndex: dragOffsetIndex,
|
|
10710
|
+
_index: {
|
|
10711
|
+
newIndex: nafIndex,
|
|
10712
|
+
oldIndex: oafIndex
|
|
10713
|
+
}
|
|
10714
|
+
}, evnt);
|
|
10715
|
+
}).catch(() => {});
|
|
10716
|
+
}
|
|
10717
|
+
}
|
|
10718
|
+
hideDropTip($xeTable);
|
|
10719
|
+
clearColDropOrigin($xeTable);
|
|
10720
|
+
reactData.dragRow = null;
|
|
10721
|
+
reactData.dragCol = null;
|
|
10722
|
+
setTimeout(() => {
|
|
10723
|
+
reactData.isDragColMove = false;
|
|
10724
|
+
}, 500);
|
|
10725
|
+
},
|
|
10726
|
+
handleHeaderCellDragDragoverEvent(evnt) {
|
|
10727
|
+
const $xeTable = this;
|
|
10728
|
+
const reactData = $xeTable;
|
|
10729
|
+
const internalData = $xeTable;
|
|
10730
|
+
const {
|
|
10731
|
+
dragCol
|
|
10732
|
+
} = reactData;
|
|
10733
|
+
if (!dragCol) {
|
|
10734
|
+
evnt.preventDefault();
|
|
10735
|
+
return;
|
|
10736
|
+
}
|
|
10737
|
+
const thEl = evnt.currentTarget;
|
|
10738
|
+
const colid = thEl.getAttribute('colid');
|
|
10739
|
+
const column = $xeTable.getColumnById(colid);
|
|
10740
|
+
if (column) {
|
|
10741
|
+
evnt.preventDefault();
|
|
10742
|
+
const {
|
|
10743
|
+
dragCol
|
|
10744
|
+
} = reactData;
|
|
10745
|
+
const offsetX = evnt.clientX - thEl.getBoundingClientRect().x;
|
|
10746
|
+
const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
|
|
10747
|
+
internalData.prevDragCol = column;
|
|
10748
|
+
internalData.prevDragPos = dragPos;
|
|
10749
|
+
showDropTip($xeTable, evnt, null, thEl, dragPos);
|
|
10750
|
+
$xeTable.dispatchEvent('column-dragover', {
|
|
10751
|
+
oldColumn: dragCol,
|
|
10752
|
+
targetColumn: column,
|
|
10753
|
+
dragPos
|
|
10754
|
+
}, evnt);
|
|
10755
|
+
}
|
|
10756
|
+
},
|
|
10757
|
+
handleHeaderCellDragMousedownEvent(evnt, params) {
|
|
10758
|
+
const $xeTable = this;
|
|
10759
|
+
const reactData = $xeTable;
|
|
10760
|
+
evnt.stopPropagation();
|
|
10761
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
10762
|
+
const {
|
|
10763
|
+
dragStartMethod
|
|
10764
|
+
} = columnDragOpts;
|
|
10765
|
+
const {
|
|
10766
|
+
column
|
|
10767
|
+
} = params;
|
|
10768
|
+
const dragEl = evnt.currentTarget;
|
|
10769
|
+
const thEl = dragEl.parentElement?.parentElement;
|
|
10770
|
+
reactData.isDragColMove = false;
|
|
10771
|
+
clearColDropOrigin($xeTable);
|
|
10772
|
+
if (dragStartMethod && !dragStartMethod(params)) {
|
|
10773
|
+
thEl.draggable = false;
|
|
10774
|
+
reactData.dragRow = null;
|
|
10775
|
+
reactData.dragCol = null;
|
|
10776
|
+
hideDropTip($xeTable);
|
|
10777
|
+
return;
|
|
10778
|
+
}
|
|
10779
|
+
reactData.dragCol = column;
|
|
10780
|
+
reactData.dragRow = null;
|
|
10781
|
+
thEl.draggable = true;
|
|
10782
|
+
updateColDropOrigin($xeTable, column);
|
|
10783
|
+
updateColDropTipContent($xeTable, thEl);
|
|
10784
|
+
$xeTable.dispatchEvent('column-dragstart', params, evnt);
|
|
10785
|
+
},
|
|
10786
|
+
handleHeaderCellDragMouseupEvent() {
|
|
10787
|
+
const $xeTable = this;
|
|
10788
|
+
const reactData = $xeTable;
|
|
10789
|
+
clearColDropOrigin($xeTable);
|
|
10790
|
+
hideDropTip($xeTable);
|
|
10791
|
+
reactData.dragRow = null;
|
|
10792
|
+
reactData.dragCol = null;
|
|
10793
|
+
reactData.isDragColMove = false;
|
|
10794
|
+
},
|
|
10492
10795
|
setPendingRow(rows, status) {
|
|
10493
10796
|
const pendingMaps = {
|
|
10494
10797
|
...this.pendingRowMaps
|
|
@@ -12319,8 +12622,8 @@ const Methods = {
|
|
|
12319
12622
|
}
|
|
12320
12623
|
},
|
|
12321
12624
|
updateCellAreas() {
|
|
12322
|
-
if (this.mouseConfig && this.mouseOpts.area && this.
|
|
12323
|
-
return this.
|
|
12625
|
+
if (this.mouseConfig && this.mouseOpts.area && this.handleRecalculateCellAreas) {
|
|
12626
|
+
return this.handleRecalculateCellAreas();
|
|
12324
12627
|
}
|
|
12325
12628
|
return this.$nextTick();
|
|
12326
12629
|
},
|
|
@@ -12390,7 +12693,7 @@ const Methods = {
|
|
|
12390
12693
|
}
|
|
12391
12694
|
};
|
|
12392
12695
|
// Module methods
|
|
12393
|
-
const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
12696
|
+
const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
12394
12697
|
funcs.forEach(name => {
|
|
12395
12698
|
Methods[name] = function (...args) {
|
|
12396
12699
|
if (true) {
|
|
@@ -12778,7 +13081,9 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
12778
13081
|
fullAllDataRowIdData,
|
|
12779
13082
|
rowOpts,
|
|
12780
13083
|
pendingRowList,
|
|
12781
|
-
pendingRowMaps
|
|
13084
|
+
pendingRowMaps,
|
|
13085
|
+
columnOpts,
|
|
13086
|
+
isDragColMove
|
|
12782
13087
|
} = $xeTable;
|
|
12783
13088
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12784
13089
|
const rows = [];
|
|
@@ -12847,26 +13152,40 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
12847
13152
|
rowChildren = row[childrenField];
|
|
12848
13153
|
isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid];
|
|
12849
13154
|
}
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12853
|
-
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
13155
|
+
const trClass = ['vxe-body--row', treeConfig ? `row--level-${rowLevel}` : '', {
|
|
13156
|
+
'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
|
|
13157
|
+
'is--new': isNewRow,
|
|
13158
|
+
'is--expand-row': isExpandRow,
|
|
13159
|
+
'is--expand-tree': isExpandTree,
|
|
13160
|
+
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
13161
|
+
'row--radio': radioOpts.highlight && $xeTable.selectRadioRow === row,
|
|
13162
|
+
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
13163
|
+
'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
|
|
13164
|
+
}, rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''];
|
|
13165
|
+
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
13166
|
+
return renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
13167
|
+
});
|
|
13168
|
+
rows.push(columnOpts.drag ? h('transition-group', {
|
|
13169
|
+
props: {
|
|
13170
|
+
tag: 'tr',
|
|
13171
|
+
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`
|
|
13172
|
+
},
|
|
13173
|
+
class: trClass,
|
|
13174
|
+
attrs: {
|
|
13175
|
+
rowid
|
|
13176
|
+
},
|
|
13177
|
+
style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
|
|
13178
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
13179
|
+
nativeOn: trOn
|
|
13180
|
+
}, tdVNs) : h('tr', {
|
|
13181
|
+
class: trClass,
|
|
12861
13182
|
attrs: {
|
|
12862
13183
|
rowid
|
|
12863
13184
|
},
|
|
12864
13185
|
style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
|
|
12865
13186
|
key: rowKey || rowOpts.useKey || rowOpts.drag || treeConfig ? rowid : $rowIndex,
|
|
12866
13187
|
on: trOn
|
|
12867
|
-
},
|
|
12868
|
-
return renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
12869
|
-
})));
|
|
13188
|
+
}, tdVNs));
|
|
12870
13189
|
// 如果行被展开了
|
|
12871
13190
|
if (isExpandRow) {
|
|
12872
13191
|
const {
|
|
@@ -13330,6 +13649,173 @@ const {
|
|
|
13330
13649
|
renderer: header_renderer
|
|
13331
13650
|
} = core_.VxeUI;
|
|
13332
13651
|
const cellType = 'header';
|
|
13652
|
+
const header_renderRows = (h, _vm, cols, $rowIndex) => {
|
|
13653
|
+
const {
|
|
13654
|
+
$parent: $xetable,
|
|
13655
|
+
fixedType
|
|
13656
|
+
} = _vm;
|
|
13657
|
+
const {
|
|
13658
|
+
$listeners: tableListeners,
|
|
13659
|
+
resizable: allResizable,
|
|
13660
|
+
border,
|
|
13661
|
+
columnKey,
|
|
13662
|
+
headerCellClassName,
|
|
13663
|
+
headerCellStyle,
|
|
13664
|
+
showHeaderOverflow: allColumnHeaderOverflow,
|
|
13665
|
+
headerAlign: allHeaderAlign,
|
|
13666
|
+
align: allAlign,
|
|
13667
|
+
highlightCurrentColumn,
|
|
13668
|
+
currentColumn,
|
|
13669
|
+
scrollXLoad,
|
|
13670
|
+
overflowX,
|
|
13671
|
+
scrollbarWidth,
|
|
13672
|
+
sortOpts,
|
|
13673
|
+
mouseConfig,
|
|
13674
|
+
columnOpts
|
|
13675
|
+
} = $xetable;
|
|
13676
|
+
return cols.map((column, $columnIndex) => {
|
|
13677
|
+
const {
|
|
13678
|
+
type,
|
|
13679
|
+
showHeaderOverflow,
|
|
13680
|
+
headerAlign,
|
|
13681
|
+
align,
|
|
13682
|
+
headerClassName,
|
|
13683
|
+
editRender,
|
|
13684
|
+
cellRender
|
|
13685
|
+
} = column;
|
|
13686
|
+
// const { enabled } = tooltipOpts
|
|
13687
|
+
const colid = column.id;
|
|
13688
|
+
const renderOpts = editRender || cellRender;
|
|
13689
|
+
const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
|
|
13690
|
+
const isColGroup = column.children && column.children.length;
|
|
13691
|
+
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
13692
|
+
const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
13693
|
+
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
13694
|
+
let showEllipsis = headOverflow === 'ellipsis';
|
|
13695
|
+
const showTitle = headOverflow === 'title';
|
|
13696
|
+
const showTooltip = headOverflow === true || headOverflow === 'tooltip';
|
|
13697
|
+
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
13698
|
+
const thOns = {};
|
|
13699
|
+
const hasFilter = column.filters && column.filters.some(item => item.checked);
|
|
13700
|
+
const columnIndex = $xetable.getColumnIndex(column);
|
|
13701
|
+
const _columnIndex = $xetable.getVTColumnIndex(column);
|
|
13702
|
+
const params = {
|
|
13703
|
+
$table: $xetable,
|
|
13704
|
+
$grid: $xetable.xegrid,
|
|
13705
|
+
$rowIndex,
|
|
13706
|
+
column,
|
|
13707
|
+
columnIndex,
|
|
13708
|
+
$columnIndex,
|
|
13709
|
+
_columnIndex,
|
|
13710
|
+
fixed: fixedType,
|
|
13711
|
+
type: cellType,
|
|
13712
|
+
isHidden: fixedHiddenColumn,
|
|
13713
|
+
hasFilter
|
|
13714
|
+
};
|
|
13715
|
+
// 虚拟滚动不支持动态高度
|
|
13716
|
+
if (scrollXLoad && !hasEllipsis) {
|
|
13717
|
+
showEllipsis = hasEllipsis = true;
|
|
13718
|
+
}
|
|
13719
|
+
if (columnOpts.isCurrent || highlightCurrentColumn || tableListeners['header-cell-click'] || sortOpts.trigger === 'cell') {
|
|
13720
|
+
thOns.click = evnt => $xetable.triggerHeaderCellClickEvent(evnt, params);
|
|
13721
|
+
}
|
|
13722
|
+
if (tableListeners['header-cell-dblclick']) {
|
|
13723
|
+
thOns.dblclick = evnt => $xetable.triggerHeaderCellDblclickEvent(evnt, params);
|
|
13724
|
+
}
|
|
13725
|
+
// 按下事件处理
|
|
13726
|
+
if (mouseConfig) {
|
|
13727
|
+
thOns.mousedown = evnt => $xetable.triggerHeaderCellMousedownEvent(evnt, params);
|
|
13728
|
+
}
|
|
13729
|
+
// 拖拽行事件
|
|
13730
|
+
if (columnOpts.drag && !column.parentId) {
|
|
13731
|
+
thOns.dragstart = $xetable.handleHeaderCellDragDragstartEvent;
|
|
13732
|
+
thOns.dragend = $xetable.handleHeaderCellDragDragendEvent;
|
|
13733
|
+
thOns.dragover = $xetable.handleHeaderCellDragDragoverEvent;
|
|
13734
|
+
}
|
|
13735
|
+
return h('th', {
|
|
13736
|
+
class: ['vxe-header--column', colid, {
|
|
13737
|
+
[`col--${headAlign}`]: headAlign,
|
|
13738
|
+
[`col--${type}`]: type,
|
|
13739
|
+
'col--last': $columnIndex === cols.length - 1,
|
|
13740
|
+
'col--fixed': column.fixed,
|
|
13741
|
+
'col--group': isColGroup,
|
|
13742
|
+
'col--ellipsis': hasEllipsis,
|
|
13743
|
+
'fixed--hidden': fixedHiddenColumn,
|
|
13744
|
+
'is--sortable': column.sortable,
|
|
13745
|
+
'col--filter': !!column.filters,
|
|
13746
|
+
'is--filter-active': hasFilter,
|
|
13747
|
+
'col--current': currentColumn === column
|
|
13748
|
+
}, getClass(headerClassName, params), getClass(headerCellClassName, params)],
|
|
13749
|
+
attrs: {
|
|
13750
|
+
colid,
|
|
13751
|
+
colspan: column.colSpan > 1 ? column.colSpan : null,
|
|
13752
|
+
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
13753
|
+
},
|
|
13754
|
+
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
|
|
13755
|
+
on: thOns,
|
|
13756
|
+
key: columnKey || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
13757
|
+
}, [h('div', {
|
|
13758
|
+
class: ['vxe-cell', {
|
|
13759
|
+
'c--title': showTitle,
|
|
13760
|
+
'c--tooltip': showTooltip,
|
|
13761
|
+
'c--ellipsis': showEllipsis
|
|
13762
|
+
}]
|
|
13763
|
+
}, column.renderHeader(h, params)),
|
|
13764
|
+
/**
|
|
13765
|
+
* 列宽拖动
|
|
13766
|
+
*/
|
|
13767
|
+
!fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h('div', {
|
|
13768
|
+
class: ['vxe-resizable', {
|
|
13769
|
+
'is--line': !border || border === 'none'
|
|
13770
|
+
}],
|
|
13771
|
+
on: {
|
|
13772
|
+
mousedown: evnt => _vm.resizeMousedown(evnt, params)
|
|
13773
|
+
}
|
|
13774
|
+
}) : null]);
|
|
13775
|
+
}).concat(scrollbarWidth ? [h('th', {
|
|
13776
|
+
key: `gr${$rowIndex}`,
|
|
13777
|
+
class: 'vxe-header--gutter col--gutter'
|
|
13778
|
+
})] : []);
|
|
13779
|
+
};
|
|
13780
|
+
function renderHeads(h, _vm, headerGroups) {
|
|
13781
|
+
const {
|
|
13782
|
+
$parent: $xetable
|
|
13783
|
+
} = _vm;
|
|
13784
|
+
const tableProps = $xetable;
|
|
13785
|
+
const {
|
|
13786
|
+
fixedType
|
|
13787
|
+
} = _vm;
|
|
13788
|
+
const {
|
|
13789
|
+
headerRowClassName,
|
|
13790
|
+
headerRowStyle
|
|
13791
|
+
} = tableProps;
|
|
13792
|
+
const {
|
|
13793
|
+
isDragColMove
|
|
13794
|
+
} = $xetable;
|
|
13795
|
+
const columnOpts = $xetable.columnOpts;
|
|
13796
|
+
return headerGroups.map((cols, $rowIndex) => {
|
|
13797
|
+
const params = {
|
|
13798
|
+
$table: $xetable,
|
|
13799
|
+
$rowIndex,
|
|
13800
|
+
fixed: fixedType,
|
|
13801
|
+
type: cellType
|
|
13802
|
+
};
|
|
13803
|
+
if (columnOpts.drag) {
|
|
13804
|
+
return h('transition-group', {
|
|
13805
|
+
props: {
|
|
13806
|
+
tag: 'tr',
|
|
13807
|
+
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
13808
|
+
class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''],
|
|
13809
|
+
style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : null
|
|
13810
|
+
}
|
|
13811
|
+
}, header_renderRows(h, _vm, cols, $rowIndex));
|
|
13812
|
+
}
|
|
13813
|
+
return h('tr', {
|
|
13814
|
+
class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''],
|
|
13815
|
+
style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : null
|
|
13816
|
+
}, header_renderRows(h, _vm, cols, $rowIndex));
|
|
13817
|
+
});
|
|
13818
|
+
}
|
|
13333
13819
|
/* harmony default export */ var header = ({
|
|
13334
13820
|
name: 'VxeTableHeader',
|
|
13335
13821
|
props: {
|
|
@@ -13397,28 +13883,12 @@ const cellType = 'header';
|
|
|
13397
13883
|
fixedColumn
|
|
13398
13884
|
} = this;
|
|
13399
13885
|
const {
|
|
13400
|
-
$listeners: tableListeners,
|
|
13401
13886
|
tId,
|
|
13402
13887
|
isGroup,
|
|
13403
13888
|
visibleColumn,
|
|
13404
|
-
resizable: allResizable,
|
|
13405
|
-
border,
|
|
13406
|
-
columnKey,
|
|
13407
|
-
headerRowClassName,
|
|
13408
|
-
headerCellClassName,
|
|
13409
|
-
headerRowStyle,
|
|
13410
|
-
headerCellStyle,
|
|
13411
13889
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
13412
|
-
headerAlign: allHeaderAlign,
|
|
13413
|
-
align: allAlign,
|
|
13414
|
-
highlightCurrentColumn,
|
|
13415
|
-
currentColumn,
|
|
13416
13890
|
scrollXLoad,
|
|
13417
|
-
|
|
13418
|
-
scrollbarWidth,
|
|
13419
|
-
sortOpts,
|
|
13420
|
-
mouseConfig,
|
|
13421
|
-
columnOpts
|
|
13891
|
+
scrollbarWidth
|
|
13422
13892
|
} = $xetable;
|
|
13423
13893
|
let headerGroups = headerColumn;
|
|
13424
13894
|
let renderColumnList = tableColumn;
|
|
@@ -13473,117 +13943,7 @@ const cellType = 'header';
|
|
|
13473
13943
|
*/
|
|
13474
13944
|
h('thead', {
|
|
13475
13945
|
ref: 'thead'
|
|
13476
|
-
},
|
|
13477
|
-
return h('tr', {
|
|
13478
|
-
class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName({
|
|
13479
|
-
$table: $xetable,
|
|
13480
|
-
$rowIndex,
|
|
13481
|
-
fixed: fixedType,
|
|
13482
|
-
type: cellType
|
|
13483
|
-
}) : headerRowClassName : ''],
|
|
13484
|
-
style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle({
|
|
13485
|
-
$table: $xetable,
|
|
13486
|
-
$rowIndex,
|
|
13487
|
-
fixed: fixedType,
|
|
13488
|
-
type: cellType
|
|
13489
|
-
}) : headerRowStyle : null
|
|
13490
|
-
}, cols.map((column, $columnIndex) => {
|
|
13491
|
-
const {
|
|
13492
|
-
type,
|
|
13493
|
-
showHeaderOverflow,
|
|
13494
|
-
headerAlign,
|
|
13495
|
-
align,
|
|
13496
|
-
headerClassName,
|
|
13497
|
-
editRender,
|
|
13498
|
-
cellRender
|
|
13499
|
-
} = column;
|
|
13500
|
-
// const { enabled } = tooltipOpts
|
|
13501
|
-
const colid = column.id;
|
|
13502
|
-
const renderOpts = editRender || cellRender;
|
|
13503
|
-
const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
|
|
13504
|
-
const isColGroup = column.children && column.children.length;
|
|
13505
|
-
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
13506
|
-
const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
13507
|
-
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
13508
|
-
let showEllipsis = headOverflow === 'ellipsis';
|
|
13509
|
-
const showTitle = headOverflow === 'title';
|
|
13510
|
-
const showTooltip = headOverflow === true || headOverflow === 'tooltip';
|
|
13511
|
-
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
13512
|
-
const thOns = {};
|
|
13513
|
-
const hasFilter = column.filters && column.filters.some(item => item.checked);
|
|
13514
|
-
const columnIndex = $xetable.getColumnIndex(column);
|
|
13515
|
-
const _columnIndex = $xetable.getVTColumnIndex(column);
|
|
13516
|
-
const params = {
|
|
13517
|
-
$table: $xetable,
|
|
13518
|
-
$grid: $xetable.xegrid,
|
|
13519
|
-
$rowIndex,
|
|
13520
|
-
column,
|
|
13521
|
-
columnIndex,
|
|
13522
|
-
$columnIndex,
|
|
13523
|
-
_columnIndex,
|
|
13524
|
-
fixed: fixedType,
|
|
13525
|
-
type: cellType,
|
|
13526
|
-
isHidden: fixedHiddenColumn,
|
|
13527
|
-
hasFilter
|
|
13528
|
-
};
|
|
13529
|
-
// 虚拟滚动不支持动态高度
|
|
13530
|
-
if (scrollXLoad && !hasEllipsis) {
|
|
13531
|
-
showEllipsis = hasEllipsis = true;
|
|
13532
|
-
}
|
|
13533
|
-
if (columnOpts.isCurrent || highlightCurrentColumn || tableListeners['header-cell-click'] || sortOpts.trigger === 'cell') {
|
|
13534
|
-
thOns.click = evnt => $xetable.triggerHeaderCellClickEvent(evnt, params);
|
|
13535
|
-
}
|
|
13536
|
-
if (tableListeners['header-cell-dblclick']) {
|
|
13537
|
-
thOns.dblclick = evnt => $xetable.triggerHeaderCellDblclickEvent(evnt, params);
|
|
13538
|
-
}
|
|
13539
|
-
// 按下事件处理
|
|
13540
|
-
if (mouseConfig) {
|
|
13541
|
-
thOns.mousedown = evnt => $xetable.triggerHeaderCellMousedownEvent(evnt, params);
|
|
13542
|
-
}
|
|
13543
|
-
return h('th', {
|
|
13544
|
-
class: ['vxe-header--column', colid, {
|
|
13545
|
-
[`col--${headAlign}`]: headAlign,
|
|
13546
|
-
[`col--${type}`]: type,
|
|
13547
|
-
'col--last': $columnIndex === cols.length - 1,
|
|
13548
|
-
'col--fixed': column.fixed,
|
|
13549
|
-
'col--group': isColGroup,
|
|
13550
|
-
'col--ellipsis': hasEllipsis,
|
|
13551
|
-
'fixed--hidden': fixedHiddenColumn,
|
|
13552
|
-
'is--sortable': column.sortable,
|
|
13553
|
-
'col--filter': !!column.filters,
|
|
13554
|
-
'is--filter-active': hasFilter,
|
|
13555
|
-
'col--current': currentColumn === column
|
|
13556
|
-
}, getClass(headerClassName, params), getClass(headerCellClassName, params)],
|
|
13557
|
-
attrs: {
|
|
13558
|
-
colid,
|
|
13559
|
-
colspan: column.colSpan > 1 ? column.colSpan : null,
|
|
13560
|
-
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
13561
|
-
},
|
|
13562
|
-
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
|
|
13563
|
-
on: thOns,
|
|
13564
|
-
key: columnKey || columnOpts.useKey || isColGroup ? colid : $columnIndex
|
|
13565
|
-
}, [h('div', {
|
|
13566
|
-
class: ['vxe-cell', {
|
|
13567
|
-
'c--title': showTitle,
|
|
13568
|
-
'c--tooltip': showTooltip,
|
|
13569
|
-
'c--ellipsis': showEllipsis
|
|
13570
|
-
}]
|
|
13571
|
-
}, column.renderHeader(h, params)),
|
|
13572
|
-
/**
|
|
13573
|
-
* 列宽拖动
|
|
13574
|
-
*/
|
|
13575
|
-
!fixedHiddenColumn && !isColGroup && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h('div', {
|
|
13576
|
-
class: ['vxe-resizable', {
|
|
13577
|
-
'is--line': !border || border === 'none'
|
|
13578
|
-
}],
|
|
13579
|
-
on: {
|
|
13580
|
-
mousedown: evnt => this.resizeMousedown(evnt, params)
|
|
13581
|
-
}
|
|
13582
|
-
}) : null]);
|
|
13583
|
-
}).concat(scrollbarWidth ? [h('th', {
|
|
13584
|
-
class: 'vxe-header--gutter col--gutter'
|
|
13585
|
-
})] : []));
|
|
13586
|
-
}))]),
|
|
13946
|
+
}, renderHeads(h, this, headerGroups))]),
|
|
13587
13947
|
/**
|
|
13588
13948
|
* 其他
|
|
13589
13949
|
*/
|
|
@@ -13731,6 +14091,203 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
13731
14091
|
}
|
|
13732
14092
|
}
|
|
13733
14093
|
}
|
|
14094
|
+
function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex) {
|
|
14095
|
+
const {
|
|
14096
|
+
$parent: $xetable,
|
|
14097
|
+
fixedType
|
|
14098
|
+
} = _vm;
|
|
14099
|
+
const {
|
|
14100
|
+
$listeners: tableListeners,
|
|
14101
|
+
footerCellClassName,
|
|
14102
|
+
footerCellStyle,
|
|
14103
|
+
footerAlign: allFooterAlign,
|
|
14104
|
+
mergeFooterList,
|
|
14105
|
+
footerSpanMethod,
|
|
14106
|
+
align: allAlign,
|
|
14107
|
+
scrollXLoad,
|
|
14108
|
+
columnKey,
|
|
14109
|
+
columnOpts,
|
|
14110
|
+
showFooterOverflow: allColumnFooterOverflow,
|
|
14111
|
+
currentColumn,
|
|
14112
|
+
overflowX,
|
|
14113
|
+
scrollbarWidth,
|
|
14114
|
+
tooltipOpts
|
|
14115
|
+
} = $xetable;
|
|
14116
|
+
return tableColumn.map((column, $columnIndex) => {
|
|
14117
|
+
const {
|
|
14118
|
+
type,
|
|
14119
|
+
showFooterOverflow,
|
|
14120
|
+
footerAlign,
|
|
14121
|
+
align,
|
|
14122
|
+
footerClassName,
|
|
14123
|
+
editRender,
|
|
14124
|
+
cellRender
|
|
14125
|
+
} = column;
|
|
14126
|
+
const renderOpts = editRender || cellRender;
|
|
14127
|
+
const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
|
|
14128
|
+
const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
|
|
14129
|
+
const isColGroup = column.children && column.children.length;
|
|
14130
|
+
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
14131
|
+
const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
14132
|
+
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
14133
|
+
let showEllipsis = footOverflow === 'ellipsis';
|
|
14134
|
+
const showTitle = footOverflow === 'title';
|
|
14135
|
+
const showTooltip = footOverflow === true || footOverflow === 'tooltip';
|
|
14136
|
+
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
14137
|
+
const attrs = {
|
|
14138
|
+
colid: column.id
|
|
14139
|
+
};
|
|
14140
|
+
const tfOns = {};
|
|
14141
|
+
const columnIndex = $xetable.getColumnIndex(column);
|
|
14142
|
+
const _columnIndex = $xetable.getVTColumnIndex(column);
|
|
14143
|
+
const itemIndex = _columnIndex;
|
|
14144
|
+
const cellParams = {
|
|
14145
|
+
$table: $xetable,
|
|
14146
|
+
$grid: $xetable.xegrid,
|
|
14147
|
+
row,
|
|
14148
|
+
_rowIndex,
|
|
14149
|
+
$rowIndex,
|
|
14150
|
+
column,
|
|
14151
|
+
columnIndex,
|
|
14152
|
+
$columnIndex,
|
|
14153
|
+
_columnIndex,
|
|
14154
|
+
itemIndex,
|
|
14155
|
+
items: row,
|
|
14156
|
+
fixed: fixedType,
|
|
14157
|
+
type: footer_renderType,
|
|
14158
|
+
data: footerTableData
|
|
14159
|
+
};
|
|
14160
|
+
// 虚拟滚动不支持动态高度
|
|
14161
|
+
if (scrollXLoad && !hasEllipsis) {
|
|
14162
|
+
showEllipsis = hasEllipsis = true;
|
|
14163
|
+
}
|
|
14164
|
+
if (showTitle || showTooltip || showAllTip) {
|
|
14165
|
+
tfOns.mouseenter = evnt => {
|
|
14166
|
+
if (showTitle) {
|
|
14167
|
+
updateCellTitle(evnt.currentTarget, column);
|
|
14168
|
+
} else if (showTooltip || showAllTip) {
|
|
14169
|
+
$xetable.triggerFooterTooltipEvent(evnt, cellParams);
|
|
14170
|
+
}
|
|
14171
|
+
};
|
|
14172
|
+
}
|
|
14173
|
+
if (showTooltip || showAllTip) {
|
|
14174
|
+
tfOns.mouseleave = evnt => {
|
|
14175
|
+
if (showTooltip || showAllTip) {
|
|
14176
|
+
$xetable.handleTargetLeaveEvent(evnt);
|
|
14177
|
+
}
|
|
14178
|
+
};
|
|
14179
|
+
}
|
|
14180
|
+
if (tableListeners['footer-cell-click']) {
|
|
14181
|
+
tfOns.click = evnt => {
|
|
14182
|
+
$xetable.emitEvent('footer-cell-click', Object.assign({
|
|
14183
|
+
cell: evnt.currentTarget
|
|
14184
|
+
}, cellParams), evnt);
|
|
14185
|
+
};
|
|
14186
|
+
}
|
|
14187
|
+
if (tableListeners['footer-cell-dblclick']) {
|
|
14188
|
+
tfOns.dblclick = evnt => {
|
|
14189
|
+
$xetable.emitEvent('footer-cell-dblclick', Object.assign({
|
|
14190
|
+
cell: evnt.currentTarget
|
|
14191
|
+
}, cellParams), evnt);
|
|
14192
|
+
};
|
|
14193
|
+
}
|
|
14194
|
+
// 合并行或列
|
|
14195
|
+
if (mergeFooterList.length) {
|
|
14196
|
+
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
14197
|
+
if (spanRest) {
|
|
14198
|
+
const {
|
|
14199
|
+
rowspan,
|
|
14200
|
+
colspan
|
|
14201
|
+
} = spanRest;
|
|
14202
|
+
if (!rowspan || !colspan) {
|
|
14203
|
+
return null;
|
|
14204
|
+
}
|
|
14205
|
+
if (rowspan > 1) {
|
|
14206
|
+
attrs.rowspan = rowspan;
|
|
14207
|
+
}
|
|
14208
|
+
if (colspan > 1) {
|
|
14209
|
+
attrs.colspan = colspan;
|
|
14210
|
+
}
|
|
14211
|
+
}
|
|
14212
|
+
} else if (footerSpanMethod) {
|
|
14213
|
+
// 自定义合并方法
|
|
14214
|
+
const {
|
|
14215
|
+
rowspan = 1,
|
|
14216
|
+
colspan = 1
|
|
14217
|
+
} = footerSpanMethod(cellParams) || {};
|
|
14218
|
+
if (!rowspan || !colspan) {
|
|
14219
|
+
return null;
|
|
14220
|
+
}
|
|
14221
|
+
if (rowspan > 1) {
|
|
14222
|
+
attrs.rowspan = rowspan;
|
|
14223
|
+
}
|
|
14224
|
+
if (colspan > 1) {
|
|
14225
|
+
attrs.colspan = colspan;
|
|
14226
|
+
}
|
|
14227
|
+
}
|
|
14228
|
+
return h('td', {
|
|
14229
|
+
class: ['vxe-footer--column', column.id, {
|
|
14230
|
+
[`col--${footAlign}`]: footAlign,
|
|
14231
|
+
[`col--${type}`]: type,
|
|
14232
|
+
'col--last': $columnIndex === tableColumn.length - 1,
|
|
14233
|
+
'fixed--hidden': fixedHiddenColumn,
|
|
14234
|
+
'col--ellipsis': hasEllipsis,
|
|
14235
|
+
'col--current': currentColumn === column
|
|
14236
|
+
}, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
|
|
14237
|
+
attrs,
|
|
14238
|
+
style: footerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle : null,
|
|
14239
|
+
on: tfOns,
|
|
14240
|
+
key: columnKey || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex
|
|
14241
|
+
}, [h('div', {
|
|
14242
|
+
class: ['vxe-cell', {
|
|
14243
|
+
'c--title': showTitle,
|
|
14244
|
+
'c--tooltip': showTooltip,
|
|
14245
|
+
'c--ellipsis': showEllipsis
|
|
14246
|
+
}]
|
|
14247
|
+
}, column.renderFooter(h, cellParams))]);
|
|
14248
|
+
}).concat(scrollbarWidth ? [h('td', {
|
|
14249
|
+
key: `gr${$rowIndex}`,
|
|
14250
|
+
class: 'vxe-footer--gutter col--gutter'
|
|
14251
|
+
})] : []);
|
|
14252
|
+
}
|
|
14253
|
+
function footer_renderHeads(h, _vm, footerTableData) {
|
|
14254
|
+
const {
|
|
14255
|
+
$parent: $xetable,
|
|
14256
|
+
fixedType,
|
|
14257
|
+
tableColumn
|
|
14258
|
+
} = _vm;
|
|
14259
|
+
const {
|
|
14260
|
+
footerRowClassName,
|
|
14261
|
+
footerRowStyle,
|
|
14262
|
+
isDragColMove
|
|
14263
|
+
} = $xetable;
|
|
14264
|
+
const columnOpts = $xetable.columnOpts;
|
|
14265
|
+
return footerTableData.map((row, $rowIndex) => {
|
|
14266
|
+
const _rowIndex = $rowIndex;
|
|
14267
|
+
const rowParams = {
|
|
14268
|
+
$table: $xetable,
|
|
14269
|
+
row,
|
|
14270
|
+
_rowIndex,
|
|
14271
|
+
$rowIndex,
|
|
14272
|
+
fixed: fixedType,
|
|
14273
|
+
type: footer_renderType
|
|
14274
|
+
};
|
|
14275
|
+
if (columnOpts.drag) {
|
|
14276
|
+
return h('transition-group', {
|
|
14277
|
+
props: {
|
|
14278
|
+
tag: 'tr',
|
|
14279
|
+
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
14280
|
+
class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
|
|
14281
|
+
style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
|
|
14282
|
+
}
|
|
14283
|
+
}, footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
|
|
14284
|
+
}
|
|
14285
|
+
return h('tr', {
|
|
14286
|
+
class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
|
|
14287
|
+
style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
|
|
14288
|
+
}, footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
|
|
14289
|
+
});
|
|
14290
|
+
}
|
|
13734
14291
|
/* harmony default export */ var footer = ({
|
|
13735
14292
|
name: 'VxeTableFooter',
|
|
13736
14293
|
props: {
|
|
@@ -13782,24 +14339,12 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
13782
14339
|
footerTableData
|
|
13783
14340
|
} = this;
|
|
13784
14341
|
const {
|
|
13785
|
-
$listeners: tableListeners,
|
|
13786
14342
|
tId,
|
|
13787
|
-
footerRowClassName,
|
|
13788
|
-
footerCellClassName,
|
|
13789
|
-
footerRowStyle,
|
|
13790
|
-
footerCellStyle,
|
|
13791
|
-
footerAlign: allFooterAlign,
|
|
13792
14343
|
mergeFooterList,
|
|
13793
14344
|
footerSpanMethod,
|
|
13794
|
-
align: allAlign,
|
|
13795
14345
|
scrollXLoad,
|
|
13796
|
-
columnKey,
|
|
13797
|
-
columnOpts,
|
|
13798
14346
|
showFooterOverflow: allColumnFooterOverflow,
|
|
13799
|
-
currentColumn,
|
|
13800
|
-
overflowX,
|
|
13801
14347
|
scrollbarWidth,
|
|
13802
|
-
tooltipOpts,
|
|
13803
14348
|
visibleColumn,
|
|
13804
14349
|
expandColumn
|
|
13805
14350
|
} = $xetable;
|
|
@@ -13859,155 +14404,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
13859
14404
|
*/
|
|
13860
14405
|
h('tfoot', {
|
|
13861
14406
|
ref: 'tfoot'
|
|
13862
|
-
},
|
|
13863
|
-
const $rowIndex = _rowIndex;
|
|
13864
|
-
const rowParams = {
|
|
13865
|
-
$table: $xetable,
|
|
13866
|
-
row: list,
|
|
13867
|
-
_rowIndex,
|
|
13868
|
-
$rowIndex,
|
|
13869
|
-
fixed: fixedType,
|
|
13870
|
-
type: footer_renderType
|
|
13871
|
-
};
|
|
13872
|
-
return h('tr', {
|
|
13873
|
-
class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
|
|
13874
|
-
style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
|
|
13875
|
-
}, tableColumn.map((column, $columnIndex) => {
|
|
13876
|
-
const {
|
|
13877
|
-
type,
|
|
13878
|
-
showFooterOverflow,
|
|
13879
|
-
footerAlign,
|
|
13880
|
-
align,
|
|
13881
|
-
footerClassName,
|
|
13882
|
-
editRender,
|
|
13883
|
-
cellRender
|
|
13884
|
-
} = column;
|
|
13885
|
-
const renderOpts = editRender || cellRender;
|
|
13886
|
-
const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
|
|
13887
|
-
const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
|
|
13888
|
-
const isColGroup = column.children && column.children.length;
|
|
13889
|
-
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
13890
|
-
const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
13891
|
-
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
13892
|
-
let showEllipsis = footOverflow === 'ellipsis';
|
|
13893
|
-
const showTitle = footOverflow === 'title';
|
|
13894
|
-
const showTooltip = footOverflow === true || footOverflow === 'tooltip';
|
|
13895
|
-
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
13896
|
-
const attrs = {
|
|
13897
|
-
colid: column.id
|
|
13898
|
-
};
|
|
13899
|
-
const tfOns = {};
|
|
13900
|
-
const columnIndex = $xetable.getColumnIndex(column);
|
|
13901
|
-
const _columnIndex = $xetable.getVTColumnIndex(column);
|
|
13902
|
-
const itemIndex = _columnIndex;
|
|
13903
|
-
const cellParams = {
|
|
13904
|
-
$table: $xetable,
|
|
13905
|
-
$grid: $xetable.xegrid,
|
|
13906
|
-
row: list,
|
|
13907
|
-
_rowIndex,
|
|
13908
|
-
$rowIndex,
|
|
13909
|
-
column,
|
|
13910
|
-
columnIndex,
|
|
13911
|
-
$columnIndex,
|
|
13912
|
-
_columnIndex,
|
|
13913
|
-
itemIndex,
|
|
13914
|
-
items: list,
|
|
13915
|
-
fixed: fixedType,
|
|
13916
|
-
type: footer_renderType,
|
|
13917
|
-
data: footerTableData
|
|
13918
|
-
};
|
|
13919
|
-
// 虚拟滚动不支持动态高度
|
|
13920
|
-
if (scrollXLoad && !hasEllipsis) {
|
|
13921
|
-
showEllipsis = hasEllipsis = true;
|
|
13922
|
-
}
|
|
13923
|
-
if (showTitle || showTooltip || showAllTip) {
|
|
13924
|
-
tfOns.mouseenter = evnt => {
|
|
13925
|
-
if (showTitle) {
|
|
13926
|
-
updateCellTitle(evnt.currentTarget, column);
|
|
13927
|
-
} else if (showTooltip || showAllTip) {
|
|
13928
|
-
$xetable.triggerFooterTooltipEvent(evnt, cellParams);
|
|
13929
|
-
}
|
|
13930
|
-
};
|
|
13931
|
-
}
|
|
13932
|
-
if (showTooltip || showAllTip) {
|
|
13933
|
-
tfOns.mouseleave = evnt => {
|
|
13934
|
-
if (showTooltip || showAllTip) {
|
|
13935
|
-
$xetable.handleTargetLeaveEvent(evnt);
|
|
13936
|
-
}
|
|
13937
|
-
};
|
|
13938
|
-
}
|
|
13939
|
-
if (tableListeners['footer-cell-click']) {
|
|
13940
|
-
tfOns.click = evnt => {
|
|
13941
|
-
$xetable.emitEvent('footer-cell-click', Object.assign({
|
|
13942
|
-
cell: evnt.currentTarget
|
|
13943
|
-
}, cellParams), evnt);
|
|
13944
|
-
};
|
|
13945
|
-
}
|
|
13946
|
-
if (tableListeners['footer-cell-dblclick']) {
|
|
13947
|
-
tfOns.dblclick = evnt => {
|
|
13948
|
-
$xetable.emitEvent('footer-cell-dblclick', Object.assign({
|
|
13949
|
-
cell: evnt.currentTarget
|
|
13950
|
-
}, cellParams), evnt);
|
|
13951
|
-
};
|
|
13952
|
-
}
|
|
13953
|
-
// 合并行或列
|
|
13954
|
-
if (mergeFooterList.length) {
|
|
13955
|
-
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
13956
|
-
if (spanRest) {
|
|
13957
|
-
const {
|
|
13958
|
-
rowspan,
|
|
13959
|
-
colspan
|
|
13960
|
-
} = spanRest;
|
|
13961
|
-
if (!rowspan || !colspan) {
|
|
13962
|
-
return null;
|
|
13963
|
-
}
|
|
13964
|
-
if (rowspan > 1) {
|
|
13965
|
-
attrs.rowspan = rowspan;
|
|
13966
|
-
}
|
|
13967
|
-
if (colspan > 1) {
|
|
13968
|
-
attrs.colspan = colspan;
|
|
13969
|
-
}
|
|
13970
|
-
}
|
|
13971
|
-
} else if (footerSpanMethod) {
|
|
13972
|
-
// 自定义合并方法
|
|
13973
|
-
const {
|
|
13974
|
-
rowspan = 1,
|
|
13975
|
-
colspan = 1
|
|
13976
|
-
} = footerSpanMethod(cellParams) || {};
|
|
13977
|
-
if (!rowspan || !colspan) {
|
|
13978
|
-
return null;
|
|
13979
|
-
}
|
|
13980
|
-
if (rowspan > 1) {
|
|
13981
|
-
attrs.rowspan = rowspan;
|
|
13982
|
-
}
|
|
13983
|
-
if (colspan > 1) {
|
|
13984
|
-
attrs.colspan = colspan;
|
|
13985
|
-
}
|
|
13986
|
-
}
|
|
13987
|
-
return h('td', {
|
|
13988
|
-
class: ['vxe-footer--column', column.id, {
|
|
13989
|
-
[`col--${footAlign}`]: footAlign,
|
|
13990
|
-
[`col--${type}`]: type,
|
|
13991
|
-
'col--last': $columnIndex === tableColumn.length - 1,
|
|
13992
|
-
'fixed--hidden': fixedHiddenColumn,
|
|
13993
|
-
'col--ellipsis': hasEllipsis,
|
|
13994
|
-
'col--current': currentColumn === column
|
|
13995
|
-
}, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
|
|
13996
|
-
attrs,
|
|
13997
|
-
style: footerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle : null,
|
|
13998
|
-
on: tfOns,
|
|
13999
|
-
key: columnKey || columnOpts.useKey ? column.id : $columnIndex
|
|
14000
|
-
}, [h('div', {
|
|
14001
|
-
class: ['vxe-cell', {
|
|
14002
|
-
'c--title': showTitle,
|
|
14003
|
-
'c--tooltip': showTooltip,
|
|
14004
|
-
'c--ellipsis': showEllipsis
|
|
14005
|
-
}]
|
|
14006
|
-
}, column.renderFooter(h, cellParams))]);
|
|
14007
|
-
}).concat(scrollbarWidth ? [h('td', {
|
|
14008
|
-
class: 'vxe-footer--gutter col--gutter'
|
|
14009
|
-
})] : []));
|
|
14010
|
-
}))])]);
|
|
14407
|
+
}, footer_renderHeads(h, this, footerTableData))])]);
|
|
14011
14408
|
},
|
|
14012
14409
|
methods: {
|
|
14013
14410
|
/**
|
|
@@ -14234,8 +14631,12 @@ const {
|
|
|
14234
14631
|
cellConfig: Object,
|
|
14235
14632
|
// 行配置信息
|
|
14236
14633
|
rowConfig: Object,
|
|
14237
|
-
//
|
|
14634
|
+
// 已废弃,被 rowDragConfig 替换
|
|
14238
14635
|
dragConfig: Object,
|
|
14636
|
+
// 行拖拽排序配置项
|
|
14637
|
+
rowDragConfig: Object,
|
|
14638
|
+
// 列拖拽排序配置项
|
|
14639
|
+
columnDragConfig: Object,
|
|
14239
14640
|
// 列调整配置项
|
|
14240
14641
|
resizableConfig: Object,
|
|
14241
14642
|
// 序号配置项
|
|
@@ -17603,7 +18004,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
17603
18004
|
}
|
|
17604
18005
|
this.closeTooltip();
|
|
17605
18006
|
if (actived.column) {
|
|
17606
|
-
this.
|
|
18007
|
+
this.handleClearEdit(evnt);
|
|
17607
18008
|
}
|
|
17608
18009
|
type = 'edit-activated';
|
|
17609
18010
|
column.renderHeight = cell.offsetHeight;
|
|
@@ -17712,17 +18113,23 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
17712
18113
|
}
|
|
17713
18114
|
}
|
|
17714
18115
|
},
|
|
17715
|
-
_clearActived(
|
|
18116
|
+
_clearActived(row) {
|
|
17716
18117
|
if (true) {
|
|
17717
18118
|
warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit']);
|
|
17718
18119
|
}
|
|
17719
18120
|
// 即将废弃
|
|
17720
|
-
return this.clearEdit(
|
|
18121
|
+
return this.clearEdit(row);
|
|
17721
18122
|
},
|
|
17722
18123
|
/**
|
|
17723
18124
|
* 清除激活的编辑
|
|
17724
18125
|
*/
|
|
17725
|
-
_clearEdit(
|
|
18126
|
+
_clearEdit(row) {
|
|
18127
|
+
return this.handleClearEdit(null, row);
|
|
18128
|
+
},
|
|
18129
|
+
/**
|
|
18130
|
+
* 取消编辑
|
|
18131
|
+
*/
|
|
18132
|
+
handleClearEdit(evnt, targetRow) {
|
|
17726
18133
|
const $xeTable = this;
|
|
17727
18134
|
const reactData = $xeTable;
|
|
17728
18135
|
const {
|
|
@@ -17738,30 +18145,33 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
17738
18145
|
} = actived;
|
|
17739
18146
|
const validOpts = $xeTable.validOpts;
|
|
17740
18147
|
if (row || column) {
|
|
17741
|
-
|
|
18148
|
+
if (targetRow && getRowid($xeTable, targetRow) !== getRowid($xeTable, row)) {
|
|
18149
|
+
return $xeTable.$nextTick();
|
|
18150
|
+
}
|
|
18151
|
+
$xeTable._syncActivedCell();
|
|
17742
18152
|
actived.args = null;
|
|
17743
18153
|
actived.row = null;
|
|
17744
18154
|
actived.column = null;
|
|
17745
|
-
|
|
17746
|
-
|
|
18155
|
+
$xeTable.updateFooter();
|
|
18156
|
+
$xeTable.emitEvent('edit-closed', {
|
|
17747
18157
|
row,
|
|
17748
|
-
rowIndex:
|
|
17749
|
-
$rowIndex:
|
|
18158
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
18159
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
17750
18160
|
column,
|
|
17751
|
-
columnIndex:
|
|
17752
|
-
$columnIndex:
|
|
18161
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
18162
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
17753
18163
|
}, evnt);
|
|
17754
18164
|
}
|
|
17755
18165
|
focused.row = null;
|
|
17756
18166
|
focused.column = null;
|
|
17757
18167
|
if (validOpts.autoClear) {
|
|
17758
18168
|
if (validOpts.msgMode !== 'full' || mixin_getConfig().cellVaildMode === 'obsolete') {
|
|
17759
|
-
if (
|
|
17760
|
-
return
|
|
18169
|
+
if ($xeTable.clearValidate) {
|
|
18170
|
+
return $xeTable.clearValidate();
|
|
17761
18171
|
}
|
|
17762
18172
|
}
|
|
17763
18173
|
}
|
|
17764
|
-
return
|
|
18174
|
+
return $xeTable.$nextTick();
|
|
17765
18175
|
},
|
|
17766
18176
|
_getActiveRecord() {
|
|
17767
18177
|
if (true) {
|
|
@@ -17965,7 +18375,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
17965
18375
|
const selectMethod = () => {
|
|
17966
18376
|
if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
|
|
17967
18377
|
if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
|
|
17968
|
-
this.
|
|
18378
|
+
this.handleClearEdit(evnt);
|
|
17969
18379
|
this.clearSelected(evnt);
|
|
17970
18380
|
this.clearCellAreas(evnt);
|
|
17971
18381
|
this.clearCopyCellArea(evnt);
|
|
@@ -20361,7 +20771,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
20361
20771
|
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
|
|
20362
20772
|
}
|
|
20363
20773
|
}
|
|
20364
|
-
return this.beginValidate(rows, cb, true);
|
|
20774
|
+
return this.beginValidate(rows, null, cb, true);
|
|
20365
20775
|
},
|
|
20366
20776
|
/**
|
|
20367
20777
|
* 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
|
|
@@ -20372,7 +20782,27 @@ function validErrorRuleValue(rule, val) {
|
|
|
20372
20782
|
warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
|
|
20373
20783
|
}
|
|
20374
20784
|
}
|
|
20375
|
-
return this.beginValidate(rows, cb);
|
|
20785
|
+
return this.beginValidate(rows, null, cb);
|
|
20786
|
+
},
|
|
20787
|
+
/**
|
|
20788
|
+
* 完整校验单元格,和 validateField 的区别就是会给有效数据中的每一行进行校验
|
|
20789
|
+
*/
|
|
20790
|
+
_fullValidateField(rows, fieldOrColumn) {
|
|
20791
|
+
const colList = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn(this, column));
|
|
20792
|
+
if (colList.length) {
|
|
20793
|
+
return this.beginValidate(rows, colList, null, true);
|
|
20794
|
+
}
|
|
20795
|
+
return this.$nextTick();
|
|
20796
|
+
},
|
|
20797
|
+
/**
|
|
20798
|
+
* 快速校验单元格,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
|
|
20799
|
+
*/
|
|
20800
|
+
_validateField(rows, fieldOrColumn) {
|
|
20801
|
+
const colList = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn(this, column));
|
|
20802
|
+
if (colList.length) {
|
|
20803
|
+
return this.beginValidate(rows, colList, null);
|
|
20804
|
+
}
|
|
20805
|
+
return this.$nextTick();
|
|
20376
20806
|
},
|
|
20377
20807
|
/**
|
|
20378
20808
|
* 聚焦到校验通过的单元格并弹出校验错误提示
|
|
@@ -20421,7 +20851,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
20421
20851
|
* 如果只传 callback 否则默认验证整个表格数据
|
|
20422
20852
|
* 返回 Promise 对象,或者使用回调方式
|
|
20423
20853
|
*/
|
|
20424
|
-
beginValidate(rows, cb, isFull) {
|
|
20854
|
+
beginValidate(rows, cols, cb, isFull) {
|
|
20425
20855
|
const validRest = {};
|
|
20426
20856
|
const {
|
|
20427
20857
|
editRules,
|
|
@@ -20450,12 +20880,13 @@ function validErrorRuleValue(rule, val) {
|
|
|
20450
20880
|
this.clearValidate();
|
|
20451
20881
|
const validErrMaps = {};
|
|
20452
20882
|
if (editRules) {
|
|
20453
|
-
const columns = this.getColumns();
|
|
20883
|
+
const columns = cols && cols.length ? cols : this.getColumns();
|
|
20454
20884
|
const handleVaild = row => {
|
|
20455
20885
|
if (isFull || !this.validRuleErr) {
|
|
20456
20886
|
const colVailds = [];
|
|
20457
20887
|
columns.forEach(column => {
|
|
20458
|
-
|
|
20888
|
+
const field = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(column) ? column : column.field;
|
|
20889
|
+
if ((isFull || !this.validRuleErr) && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().has(editRules, field)) {
|
|
20459
20890
|
colVailds.push(this.validCellRules('all', row, column).catch(({
|
|
20460
20891
|
rule,
|
|
20461
20892
|
rules
|
|
@@ -20467,11 +20898,11 @@ function validErrorRuleValue(rule, val) {
|
|
|
20467
20898
|
row,
|
|
20468
20899
|
columnIndex: this.getColumnIndex(column),
|
|
20469
20900
|
column,
|
|
20470
|
-
field
|
|
20901
|
+
field,
|
|
20471
20902
|
$table: this
|
|
20472
20903
|
};
|
|
20473
|
-
if (!validRest[
|
|
20474
|
-
validRest[
|
|
20904
|
+
if (!validRest[field]) {
|
|
20905
|
+
validRest[field] = [];
|
|
20475
20906
|
}
|
|
20476
20907
|
validErrMaps[`${getRowid(this, row)}:${column.id}`] = {
|
|
20477
20908
|
column,
|
|
@@ -20479,7 +20910,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
20479
20910
|
rule,
|
|
20480
20911
|
content: rule.content
|
|
20481
20912
|
};
|
|
20482
|
-
validRest[
|
|
20913
|
+
validRest[field].push(rest);
|
|
20483
20914
|
if (!isFull) {
|
|
20484
20915
|
this.validRuleErr = true;
|
|
20485
20916
|
return Promise.reject(rest);
|
|
@@ -20696,7 +21127,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
20696
21127
|
} = this;
|
|
20697
21128
|
const validTip = this.$refs.validTip;
|
|
20698
21129
|
const rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows) ? rows : rows ? [rows] : [];
|
|
20699
|
-
const colList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn :
|
|
21130
|
+
const colList = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn(this, column));
|
|
20700
21131
|
let validErrMaps = {};
|
|
20701
21132
|
if (validTip && validTip.visible) {
|
|
20702
21133
|
validTip.close();
|
|
@@ -20883,6 +21314,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
20883
21314
|
},
|
|
20884
21315
|
_saveCustom() {
|
|
20885
21316
|
const $xeTable = this;
|
|
21317
|
+
const reactData = $xeTable;
|
|
20886
21318
|
const {
|
|
20887
21319
|
customOpts,
|
|
20888
21320
|
customColumnList
|
|
@@ -20918,7 +21350,10 @@ function validErrorRuleValue(rule, val) {
|
|
|
20918
21350
|
column.visible = column.renderVisible;
|
|
20919
21351
|
}
|
|
20920
21352
|
});
|
|
20921
|
-
|
|
21353
|
+
reactData.isDragColMove = true;
|
|
21354
|
+
setTimeout(() => {
|
|
21355
|
+
reactData.isDragColMove = false;
|
|
21356
|
+
}, 1000);
|
|
20922
21357
|
return $xeTable.saveCustomStore('confirm');
|
|
20923
21358
|
},
|
|
20924
21359
|
_cancelCustom() {
|
|
@@ -21237,6 +21672,54 @@ function renderEmptyBody(h, _vm) {
|
|
|
21237
21672
|
}
|
|
21238
21673
|
return emptyContent;
|
|
21239
21674
|
}
|
|
21675
|
+
const renderDragTipContents = (h, $xeTable) => {
|
|
21676
|
+
const props = $xeTable;
|
|
21677
|
+
const reactData = $xeTable;
|
|
21678
|
+
const {
|
|
21679
|
+
dragConfig
|
|
21680
|
+
} = props;
|
|
21681
|
+
const {
|
|
21682
|
+
dragRow,
|
|
21683
|
+
dragCol,
|
|
21684
|
+
dragTipText
|
|
21685
|
+
} = reactData;
|
|
21686
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
21687
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
21688
|
+
const rowDragSlots = rowDragOpts.slots || {};
|
|
21689
|
+
const rTipSlot = rowDragSlots.tip || (dragConfig && dragConfig.slots ? dragConfig.slots.rowTip : null);
|
|
21690
|
+
const columnDragSlots = columnDragOpts.slots || {};
|
|
21691
|
+
const cTipSlot = columnDragSlots.tip;
|
|
21692
|
+
if (dragRow && rTipSlot) {
|
|
21693
|
+
return $xeTable.callSlot(rTipSlot, {
|
|
21694
|
+
row: dragRow
|
|
21695
|
+
}, h);
|
|
21696
|
+
}
|
|
21697
|
+
if (dragCol && cTipSlot) {
|
|
21698
|
+
return $xeTable.callSlot(cTipSlot, {
|
|
21699
|
+
column: dragCol
|
|
21700
|
+
}, h);
|
|
21701
|
+
}
|
|
21702
|
+
return [h('span', dragTipText)];
|
|
21703
|
+
};
|
|
21704
|
+
const renderDragTip = (h, $xeTable) => {
|
|
21705
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
21706
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
21707
|
+
if (rowOpts.drag || columnOpts.drag) {
|
|
21708
|
+
return h('div', {
|
|
21709
|
+
class: 'vxe-table--drag-wrapper'
|
|
21710
|
+
}, [h('div', {
|
|
21711
|
+
ref: 'refDragRowLineElem',
|
|
21712
|
+
class: 'vxe-table--drag-row-line'
|
|
21713
|
+
}), h('div', {
|
|
21714
|
+
ref: 'refDragColLineElem',
|
|
21715
|
+
class: 'vxe-table--drag-col-line'
|
|
21716
|
+
}), h('div', {
|
|
21717
|
+
ref: 'refDragTipElem',
|
|
21718
|
+
class: 'vxe-table--drag-sort-tip'
|
|
21719
|
+
}, renderDragTipContents(h, $xeTable))]);
|
|
21720
|
+
}
|
|
21721
|
+
return table_renderEmptyElement($xeTable);
|
|
21722
|
+
};
|
|
21240
21723
|
function handleUupdateResize(_vm) {
|
|
21241
21724
|
const {
|
|
21242
21725
|
$el
|
|
@@ -21483,9 +21966,13 @@ function handleUupdateResize(_vm) {
|
|
|
21483
21966
|
isHeader: false,
|
|
21484
21967
|
isFooter: false
|
|
21485
21968
|
},
|
|
21969
|
+
scrollVMLoading: false,
|
|
21486
21970
|
isDragRowMove: false,
|
|
21487
21971
|
dragRow: null,
|
|
21972
|
+
isDragColMove: false,
|
|
21973
|
+
dragCol: null,
|
|
21488
21974
|
dragTipText: '',
|
|
21975
|
+
_isResize: false,
|
|
21489
21976
|
_isLoading: false
|
|
21490
21977
|
};
|
|
21491
21978
|
},
|
|
@@ -21570,8 +22057,11 @@ function handleUupdateResize(_vm) {
|
|
|
21570
22057
|
computeRowOpts() {
|
|
21571
22058
|
return Object.assign({}, table_getConfig().table.rowConfig, this.rowConfig);
|
|
21572
22059
|
},
|
|
21573
|
-
|
|
21574
|
-
return Object.assign({}, table_getConfig().table.
|
|
22060
|
+
computeRowDragOpts() {
|
|
22061
|
+
return Object.assign({}, table_getConfig().table.rowDragConfig, this.rowDragConfig);
|
|
22062
|
+
},
|
|
22063
|
+
computeColumnDragOpts() {
|
|
22064
|
+
return Object.assign({}, table_getConfig().table.columnDragConfig, this.columnDragConfig);
|
|
21575
22065
|
},
|
|
21576
22066
|
resizeOpts() {
|
|
21577
22067
|
return this.computeResizeOpts;
|
|
@@ -22040,7 +22530,7 @@ function handleUupdateResize(_vm) {
|
|
|
22040
22530
|
if (this.rowOpts.height && !this.showOverflow) {
|
|
22041
22531
|
warnLog('vxe.error.notProp', ['table.show-overflow']);
|
|
22042
22532
|
}
|
|
22043
|
-
if (!this.
|
|
22533
|
+
if (!this.handleRecalculateCellAreas) {
|
|
22044
22534
|
if (this.clipConfig) {
|
|
22045
22535
|
warnLog('vxe.error.notProp', ['clip-config']);
|
|
22046
22536
|
}
|
|
@@ -22052,6 +22542,9 @@ function handleUupdateResize(_vm) {
|
|
|
22052
22542
|
return;
|
|
22053
22543
|
}
|
|
22054
22544
|
}
|
|
22545
|
+
if (this.dragConfig) {
|
|
22546
|
+
warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
|
|
22547
|
+
}
|
|
22055
22548
|
if (this.treeConfig && treeOpts.children) {
|
|
22056
22549
|
warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
|
|
22057
22550
|
}
|
|
@@ -22240,7 +22733,6 @@ function handleUupdateResize(_vm) {
|
|
|
22240
22733
|
const VxeUILoadingComponent = core_.VxeUI.getComponent('VxeLoading');
|
|
22241
22734
|
const VxeUITooltipComponent = core_.VxeUI.getComponent('VxeTooltip');
|
|
22242
22735
|
const $xeTable = this;
|
|
22243
|
-
const reactData = $xeTable;
|
|
22244
22736
|
const {
|
|
22245
22737
|
_e,
|
|
22246
22738
|
$scopedSlots,
|
|
@@ -22259,6 +22751,7 @@ function handleUupdateResize(_vm) {
|
|
|
22259
22751
|
treeConfig,
|
|
22260
22752
|
mouseConfig,
|
|
22261
22753
|
mouseOpts,
|
|
22754
|
+
areaOpts,
|
|
22262
22755
|
computeSize,
|
|
22263
22756
|
validOpts,
|
|
22264
22757
|
showFooter,
|
|
@@ -22285,28 +22778,25 @@ function handleUupdateResize(_vm) {
|
|
|
22285
22778
|
loadingOpts,
|
|
22286
22779
|
editRules
|
|
22287
22780
|
} = $xeTable;
|
|
22288
|
-
const {
|
|
22289
|
-
dragRow,
|
|
22290
|
-
dragTipText
|
|
22291
|
-
} = reactData;
|
|
22292
22781
|
const {
|
|
22293
22782
|
leftList,
|
|
22294
22783
|
rightList
|
|
22295
22784
|
} = columnStore;
|
|
22296
22785
|
const currLoading = this._isLoading || loading;
|
|
22297
22786
|
const vSize = computeSize;
|
|
22298
|
-
const dragOpts = $xeTable.computeDragOpts;
|
|
22299
22787
|
const virtualScrollBars = $xeTable.computeVirtualScrollBars;
|
|
22300
|
-
const
|
|
22301
|
-
const rowTipSlot = dragSlots.rowTip;
|
|
22788
|
+
const isArea = mouseConfig && mouseOpts.area;
|
|
22302
22789
|
return h('div', {
|
|
22790
|
+
ref: 'refElem',
|
|
22303
22791
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
|
|
22304
22792
|
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
|
|
22305
22793
|
'vxe-editable': !!editConfig,
|
|
22306
22794
|
'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete',
|
|
22307
22795
|
'cell--highlight': highlightCell,
|
|
22308
22796
|
'cell--selected': mouseConfig && mouseOpts.selected,
|
|
22309
|
-
'cell--area':
|
|
22797
|
+
'cell--area': isArea,
|
|
22798
|
+
'header-cell--area': isArea && areaOpts.selectCellByHeader,
|
|
22799
|
+
'body-cell--area': isArea && areaOpts.selectCellByBody,
|
|
22310
22800
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
22311
22801
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
22312
22802
|
'checkbox--range': checkboxOpts.range,
|
|
@@ -22501,14 +22991,9 @@ function handleUupdateResize(_vm) {
|
|
|
22501
22991
|
}
|
|
22502
22992
|
}) : _e(),
|
|
22503
22993
|
/**
|
|
22504
|
-
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
ref: 'refRowDragTipElem',
|
|
22508
|
-
class: 'vxe-table--row-drag-tip'
|
|
22509
|
-
}, rowTipSlot ? dragRow ? this.callSlot(rowTipSlot, {
|
|
22510
|
-
row: dragRow
|
|
22511
|
-
}, h) : [table_renderEmptyElement($xeTable)] : dragTipText ? [h('span', dragTipText)] : [table_renderEmptyElement($xeTable)]) : _e(), h('div', {}, [
|
|
22994
|
+
* 拖拽提示
|
|
22995
|
+
*/
|
|
22996
|
+
renderDragTip(h, this), h('div', {}, [
|
|
22512
22997
|
/**
|
|
22513
22998
|
* 提示相关
|
|
22514
22999
|
*/
|