vxe-table 3.21.22 → 3.21.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/{iconfont.1782890276645.ttf → iconfont.1783331230583.ttf} +0 -0
- package/es/iconfont.1783331230583.woff +0 -0
- package/es/iconfont.1783331230583.woff2 +0 -0
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +12 -3
- package/es/locale/lang/de-DE.js +12 -3
- package/es/locale/lang/en-US.js +16 -7
- package/es/locale/lang/es-ES.js +12 -3
- package/es/locale/lang/fr-FR.js +12 -3
- package/es/locale/lang/hu-HU.js +12 -3
- package/es/locale/lang/hy-AM.js +12 -3
- package/es/locale/lang/id-ID.js +12 -3
- package/es/locale/lang/it-IT.js +11 -2
- package/es/locale/lang/ja-JP.js +12 -3
- package/es/locale/lang/ko-KR.js +12 -3
- package/es/locale/lang/ms-MY.js +12 -3
- package/es/locale/lang/nb-NO.js +12 -3
- package/es/locale/lang/pt-BR.js +12 -3
- package/es/locale/lang/ru-RU.js +12 -3
- package/es/locale/lang/th-TH.js +12 -3
- package/es/locale/lang/ug-CN.js +12 -3
- package/es/locale/lang/uk-UA.js +12 -3
- package/es/locale/lang/uz-UZ.js +12 -3
- package/es/locale/lang/vi-VN.js +11 -2
- package/es/locale/lang/zh-CHT.js +14 -5
- package/es/locale/lang/zh-CN.js +14 -5
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +84 -13
- package/es/table/module/custom/panel.js +485 -312
- package/es/table/src/cell.js +2 -2
- package/es/table/src/columnInfo.js +13 -7
- package/es/table/src/methods.js +102 -60
- package/es/table/src/util.js +31 -1
- package/es/table/style.css +96 -49
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +16 -4
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +96 -49
- package/es/vxe-table/style.min.css +1 -1
- package/lib/{iconfont.1782890276645.ttf → iconfont.1783331230583.ttf} +0 -0
- package/lib/iconfont.1783331230583.woff +0 -0
- package/lib/iconfont.1783331230583.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +560 -196
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +12 -3
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +12 -3
- package/lib/locale/lang/de-DE.js +12 -3
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +12 -3
- package/lib/locale/lang/en-US.js +16 -7
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +16 -7
- package/lib/locale/lang/es-ES.js +12 -3
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +12 -3
- package/lib/locale/lang/fr-FR.js +12 -3
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +12 -3
- package/lib/locale/lang/hu-HU.js +12 -3
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +12 -3
- package/lib/locale/lang/hy-AM.js +12 -3
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +12 -3
- package/lib/locale/lang/id-ID.js +12 -3
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +12 -3
- package/lib/locale/lang/it-IT.js +11 -2
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +11 -2
- package/lib/locale/lang/ja-JP.js +12 -3
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +12 -3
- package/lib/locale/lang/ko-KR.js +12 -3
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +12 -3
- package/lib/locale/lang/ms-MY.js +12 -3
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +12 -3
- package/lib/locale/lang/nb-NO.js +12 -3
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +12 -3
- package/lib/locale/lang/pt-BR.js +12 -3
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +12 -3
- package/lib/locale/lang/ru-RU.js +12 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +12 -3
- package/lib/locale/lang/th-TH.js +12 -3
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +12 -3
- package/lib/locale/lang/ug-CN.js +12 -3
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +12 -3
- package/lib/locale/lang/uk-UA.js +12 -3
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +12 -3
- package/lib/locale/lang/uz-UZ.js +12 -3
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +12 -3
- package/lib/locale/lang/vi-VN.js +11 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +11 -2
- package/lib/locale/lang/zh-CHT.js +14 -5
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +14 -5
- package/lib/locale/lang/zh-CN.js +14 -5
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +14 -5
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +91 -11
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +376 -158
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/cell.js +2 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +16 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +10 -9
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +35 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +96 -49
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +16 -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 +96 -49
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +12 -3
- package/packages/locale/lang/de-DE.ts +12 -3
- package/packages/locale/lang/en-US.ts +16 -7
- package/packages/locale/lang/es-ES.ts +12 -3
- package/packages/locale/lang/fr-FR.ts +12 -3
- package/packages/locale/lang/hu-HU.ts +12 -3
- package/packages/locale/lang/hy-AM.ts +12 -3
- package/packages/locale/lang/id-ID.ts +12 -3
- package/packages/locale/lang/it-IT.ts +11 -2
- package/packages/locale/lang/ja-JP.ts +12 -3
- package/packages/locale/lang/ko-KR.ts +12 -3
- package/packages/locale/lang/ms-MY.ts +12 -3
- package/packages/locale/lang/nb-NO.ts +12 -3
- package/packages/locale/lang/pt-BR.ts +12 -3
- package/packages/locale/lang/ru-RU.ts +12 -3
- package/packages/locale/lang/th-TH.ts +12 -3
- package/packages/locale/lang/ug-CN.ts +12 -3
- package/packages/locale/lang/uk-UA.ts +12 -3
- package/packages/locale/lang/uz-UZ.ts +12 -3
- package/packages/locale/lang/vi-VN.ts +11 -2
- package/packages/locale/lang/zh-CHT.ts +14 -5
- package/packages/locale/lang/zh-CN.ts +14 -5
- package/packages/table/module/custom/mixin.ts +85 -14
- package/packages/table/module/custom/panel.ts +538 -307
- package/packages/table/src/cell.ts +2 -2
- package/packages/table/src/columnInfo.ts +13 -7
- package/packages/table/src/methods.ts +118 -61
- package/packages/table/src/util.ts +34 -1
- package/packages/ui/index.ts +15 -3
- package/styles/components/icon.scss +29 -2
- package/styles/components/table-module/custom.scss +88 -67
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/theme/base.scss +11 -0
- package/es/iconfont.1782890276645.woff +0 -0
- package/es/iconfont.1782890276645.woff2 +0 -0
- package/lib/iconfont.1782890276645.woff +0 -0
- package/lib/iconfont.1782890276645.woff2 +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3311,7 +3311,7 @@ function getClass(property, params) {
|
|
|
3311
3311
|
/* unused harmony import specifier */ var VxeUI;
|
|
3312
3312
|
|
|
3313
3313
|
|
|
3314
|
-
const version = "3.21.
|
|
3314
|
+
const version = "3.21.24";
|
|
3315
3315
|
core_.VxeUI.version = version;
|
|
3316
3316
|
core_.VxeUI.tableVersion = version;
|
|
3317
3317
|
core_.VxeUI.setConfig({
|
|
@@ -3423,6 +3423,7 @@ core_.VxeUI.setConfig({
|
|
|
3423
3423
|
allowResizable: true,
|
|
3424
3424
|
allowFixed: true,
|
|
3425
3425
|
allowSort: true,
|
|
3426
|
+
allowAlign: true,
|
|
3426
3427
|
showSortDragButton: true,
|
|
3427
3428
|
showFooter: true,
|
|
3428
3429
|
placement: 'top-right',
|
|
@@ -3431,9 +3432,11 @@ core_.VxeUI.setConfig({
|
|
|
3431
3432
|
visible: true,
|
|
3432
3433
|
resizable: true,
|
|
3433
3434
|
sort: true,
|
|
3434
|
-
fixed: true
|
|
3435
|
-
|
|
3436
|
-
|
|
3435
|
+
fixed: true,
|
|
3436
|
+
align: true,
|
|
3437
|
+
headerAlign: true,
|
|
3438
|
+
footerAlign: true,
|
|
3439
|
+
aggFunc: true
|
|
3437
3440
|
},
|
|
3438
3441
|
// autoAggGroupValues: false,
|
|
3439
3442
|
// checkMethod () {},
|
|
@@ -3656,6 +3659,15 @@ core_.VxeUI.setIcon({
|
|
|
3656
3659
|
TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
|
|
3657
3660
|
TABLE_RADIO_DISABLED_UNCHECKED: iconPrefix + 'radio-unchecked-fill',
|
|
3658
3661
|
TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
|
|
3662
|
+
TABLE_CUSTOM_FIXED_LEFT: iconPrefix + 'fixed-left',
|
|
3663
|
+
TABLE_CUSTOM_FIXED_RIGHT: iconPrefix + 'fixed-right',
|
|
3664
|
+
TABLE_CUSTOM_ALIGN_LEFT: iconPrefix + 'align-left',
|
|
3665
|
+
TABLE_CUSTOM_ALIGN_CENTER: iconPrefix + 'align-center',
|
|
3666
|
+
TABLE_CUSTOM_ALIGN_RIGHT: iconPrefix + 'align-right',
|
|
3667
|
+
TABLE_CUSTOM_MOVE_UP: iconPrefix + 'arrows-up',
|
|
3668
|
+
TABLE_CUSTOM_MOVE_DN: iconPrefix + 'arrows-down',
|
|
3669
|
+
TABLE_CUSTOM_PUT_TOP: iconPrefix + 'top',
|
|
3670
|
+
TABLE_CUSTOM_PUT_BOTTOM: iconPrefix + 'bottom',
|
|
3659
3671
|
TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
|
|
3660
3672
|
TABLE_MENU_OPTION_LOADING: iconPrefix + 'repeat roll',
|
|
3661
3673
|
TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
|
|
@@ -4074,7 +4086,7 @@ function wheelScrollTopTo(diffNum, cb) {
|
|
|
4074
4086
|
const {
|
|
4075
4087
|
log: log_log
|
|
4076
4088
|
} = core_.VxeUI;
|
|
4077
|
-
const tableVersion = `table v${"3.21.
|
|
4089
|
+
const tableVersion = `table v${"3.21.24"}`;
|
|
4078
4090
|
function createComponentLog(name) {
|
|
4079
4091
|
const uiVersion = core_.VxeUI.uiVersion ? `ui v${core_.VxeUI.uiVersion}` : '';
|
|
4080
4092
|
const ganttVersion = core_.VxeUI.ganttVersion ? `gantt v${core_.VxeUI.ganttVersion}` : '';
|
|
@@ -4120,6 +4132,10 @@ class ColumnInfo {
|
|
|
4120
4132
|
field,
|
|
4121
4133
|
width,
|
|
4122
4134
|
visible,
|
|
4135
|
+
fixed,
|
|
4136
|
+
align,
|
|
4137
|
+
headerAlign,
|
|
4138
|
+
footerAlign,
|
|
4123
4139
|
aggFunc,
|
|
4124
4140
|
formatter,
|
|
4125
4141
|
filterMultiple,
|
|
@@ -4196,10 +4212,10 @@ class ColumnInfo {
|
|
|
4196
4212
|
minWidth: colConfs.minWidth,
|
|
4197
4213
|
maxWidth: colConfs.maxWidth,
|
|
4198
4214
|
resizable: colConfs.resizable,
|
|
4199
|
-
fixed
|
|
4200
|
-
align
|
|
4201
|
-
headerAlign
|
|
4202
|
-
footerAlign
|
|
4215
|
+
fixed,
|
|
4216
|
+
align,
|
|
4217
|
+
headerAlign,
|
|
4218
|
+
footerAlign,
|
|
4203
4219
|
showOverflow: colConfs.showOverflow,
|
|
4204
4220
|
showHeaderOverflow: colConfs.showHeaderOverflow,
|
|
4205
4221
|
showFooterOverflow: colConfs.showFooterOverflow,
|
|
@@ -4240,7 +4256,7 @@ class ColumnInfo {
|
|
|
4240
4256
|
titleHelp: colConfs.titleHelp,
|
|
4241
4257
|
titlePrefix: colConfs.titlePrefix,
|
|
4242
4258
|
titleSuffix: colConfs.titleSuffix,
|
|
4243
|
-
aggFunc
|
|
4259
|
+
aggFunc,
|
|
4244
4260
|
copyMethod: colConfs.copyMethod,
|
|
4245
4261
|
cutMethod: colConfs.cutMethod,
|
|
4246
4262
|
pasteMethod: colConfs.pasteMethod,
|
|
@@ -4254,7 +4270,10 @@ class ColumnInfo {
|
|
|
4254
4270
|
defaultParentId: null,
|
|
4255
4271
|
halfVisible: false,
|
|
4256
4272
|
defaultVisible: defaultVisible,
|
|
4257
|
-
defaultFixed:
|
|
4273
|
+
defaultFixed: fixed,
|
|
4274
|
+
defaultAlign: align,
|
|
4275
|
+
defaultHeaderAlign: headerAlign,
|
|
4276
|
+
defaultFooterAlign: footerAlign,
|
|
4258
4277
|
defaultAggFunc: colConfs.aggFunc,
|
|
4259
4278
|
checked: false,
|
|
4260
4279
|
halfChecked: false,
|
|
@@ -4278,6 +4297,9 @@ class ColumnInfo {
|
|
|
4278
4297
|
renderAggFn: '',
|
|
4279
4298
|
renderAggDigits: null,
|
|
4280
4299
|
renderAggFormat: null,
|
|
4300
|
+
renderAlign: '',
|
|
4301
|
+
renderHeaderAlign: '',
|
|
4302
|
+
renderFooterAlign: '',
|
|
4281
4303
|
renderFixed: '',
|
|
4282
4304
|
renderVisible: false,
|
|
4283
4305
|
renderWidth: defaultRenderWidth,
|
|
@@ -4566,7 +4588,8 @@ function createReactData() {
|
|
|
4566
4588
|
activeWrapper: false,
|
|
4567
4589
|
visible: false,
|
|
4568
4590
|
maxHeight: null,
|
|
4569
|
-
|
|
4591
|
+
defPopupStyle: {},
|
|
4592
|
+
panePopupStyle: {},
|
|
4570
4593
|
oldSortMaps: {},
|
|
4571
4594
|
oldFixedMaps: {},
|
|
4572
4595
|
oldVisibleMaps: {}
|
|
@@ -5417,6 +5440,38 @@ function colToVisible($xeTable, isForce, column, row) {
|
|
|
5417
5440
|
}
|
|
5418
5441
|
return Promise.resolve();
|
|
5419
5442
|
}
|
|
5443
|
+
function hangleBolleanDefaultValue(currVal, defVal) {
|
|
5444
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currVal) ? currVal : defVal;
|
|
5445
|
+
}
|
|
5446
|
+
function handleCustomStoreConfig($xeTable) {
|
|
5447
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
5448
|
+
const {
|
|
5449
|
+
storage,
|
|
5450
|
+
storeOptions
|
|
5451
|
+
} = customOpts;
|
|
5452
|
+
const isAllCustom = storage === true;
|
|
5453
|
+
const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
|
|
5454
|
+
const isCustomAlign = hangleBolleanDefaultValue(storageOpts.align, isAllCustom);
|
|
5455
|
+
const isCustomHeaderAlign = hangleBolleanDefaultValue(storageOpts.headerAlign, isAllCustom);
|
|
5456
|
+
const isCustomFooterAlign = hangleBolleanDefaultValue(storageOpts.footerAlign, isAllCustom);
|
|
5457
|
+
const isCustomResizable = hangleBolleanDefaultValue(storageOpts.resizable, isAllCustom);
|
|
5458
|
+
const isCustomVisible = hangleBolleanDefaultValue(storageOpts.visible, isAllCustom);
|
|
5459
|
+
const isCustomFixed = hangleBolleanDefaultValue(storageOpts.fixed, isAllCustom);
|
|
5460
|
+
const isCustomSort = hangleBolleanDefaultValue(storageOpts.sort, isAllCustom);
|
|
5461
|
+
const isCustomAggGroup = hangleBolleanDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
5462
|
+
const isCustomAggFunc = hangleBolleanDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
5463
|
+
return {
|
|
5464
|
+
isCustomAlign,
|
|
5465
|
+
isCustomHeaderAlign,
|
|
5466
|
+
isCustomFooterAlign,
|
|
5467
|
+
isCustomResizable,
|
|
5468
|
+
isCustomVisible,
|
|
5469
|
+
isCustomFixed,
|
|
5470
|
+
isCustomSort,
|
|
5471
|
+
isCustomAggGroup,
|
|
5472
|
+
isCustomAggFunc
|
|
5473
|
+
};
|
|
5474
|
+
}
|
|
5420
5475
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.every.js
|
|
5421
5476
|
var es_iterator_every = __webpack_require__(1148);
|
|
5422
5477
|
;// ./packages/ui/src/vn.ts
|
|
@@ -6152,6 +6207,7 @@ const Cell = {
|
|
|
6152
6207
|
indent,
|
|
6153
6208
|
lazy,
|
|
6154
6209
|
trigger,
|
|
6210
|
+
visibleMethod,
|
|
6155
6211
|
iconLoaded,
|
|
6156
6212
|
showIcon,
|
|
6157
6213
|
iconOpen,
|
|
@@ -6192,7 +6248,7 @@ const Cell = {
|
|
|
6192
6248
|
style: padding && indent ? {
|
|
6193
6249
|
paddingLeft: `${level * indent}px`
|
|
6194
6250
|
} : undefined
|
|
6195
|
-
}, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) ? [h('div', {
|
|
6251
|
+
}, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) && (!visibleMethod || visibleMethod(params)) ? [h('div', {
|
|
6196
6252
|
class: 'vxe-cell--tree-btn',
|
|
6197
6253
|
on: ons
|
|
6198
6254
|
}, [h('i', {
|
|
@@ -7726,13 +7782,13 @@ function getCrossTableDragRowInfo($xeTable) {
|
|
|
7726
7782
|
return crossTableDragRowInfo;
|
|
7727
7783
|
}
|
|
7728
7784
|
;// ./packages/table/src/methods.ts
|
|
7729
|
-
const{warnLog: methods_warnLog,errLog: methods_errLog}=createComponentLog('table');const{getConfig: methods_getConfig,getI18n: methods_getI18n,renderer: methods_renderer,formats: methods_formats,interceptor: methods_interceptor,createEvent,globalEvents: methods_globalEvents,GLOBAL_EVENT_KEYS}=core_.VxeUI;const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;const sourceType='table';let crossTableDragRowObj=null;function eqCellValue(newRow,oldRow,field){const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(newRow,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oldRow,field);let result=false;if(eqEmptyValue(val1)&&eqEmptyValue(val2)){result=true;}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val1)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val1)){result=''+val1===''+val2;}else{result=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);}return{newValue:val1,oldValue:val2,result};}function
|
|
7730
|
-
if(isCustomResizable&&resizableData||isCustomSort&&sortData||isCustomVisible&&visibleData||isCustomFixed&&fixedData||isCustomAggGroup&&aggGroupData||isCustomAggFunc&&aggFuncData){const sortColMaps={};if(isCustomSort&&sortData){// 转换兼容老版本数据,即将废弃兼容
|
|
7785
|
+
const{warnLog: methods_warnLog,errLog: methods_errLog}=createComponentLog('table');const{getConfig: methods_getConfig,getI18n: methods_getI18n,renderer: methods_renderer,formats: methods_formats,interceptor: methods_interceptor,createEvent,globalEvents: methods_globalEvents,GLOBAL_EVENT_KEYS}=core_.VxeUI;const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;const sourceType='table';let crossTableDragRowObj=null;function eqCellValue(newRow,oldRow,field){const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(newRow,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oldRow,field);let result=false;if(eqEmptyValue(val1)&&eqEmptyValue(val2)){result=true;}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val1)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val1)){result=''+val1===''+val2;}else{result=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);}return{newValue:val1,oldValue:val2,result};}function getNextSortOrder($xeTable,column){const sortOpts=$xeTable.computeSortOpts;const{orders=[]}=sortOpts;const currOrder=column.order||null;const oIndex=orders.indexOf(currOrder)+1;return orders[oIndex<orders.length?oIndex:0];}const getCustomStorageMap=id=>{const version=methods_getConfig().version;const rest=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringJSON(localStorage.getItem(customStorageKey)||'');const maps=rest&&rest._v===version?rest:{_v:version};return(id?maps[id]:maps)||{};};const setCustomStorageMap=(id,data)=>{const version=methods_getConfig().version;const maps=getCustomStorageMap();maps[id]=data||undefined;maps._v=version;localStorage.setItem(customStorageKey,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(maps));};const getRecoverRowMaps=($xeTable,keyMaps)=>{const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;const restKeys={};external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(keyMaps,(row,rowid)=>{if(fullAllDataRowIdData[rowid]){restKeys[rowid]=row;}});return restKeys;};function handleReserveRow($xeTable,reserveRowMap){const internalData=$xeTable;const{fullDataRowIdData}=internalData;const reserveList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(reserveRowMap,(item,rowid)=>{if(fullDataRowIdData[rowid]&&reserveList.indexOf(fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;}function handleVirtualXVisible($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=$xeTable.computeLeftFixedWidth;const rightFixedWidth=$xeTable.computeRightFixedWidth;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(bodyScrollElem){const clientWidth=bodyScrollElem.clientWidth;let scrollLeft=bodyScrollElem.scrollLeft;if(isScrollXBig){scrollLeft=Math.ceil((scrollXWidth-clientWidth)*Math.min(1,scrollLeft/(maxXWidth-clientWidth)));}const startLeft=scrollLeft+leftFixedWidth;const endLeft=scrollLeft+clientWidth-rightFixedWidth;let leftIndex=0;let rightIndex=visibleColumn.length;while(leftIndex<rightIndex){const cIndex=Math.floor((leftIndex+rightIndex)/2);const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};if(colRest.oLeft<=startLeft){leftIndex=cIndex+1;}else{rightIndex=cIndex;}}let visibleSize=0;const toVisibleIndex=leftIndex===visibleColumn.length?leftIndex:Math.max(0,leftIndex<visibleColumn.length?leftIndex-2:0);for(let cIndex=toVisibleIndex,cLen=visibleColumn.length;cIndex<cLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};visibleSize++;if(colRest.oLeft>endLeft||visibleSize>=60){break;}}return{toVisibleIndex:Math.max(0,toVisibleIndex),visibleSize:Math.max(6,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};}function handleCustomRestore($xeTable,storeData){const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{aggregateConfig,rowGroupConfig}=props;const{collectColumn}=internalData;const{isCustomAlign,isCustomHeaderAlign,isCustomFooterAlign,isCustomResizable,isCustomVisible,isCustomFixed,isCustomSort,isCustomAggGroup,isCustomAggFunc}=handleCustomStoreConfig($xeTable);let{alignData,headerAlignData,footerAlignData,resizableData,sortData,visibleData,fixedData,aggGroupData,aggFuncData}=storeData;// 处理还原
|
|
7786
|
+
if(isCustomAlign&&alignData||isCustomHeaderAlign&&headerAlignData||isCustomFooterAlign&&footerAlignData||isCustomResizable&&resizableData||isCustomSort&&sortData||isCustomVisible&&visibleData||isCustomFixed&&fixedData||isCustomAggGroup&&aggGroupData||isCustomAggFunc&&aggFuncData){const sortColMaps={};if(isCustomSort&&sortData){// 转换兼容老版本数据,即将废弃兼容
|
|
7731
7787
|
if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortData)){const sortRests=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(sortData,(index,colKey)=>{sortRests.push({key:colKey,index});});sortData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(sortRests,{field:'index',order:'asc'}).map(item=>({k:item.key}));}let colNum=1;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sortData,(sObj,index,sOjs,path,pSObj)=>{sortColMaps[sObj.k]={key:sObj.k,sNum:colNum++,pKey:pSObj?pSObj.k:null};},{children:'c'});}const colKeyMaps={};const allCols=[];const aggGroupConfs=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();// 支持一级
|
|
7732
7788
|
if(!parentColumn){if(isCustomFixed&&fixedData&&fixedData[colKey]!==undefined){column.fixed=fixedData[colKey];}}if(isCustomResizable&&resizableData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])){column.resizeWidth=resizableData[colKey];}if(isCustomVisible&&visibleData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])){column.visible=visibleData[colKey];}if(isCustomAggFunc&&aggFuncData&&(aggregateConfig||rowGroupConfig)&&aggFuncData[colKey]){column.aggFunc=aggFuncData[colKey];}if(isCustomAggGroup&&aggGroupData&&aggGroupData[colKey]){aggGroupConfs.push({field:column.field});}colKeyMaps[colKey]=column;allCols.push(column);});if((aggregateConfig||rowGroupConfig)&&aggGroupConfs.length){const groupRest=handleGroupData($xeTable,internalData.tableFullData,aggGroupConfs);internalData.tableFullTreeData=[];internalData.tableFullGroupData=groupRest.treeData;reactData.isRowGroupStatus=true;reactData.rowGroupList=aggGroupConfs;$xeTable.cacheRowMap(false);}// 如果自定义了顺序
|
|
7733
7789
|
if(isCustomSort&&sortData){allCols.forEach(column=>{const colKey=column.getKey();const scItem=sortColMaps[colKey];if(scItem){const parentColumn=scItem.pKey?colKeyMaps[scItem.pKey]:null;column.parentId=parentColumn?parentColumn.id:null;column.renderSortNumber=scItem.sNum;}});const newCollectCols=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(allCols,'renderSortNumber'),{key:'id',parentKey:'parentId',children:'children'});internalData.collectColumn=newCollectCols;internalData.tableFullColumn=getColumnList(newCollectCols);reactData.updateColFlag++;}reactData.isCustomStatus=true;}else{reactData.isCustomStatus=false;}}/**
|
|
7734
7790
|
* 还原自定义列操作状态
|
|
7735
|
-
*/function restoreCustomStorage($xeTable){const props=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;const{storage,restoreStore
|
|
7791
|
+
*/function restoreCustomStorage($xeTable){const props=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;const{storage,restoreStore}=customOpts;const{isCustomAlign,isCustomHeaderAlign,isCustomFooterAlign,isCustomResizable,isCustomVisible,isCustomFixed,isCustomSort,isCustomAggGroup,isCustomAggFunc}=handleCustomStoreConfig($xeTable);if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomAlign||isCustomHeaderAlign||isCustomFooterAlign||isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort||isCustomAggGroup||isCustomAggFunc)){if(!tableId){methods_errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore($xeTable,storeData);}).catch(e=>e);}else{return handleCustomRestore($xeTable,storeData);}}}/**
|
|
7736
7792
|
* 更新数据列的 Map
|
|
7737
7793
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
7738
7794
|
*/function cacheColumnMap($xeTable){const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig,showOverflow}=props;const{tableFullColumn,collectColumn}=internalData;const fullColIdData=internalData.fullColumnIdData={};const fullColFieldData=internalData.fullColumnFieldData={};const mouseOpts=$xeTable.computeMouseOpts;const expandOpts=$xeTable.computeExpandOpts;const columnOpts=$xeTable.computeColumnOpts;const columnDragOpts=$xeTable.computeColumnDragOpts;const virtualYOpts=$xeTable.computeVirtualYOpts;const{isCrossDrag,isSelfToChildDrag}=columnDragOpts;const customOpts=$xeTable.computeCustomOpts;const treeOpts=$xeTable.computeTreeOpts;const{storage}=customOpts;const rowOpts=$xeTable.computeRowOpts;const isGroup=collectColumn.some(hasChildrenList);let isAllOverflow=!!showOverflow;let rowGroupColumn;let expandColumn;let treeNodeColumn;let checkboxColumn;let radioColumn;let htmlColumn;let hasFixed;const handleFunc=(column,index,items,path,parentColumn)=>{const{id:colid,field,fixed,type,treeNode,rowGroupNode}=column;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};if(field){if(fullColFieldData[field]){methods_errLog('vxe.error.colRepet',['field',field]);}fullColFieldData[field]=rest;}else{if(storage&&!type){methods_errLog('vxe.error.reqSupportProp',['storage',`[${type?`type=${type}`:`title=${column.getTitle()}`}]field=?`]);}if(columnOpts.drag&&(isCrossDrag||isSelfToChildDrag)){methods_errLog('vxe.error.reqSupportProp',['column-drag-config.isCrossDrag | column-drag-config.isSelfToChildDrag',`${column.getTitle()||type||''} -> field=?`]);}}if(!hasFixed&&fixed){hasFixed=fixed;}if(!htmlColumn&&type==='html'){htmlColumn=column;}if(treeNode){if(treeNodeColumn){methods_warnLog('vxe.error.colRepet',['tree-node',treeNode]);}if(!treeNodeColumn){treeNodeColumn=column;}}if(rowGroupNode){if(treeNodeColumn){methods_warnLog('vxe.error.colRepet',['row-group-node',rowGroupNode]);}if(!rowGroupColumn){rowGroupColumn=column;}}if(type==='expand'){if(expandColumn){methods_warnLog('vxe.error.colRepet',['type',type]);}if(!expandColumn){expandColumn=column;}}if(type==='checkbox'){if(checkboxColumn){methods_warnLog('vxe.error.colRepet',['type',type]);}if(!checkboxColumn){checkboxColumn=column;}}else if(type==='radio'){if(radioColumn){methods_warnLog('vxe.error.colRepet',['type',type]);}if(!radioColumn){radioColumn=column;}}if(isAllOverflow&&column.showOverflow===false){isAllOverflow=false;}if(fullColIdData[colid]){methods_errLog('vxe.error.colRepet',['colId',colid]);}fullColIdData[colid]=rest;};if(isGroup){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn,nodes)=>{column.level=nodes.length;handleFunc(column,index,items,path,parentColumn);});}else{tableFullColumn.forEach(handleFunc);}if(expandColumn){if(expandOpts.mode!=='fixed'&&virtualYOpts.enabled){methods_warnLog('vxe.error.notConflictProp',['column.type="expand','virtual-y-config.enabled=false']);}if(expandOpts.mode!=='fixed'&&mouseOpts.area){methods_errLog('vxe.error.errConflicts',['mouse-config.area','column.type=expand']);}if(expandOpts.mode!=='inside'&&treeConfig&&!treeOpts.transform){methods_errLog('vxe.error.notConflictProp',['tree-config.transform=false','expand-config.mode=inside']);}// if (props.spanMethod) {
|
|
@@ -7745,7 +7801,7 @@ let scrollYLoad=!!virtualYOpts.enabled&&virtualYOpts.gt>-1&&(virtualYOpts.gt===0
|
|
|
7745
7801
|
* @param rows
|
|
7746
7802
|
* @param expanded
|
|
7747
7803
|
* @returns
|
|
7748
|
-
*/function handleBaseTreeExpand($xeTable,rows,expanded){const reactData=$xeTable;const internalData=$xeTable;const{treeNodeColumn}=reactData;const{fullAllDataRowIdData,tableFullTreeData,treeExpandedMaps,treeExpandLazyLoadedMaps}=internalData;const treeOpts=$xeTable.computeTreeOpts;const{reserve,lazy,accordion,toggleMethod}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;const result=[];const columnIndex=$xeTable.getColumnIndex(treeNodeColumn);const $columnIndex=$xeTable.getVMColumnIndex(treeNodeColumn);const{handleGetRowId}=createHandleGetRowId($xeTable);let validRows=toggleMethod?rows.filter(row=>toggleMethod({$table:$xeTable,expanded,column:treeNodeColumn,columnIndex,$columnIndex,row})):rows;if(accordion){validRows=validRows.length?[validRows[validRows.length-1]]:[];// 同一级只能展开一个
|
|
7804
|
+
*/function handleBaseTreeExpand($xeTable,rows,expanded){const reactData=$xeTable;const internalData=$xeTable;const{treeNodeColumn}=reactData;const{fullAllDataRowIdData,tableFullTreeData,treeExpandedMaps,treeExpandLazyLoadedMaps}=internalData;const treeOpts=$xeTable.computeTreeOpts;const{reserve,lazy,accordion,toggleMethod}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;const result=[];const columnIndex=$xeTable.getColumnIndex(treeNodeColumn);const $columnIndex=$xeTable.getVMColumnIndex(treeNodeColumn);const _columnIndex=$xeTable.getVTColumnIndex(treeNodeColumn);const{handleGetRowId}=createHandleGetRowId($xeTable);let validRows=toggleMethod?rows.filter(row=>toggleMethod({$table:$xeTable,expanded,column:treeNodeColumn,columnIndex,$columnIndex,_columnIndex,row})):rows;if(accordion){validRows=validRows.length?[validRows[validRows.length-1]]:[];// 同一级只能展开一个
|
|
7749
7805
|
const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData,item=>item===validRows[0],{children:childrenField});if(matchObj){matchObj.items.forEach(item=>{const rowid=handleGetRowId(item);if(treeExpandedMaps[rowid]){delete treeExpandedMaps[rowid];}});}}if(expanded){validRows.forEach(row=>{const rowid=handleGetRowId(row);if(!treeExpandedMaps[rowid]){const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const isLoad=lazy&&row[hasChildField]&&!rowRest.treeLoaded&&!treeExpandLazyLoadedMaps[rowid];// 是否使用懒加载
|
|
7750
7806
|
if(isLoad){result.push(handleAsyncTreeExpandChilds($xeTable,row));}else{if(row[childrenField]&&row[childrenField].length){treeExpandedMaps[rowid]=row;}}}}});}else{validRows.forEach(item=>{const rowid=handleGetRowId(item);if(treeExpandedMaps[rowid]){delete treeExpandedMaps[rowid];}});}if(reserve){validRows.forEach(row=>handleTreeExpandReserve($xeTable,row,expanded));}reactData.treeExpandedFlag++;return Promise.all(result).then(()=>{updateTreeLineStyle($xeTable);return $xeTable.recalculate();});}/**
|
|
7751
7807
|
* 虚拟树的展开与收起
|
|
@@ -8177,20 +8233,21 @@ if(!targetColumn.fixed&&isMaxFixedColumn){if(core_.VxeUI.modal){core_.VxeUI.moda
|
|
|
8177
8233
|
* @private
|
|
8178
8234
|
*/handleCustom(){const $xeTable=this;const props=$xeTable;const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}$xeTable.analyColumnWidth();return $xeTable.refreshColumn(true);},/**
|
|
8179
8235
|
* 还原自定义列操作状态
|
|
8180
|
-
*/restoreCustomStorage(){const $xeTable=this;const props=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;const{storage,restoreStore
|
|
8236
|
+
*/restoreCustomStorage(){const $xeTable=this;const props=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;const{storage,restoreStore}=customOpts;const{isCustomAlign,isCustomHeaderAlign,isCustomFooterAlign,isCustomResizable,isCustomVisible,isCustomFixed,isCustomSort,isCustomAggGroup,isCustomAggFunc}=handleCustomStoreConfig($xeTable);if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomAlign||isCustomHeaderAlign||isCustomFooterAlign||isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort||isCustomAggGroup||isCustomAggFunc)){if(!tableId){methods_errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore($xeTable,storeData);}).catch(e=>e);}else{return handleCustomRestore($xeTable,storeData);}}},/**
|
|
8181
8237
|
* 用于 custom-config,用于手动恢复自定义列设置信息,恢复表格重置为初始状态
|
|
8182
8238
|
* @param storeData
|
|
8183
8239
|
* @returns
|
|
8184
8240
|
*/setCustomStoreData(storeData){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;if(!storeData){return $xeTable.$nextTick();}const customOpts=$xeTable.computeCustomOpts;const{checkMethod}=customOpts;// 重置状态
|
|
8185
8241
|
clearTableAllStatus($xeTable);// 恢复列
|
|
8186
|
-
const allCols=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.collectColumn,column=>{column.resizeWidth=0;column.fixed=column.defaultFixed;column.renderSortNumber=column.sortNumber;column.parentId=column.defaultParentId;if(!checkMethod||checkMethod({$table:$xeTable,column})){column.visible=column.defaultVisible;}column.aggFunc=column.defaultAggFunc;column.renderAggFn=column.defaultAggFunc;column.renderResizeWidth=column.renderWidth;allCols.push(column);});const newCollectCols=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(allCols,'renderSortNumber'),{key:'id',parentKey:'parentId',children:'children'});internalData.collectColumn=newCollectCols;internalData.tableFullColumn=getColumnList(newCollectCols);reactData.updateColFlag++;reactData.isColLoading=true;initColumnHierarchy($xeTable);return Promise.resolve(handleCustomRestore($xeTable,storeData)).then(()=>{return buildColumnInfo($xeTable);}).then(()=>{// 恢复数据聚合分组
|
|
8242
|
+
const allCols=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.collectColumn,column=>{column.resizeWidth=0;column.fixed=column.defaultFixed;column.renderSortNumber=column.sortNumber;column.parentId=column.defaultParentId;if(!checkMethod||checkMethod({$table:$xeTable,column})){column.visible=column.defaultVisible;}column.align=column.defaultAlign;column.headerAlign=column.defaultHeaderAlign;column.footerAlign=column.defaultFooterAlign;column.aggFunc=column.defaultAggFunc;column.renderAggFn=column.defaultAggFunc;column.renderResizeWidth=column.renderWidth;allCols.push(column);});const newCollectCols=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(allCols,'renderSortNumber'),{key:'id',parentKey:'parentId',children:'children'});internalData.collectColumn=newCollectCols;internalData.tableFullColumn=getColumnList(newCollectCols);reactData.updateColFlag++;reactData.isColLoading=true;initColumnHierarchy($xeTable);return Promise.resolve(handleCustomRestore($xeTable,storeData)).then(()=>{return buildColumnInfo($xeTable);}).then(()=>{// 恢复数据聚合分组
|
|
8187
8243
|
const{isRowGroupStatus,rowGroupList}=reactData;if(isRowGroupStatus&&!!$xeTable.handlePivotTableAggData){const rowGroupFields=$xeTable.computeRowGroupFields;if(rowGroupFields?rowGroupFields.length:rowGroupList.length){if(rowGroupFields&&rowGroupFields.length){$xeTable.setRowGroups(rowGroupFields);}else{$xeTable.clearRowGroups();}}else{$xeTable.handleUpdateAggData();}}});},/**
|
|
8188
8244
|
* 用于 custom-config,用于获取自定义列设置信息,用于自定义保持
|
|
8189
8245
|
* @returns
|
|
8190
|
-
*/getCustomStoreData(){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{id}=props;const customOpts=$xeTable.computeCustomOpts;const{isRowGroupStatus,rowGroupList}=reactData;const{fullColumnFieldData,collectColumn}=internalData;const{storage,checkMethod
|
|
8191
|
-
if(isCustomFixed&&(column.fixed||'')!==(column.defaultFixed||'')){hasFixed=1;fixedData[colKey]=column.fixed;}}if(isCustomResizable&&column.resizeWidth){hasResizable=1;resizableData[colKey]=column.renderWidth;}if(isCustomVisible&&(!checkMethod||checkMethod({$table:$xeTable,column}))){if(!column.visible&&column.defaultVisible){hasVisible=1;visibleData[colKey]=false;}else if(column.visible&&!column.defaultVisible){hasVisible=1;visibleData[colKey]=true;}}if(isCustomAggFunc&&(column.aggFunc||'')!==(column.defaultAggFunc||'')){hasAggFunc=1;aggFuncData[colKey]=column.aggFunc;}});if(hasResizable){storeData.resizableData=resizableData;}if(hasSort){storeData.sortData=sortData;}if(hasFixed){storeData.fixedData=fixedData;}if(hasVisible){storeData.visibleData=visibleData;}if(isCustomAggGroup&&isRowGroupStatus){rowGroupList.forEach(aggConf=>{const colRest=fullColumnFieldData[aggConf.field];if(colRest){aggGroupData[colRest.column.getKey()]=true;}});storeData.aggGroupData=aggGroupData;}if(hasAggFunc){storeData.aggFuncData=aggFuncData;}return storeData;},/**
|
|
8246
|
+
*/getCustomStoreData(){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{id}=props;const customOpts=$xeTable.computeCustomOpts;const{isRowGroupStatus,rowGroupList}=reactData;const{fullColumnFieldData,collectColumn}=internalData;const{storage,checkMethod}=customOpts;const{isCustomAlign,isCustomHeaderAlign,isCustomFooterAlign,isCustomResizable,isCustomVisible,isCustomFixed,isCustomSort,isCustomAggGroup,isCustomAggFunc}=handleCustomStoreConfig($xeTable);const alignData={};const headerAlignData={};const footerAlignData={};const resizableData={};const sortData=[];const visibleData={};const fixedData={};const aggGroupData={};const aggFuncData={};const storeData={alignData:undefined,headerAlignData:undefined,footerAlignData:undefined,resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined,aggGroupData:undefined,aggFuncData:undefined};if(!id){if(storage){methods_errLog('vxe.error.reqProp',['id']);}return storeData;}let hasAlign=0;let hasHeaderAlign=0;let hasFooterAlign=0;let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;let hasAggFunc=0;const sortMaps={};external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();if(!colKey){methods_errLog('vxe.error.reqProp',[`${column.getTitle()||column.type||''} -> column.field=?`]);return;}if(parentColumn){if(isCustomSort){const pColKey=parentColumn.getKey();const psObj=sortMaps[pColKey];hasSort=1;if(psObj){const sObj={k:colKey};sortMaps[colKey]=sObj;if(!psObj.c){psObj.c=[];}psObj.c.push(sObj);}}}else{if(isCustomSort){hasSort=1;const sObj={k:colKey};sortMaps[colKey]=sObj;sortData.push(sObj);}// 只支持一级
|
|
8247
|
+
if(isCustomFixed&&(column.fixed||'')!==(column.defaultFixed||'')){hasFixed=1;fixedData[colKey]=column.fixed;}}if(isCustomAlign&&column.align){hasAlign=1;alignData[colKey]=column.align;}if(isCustomHeaderAlign&&column.headerAlign){hasHeaderAlign=1;headerAlignData[colKey]=column.headerAlign;}if(isCustomFooterAlign&&column.footerAlign){hasFooterAlign=1;footerAlignData[colKey]=column.footerAlign;}if(isCustomResizable&&column.resizeWidth){hasResizable=1;resizableData[colKey]=column.renderWidth;}if(isCustomVisible&&(!checkMethod||checkMethod({$table:$xeTable,column}))){if(!column.visible&&column.defaultVisible){hasVisible=1;visibleData[colKey]=false;}else if(column.visible&&!column.defaultVisible){hasVisible=1;visibleData[colKey]=true;}}if(isCustomAggFunc&&(column.aggFunc||'')!==(column.defaultAggFunc||'')){hasAggFunc=1;aggFuncData[colKey]=column.aggFunc;}});if(hasAlign){storeData.alignData=alignData;}if(hasHeaderAlign){storeData.headerAlignData=headerAlignData;}if(hasFooterAlign){storeData.footerAlignData=footerAlignData;}if(hasResizable){storeData.resizableData=resizableData;}if(hasSort){storeData.sortData=sortData;}if(hasFixed){storeData.fixedData=fixedData;}if(hasVisible){storeData.visibleData=visibleData;}if(isCustomAggGroup&&isRowGroupStatus){rowGroupList.forEach(aggConf=>{const colRest=fullColumnFieldData[aggConf.field];if(colRest){aggGroupData[colRest.column.getKey()]=true;}});storeData.aggGroupData=aggGroupData;}if(hasAggFunc){storeData.aggFuncData=aggFuncData;}return storeData;},/**
|
|
8192
8248
|
* @private
|
|
8193
|
-
*/saveCustomStore(type){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;const{updateStore,storage
|
|
8249
|
+
*/saveCustomStore(type){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;const{updateStore,storage}=customOpts;const{isCustomAlign,isCustomHeaderAlign,isCustomFooterAlign,isCustomResizable,isCustomVisible,isCustomFixed,isCustomSort,isCustomAggGroup,isCustomAggFunc}=handleCustomStoreConfig($xeTable);if(type!=='reset'){// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
8250
|
+
reactData.isCustomStatus=true;}if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomAlign||isCustomHeaderAlign||isCustomFooterAlign||isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort||isCustomAggGroup||isCustomAggFunc)){if(!tableId){methods_errLog('vxe.error.reqProp',['id']);return $xeTable.$nextTick();}const storeData=type==='reset'?{alignData:{},headerAlignData:{},footerAlignData:{},resizableData:{},sortData:[],visibleData:{},fixedData:{},aggGroupData:{},aggFuncData:{}}:$xeTable.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return $xeTable.$nextTick();},handleUpdateDataQueue(){const $xeTable=this;const reactData=$xeTable;reactData.upDataFlag++;},handleRefreshColumnQueue(){const $xeTable=this;const reactData=$xeTable;reactData.reColumnFlag++;},handleFilterOptions(column){const $xeTable=this;const reactData=$xeTable;if(column){const{filterStore}=reactData;const{filterRender,filters}=column;const filterOptions=filters||[];const compConf=isEnableConf(filterRender)?methods_renderer.get(filterRender.name):null;const frMethod=column.filterRecoverMethod||(compConf?compConf.tableFilterRecoverMethod||compConf.filterRecoverMethod:null);filterStore.column=column;// 复原状态
|
|
8194
8251
|
filterOptions.forEach(option=>{const{_checked,checked}=option;option._checked=checked;if(!checked&&_checked!==checked){if(frMethod){frMethod({option,column,$table:$xeTable});}}});$xeTable.checkFilterOptions();}},/**
|
|
8195
8252
|
* 刷新列配置
|
|
8196
8253
|
*/refreshColumn(initSort){const $xeTable=this;if(initSort){handleUpdateColumn($xeTable);}return parseColumns($xeTable,true).then(()=>{return this.refreshScroll();}).then(()=>{return handleLazyRecalculate($xeTable,false,true,true);});},/**
|
|
@@ -11075,6 +11132,25 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
11075
11132
|
}, evnt);
|
|
11076
11133
|
}
|
|
11077
11134
|
},
|
|
11135
|
+
changeAlignOption(column, targetAlign, colProperty, renderProperty, eName, evnt) {
|
|
11136
|
+
const $xeTableCustomPanel = this;
|
|
11137
|
+
const $xeTable = $xeTableCustomPanel.$xeTable;
|
|
11138
|
+
const tableReactData = $xeTable;
|
|
11139
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
11140
|
+
if (customOpts.immediate) {
|
|
11141
|
+
column[colProperty] = targetAlign;
|
|
11142
|
+
column[renderProperty] = targetAlign;
|
|
11143
|
+
tableReactData.isCustomStatus = true;
|
|
11144
|
+
$xeTable.handleCustom();
|
|
11145
|
+
$xeTable.saveCustomStore(`update:${colProperty}`);
|
|
11146
|
+
} else {
|
|
11147
|
+
column[renderProperty] = targetAlign;
|
|
11148
|
+
}
|
|
11149
|
+
$xeTable.dispatchEvent(eName, {
|
|
11150
|
+
column,
|
|
11151
|
+
[colProperty]: targetAlign
|
|
11152
|
+
}, evnt);
|
|
11153
|
+
},
|
|
11078
11154
|
allOptionEvent(evnt) {
|
|
11079
11155
|
const $xeTableCustomPanel = this;
|
|
11080
11156
|
const $xeTable = $xeTableCustomPanel.$xeTable;
|
|
@@ -11589,7 +11665,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
11589
11665
|
const customOpts = $xeTable.computeCustomOpts;
|
|
11590
11666
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
11591
11667
|
const {
|
|
11592
|
-
|
|
11668
|
+
defPopupStyle
|
|
11593
11669
|
} = customStore;
|
|
11594
11670
|
const {
|
|
11595
11671
|
immediate,
|
|
@@ -11765,7 +11841,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
11765
11841
|
}
|
|
11766
11842
|
}) : panel_renderEmptyElement($xeTable)] : []) : panel_renderEmptyElement($xeTable), !parentItem && allowFixed ? h('div', {
|
|
11767
11843
|
class: 'vxe-table-custom--fixed-option'
|
|
11768
|
-
}, [h(VxeUIButtonComponent, {
|
|
11844
|
+
}, VxeUIButtonComponent ? [h(VxeUIButtonComponent, {
|
|
11769
11845
|
props: {
|
|
11770
11846
|
mode: 'text',
|
|
11771
11847
|
icon: column.renderFixed === 'left' ? panel_getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : panel_getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
|
|
@@ -11795,7 +11871,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
11795
11871
|
$xeTableCustomPanel.changeFixedOption(column, 'right', $event);
|
|
11796
11872
|
}
|
|
11797
11873
|
}
|
|
11798
|
-
})]) : panel_renderEmptyElement($xeTable)]));
|
|
11874
|
+
})] : []) : panel_renderEmptyElement($xeTable)]));
|
|
11799
11875
|
}
|
|
11800
11876
|
});
|
|
11801
11877
|
return h('div', {
|
|
@@ -11805,7 +11881,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
11805
11881
|
[`size--${vSize}`]: vSize,
|
|
11806
11882
|
'is--active': customStore.visible
|
|
11807
11883
|
}],
|
|
11808
|
-
style:
|
|
11884
|
+
style: defPopupStyle
|
|
11809
11885
|
}, customStore.visible ? [h('div', {
|
|
11810
11886
|
ref: 'refBodyWrapperElem',
|
|
11811
11887
|
class: 'vxe-table-custom-simple--body-wrapper'
|
|
@@ -11894,48 +11970,33 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
11894
11970
|
}
|
|
11895
11971
|
})])]) : null]), $xeTableCustomPanel.renderDragTip(h)])] : []);
|
|
11896
11972
|
},
|
|
11897
|
-
|
|
11898
|
-
const VxeUIModalComponent = core_.VxeUI.getComponent('VxeModal');
|
|
11899
|
-
const VxeUIDrawerComponent = core_.VxeUI.getComponent('VxeDrawer');
|
|
11973
|
+
renderPopupBodys(h) {
|
|
11900
11974
|
const VxeUIButtonComponent = core_.VxeUI.getComponent('VxeButton');
|
|
11901
11975
|
const VxeUINumberInputComponent = core_.VxeUI.getComponent('VxeNumberInput');
|
|
11976
|
+
const VxeUIRadioGroupComponent = core_.VxeUI.getComponent('VxeRadioGroup');
|
|
11902
11977
|
const $xeTableCustomPanel = this;
|
|
11903
|
-
const props = $xeTableCustomPanel;
|
|
11904
11978
|
const $xeTable = $xeTableCustomPanel.$xeTable;
|
|
11905
11979
|
const tableProps = $xeTable;
|
|
11906
11980
|
const tableReactData = $xeTable;
|
|
11907
|
-
const $xeGrid = $xeTable.$xeGrid;
|
|
11908
|
-
const $xeGantt = $xeTable.$xeGantt;
|
|
11909
|
-
const {
|
|
11910
|
-
customStore
|
|
11911
|
-
} = props;
|
|
11912
11981
|
const {
|
|
11913
|
-
treeConfig,
|
|
11914
|
-
rowGroupConfig,
|
|
11915
|
-
aggregateConfig,
|
|
11916
11982
|
resizable: allResizable
|
|
11917
11983
|
} = tableProps;
|
|
11918
11984
|
const {
|
|
11919
|
-
isCustomStatus,
|
|
11920
11985
|
customColumnList
|
|
11921
11986
|
} = tableReactData;
|
|
11922
11987
|
const customOpts = $xeTable.computeCustomOpts;
|
|
11923
11988
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
11924
|
-
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
11925
11989
|
const {
|
|
11926
|
-
placement: aggPlacement
|
|
11927
|
-
} = aggregateOpts;
|
|
11928
|
-
const {
|
|
11929
|
-
mode,
|
|
11930
11990
|
immediate,
|
|
11931
11991
|
showSortDragButton,
|
|
11932
11992
|
showSortMoveButton,
|
|
11933
11993
|
showSortPutButton,
|
|
11934
|
-
modalOptions,
|
|
11935
|
-
drawerOptions,
|
|
11936
11994
|
allowVisible,
|
|
11937
11995
|
allowSort,
|
|
11938
11996
|
allowFixed,
|
|
11997
|
+
allowAlign,
|
|
11998
|
+
allowHeaderAlign,
|
|
11999
|
+
allowFooterAlign,
|
|
11939
12000
|
allowResizable,
|
|
11940
12001
|
allowGroup,
|
|
11941
12002
|
allowValues,
|
|
@@ -11943,40 +12004,17 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
11943
12004
|
visibleMethod
|
|
11944
12005
|
} = customOpts;
|
|
11945
12006
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
11946
|
-
const {
|
|
11947
|
-
maxFixedSize
|
|
11948
|
-
} = columnOpts;
|
|
11949
12007
|
const resizableOpts = $xeTable.computeResizableOpts;
|
|
11950
12008
|
const {
|
|
11951
12009
|
minWidth: reMinWidth,
|
|
11952
12010
|
maxWidth: reMaxWidth
|
|
11953
12011
|
} = resizableOpts;
|
|
11954
|
-
const modalOpts = Object.assign({}, modalOptions);
|
|
11955
|
-
const drawerOpts = Object.assign({}, drawerOptions);
|
|
11956
12012
|
const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
|
|
11957
12013
|
const {
|
|
11958
12014
|
isCrossDrag,
|
|
11959
12015
|
isPeerDrag
|
|
11960
12016
|
} = columnDragOpts;
|
|
11961
|
-
const slots = customOpts.slots || {};
|
|
11962
|
-
const headerSlot = slots.header;
|
|
11963
|
-
const topSlot = slots.top;
|
|
11964
|
-
const bottomSlot = slots.bottom;
|
|
11965
|
-
const defaultSlot = slots.default;
|
|
11966
|
-
const footerSlot = slots.footer;
|
|
11967
12017
|
const trVNs = [];
|
|
11968
|
-
const isAllChecked = customStore.isAll;
|
|
11969
|
-
const isAllIndeterminate = customStore.isIndeterminate;
|
|
11970
|
-
const isAggRtBmLayout = aggPlacement === 'right' || aggPlacement === 'bottom';
|
|
11971
|
-
const params = {
|
|
11972
|
-
$table: $xeTable,
|
|
11973
|
-
$grid: $xeGrid,
|
|
11974
|
-
$gantt: $xeGantt,
|
|
11975
|
-
columns: customColumnList,
|
|
11976
|
-
isAllChecked,
|
|
11977
|
-
isAllIndeterminate,
|
|
11978
|
-
isCustomStatus
|
|
11979
|
-
};
|
|
11980
12018
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parentItem) => {
|
|
11981
12019
|
const isVisible = visibleMethod ? visibleMethod({
|
|
11982
12020
|
$table: $xeTable,
|
|
@@ -12014,41 +12052,50 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12014
12052
|
}) : false;
|
|
12015
12053
|
const isHidden = !isChecked;
|
|
12016
12054
|
const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
}
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12036
|
-
'
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12055
|
+
const alignList = [{
|
|
12056
|
+
icon: panel_getIcon().TABLE_CUSTOM_ALIGN_LEFT,
|
|
12057
|
+
value: 'left',
|
|
12058
|
+
title: panel_getI18n('vxe.custom.setting.anLeftTitle'),
|
|
12059
|
+
disabled: isHidden
|
|
12060
|
+
}, {
|
|
12061
|
+
icon: panel_getIcon().TABLE_CUSTOM_ALIGN_CENTER,
|
|
12062
|
+
value: 'center',
|
|
12063
|
+
title: panel_getI18n('vxe.custom.setting.anCenterTitle'),
|
|
12064
|
+
disabled: isHidden
|
|
12065
|
+
}, {
|
|
12066
|
+
icon: panel_getIcon().TABLE_CUSTOM_ALIGN_RIGHT,
|
|
12067
|
+
value: 'right',
|
|
12068
|
+
title: panel_getI18n('vxe.custom.setting.anRightTitle'),
|
|
12069
|
+
disabled: isHidden
|
|
12070
|
+
}];
|
|
12071
|
+
const tdVNs = [];
|
|
12072
|
+
if (allowVisible) {
|
|
12073
|
+
tdVNs.push(h('td', {
|
|
12074
|
+
key: 'av',
|
|
12075
|
+
class: 'vxe-table-custom-popup--column-td col--visible'
|
|
12076
|
+
}, [h('div', {
|
|
12077
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
12078
|
+
'is--checked': isChecked,
|
|
12079
|
+
'is--indeterminate': isIndeterminate,
|
|
12080
|
+
'is--disabled': isDisabled
|
|
12081
|
+
}],
|
|
12082
|
+
attrs: {
|
|
12083
|
+
title: panel_getI18n('vxe.custom.setting.colVisible')
|
|
12084
|
+
},
|
|
12085
|
+
on: {
|
|
12086
|
+
click: evnt => {
|
|
12087
|
+
if (!isDisabled) {
|
|
12088
|
+
$xeTableCustomPanel.changeCheckboxOption(column, evnt);
|
|
12089
|
+
}
|
|
12045
12090
|
}
|
|
12046
12091
|
}
|
|
12047
|
-
}
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
}
|
|
12051
|
-
|
|
12092
|
+
}, [h('span', {
|
|
12093
|
+
class: ['vxe-checkbox--icon', isIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
12094
|
+
})])]));
|
|
12095
|
+
}
|
|
12096
|
+
tdVNs.push(h('td', {
|
|
12097
|
+
key: 'at',
|
|
12098
|
+
class: 'vxe-table-custom-popup--column-td col--name'
|
|
12052
12099
|
}, [h('div', {
|
|
12053
12100
|
class: 'vxe-table-custom-popup--name'
|
|
12054
12101
|
}, [allowSort && showSortDragButton || allowGroup || allowValues ? showSortBtn || (allowGroup || allowValues) && !isColGroup ? h('div', {
|
|
@@ -12083,7 +12130,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12083
12130
|
}, VxeUIButtonComponent ? [showSortMoveButton ? h(VxeUIButtonComponent, {
|
|
12084
12131
|
props: {
|
|
12085
12132
|
mode: 'text',
|
|
12086
|
-
|
|
12133
|
+
icon: 'vxe-icon-arrows-up',
|
|
12087
12134
|
title: panel_getI18n('vxe.custom.setting.moveUpTitle'),
|
|
12088
12135
|
disabled: index <= 0
|
|
12089
12136
|
},
|
|
@@ -12095,7 +12142,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12095
12142
|
}) : panel_renderEmptyElement($xeTable), showSortMoveButton ? h(VxeUIButtonComponent, {
|
|
12096
12143
|
props: {
|
|
12097
12144
|
mode: 'text',
|
|
12098
|
-
|
|
12145
|
+
icon: 'vxe-icon-arrows-down',
|
|
12099
12146
|
title: panel_getI18n('vxe.custom.setting.moveDnTitle'),
|
|
12100
12147
|
disabled: index >= items.length - 1
|
|
12101
12148
|
},
|
|
@@ -12107,7 +12154,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12107
12154
|
}) : panel_renderEmptyElement($xeTable), showSortPutButton && !parentItem ? h(VxeUIButtonComponent, {
|
|
12108
12155
|
props: {
|
|
12109
12156
|
mode: 'text',
|
|
12110
|
-
|
|
12157
|
+
icon: 'vxe-icon-top',
|
|
12111
12158
|
title: panel_getI18n('vxe.custom.setting.putTopTitle'),
|
|
12112
12159
|
disabled: index <= 0
|
|
12113
12160
|
},
|
|
@@ -12119,7 +12166,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12119
12166
|
}) : panel_renderEmptyElement($xeTable), showSortPutButton && !parentItem ? h(VxeUIButtonComponent, {
|
|
12120
12167
|
props: {
|
|
12121
12168
|
mode: 'text',
|
|
12122
|
-
|
|
12169
|
+
icon: 'vxe-icon-bottom',
|
|
12123
12170
|
title: panel_getI18n('vxe.custom.setting.putBottomTitle'),
|
|
12124
12171
|
disabled: index >= items.length - 1
|
|
12125
12172
|
},
|
|
@@ -12128,63 +12175,312 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12128
12175
|
$xeTableCustomPanel.sortMoveBottomEvent(evntParame, column);
|
|
12129
12176
|
}
|
|
12130
12177
|
}
|
|
12131
|
-
}) : panel_renderEmptyElement($xeTable)] : []) : panel_renderEmptyElement($xeTable)])])
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
|
|
12136
|
-
|
|
12137
|
-
|
|
12138
|
-
|
|
12139
|
-
|
|
12140
|
-
|
|
12141
|
-
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
column.renderResizeWidth = Math.max(0, Number(value));
|
|
12178
|
+
}) : panel_renderEmptyElement($xeTable)] : []) : panel_renderEmptyElement($xeTable)])]));
|
|
12179
|
+
if (allowResizable) {
|
|
12180
|
+
tdVNs.push(h('td', {
|
|
12181
|
+
key: 'aw',
|
|
12182
|
+
class: 'vxe-table-custom-popup--column-td col--resizable'
|
|
12183
|
+
}, [column.children && column.children.length || !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h('span', '-') : VxeUINumberInputComponent ? h(VxeUINumberInputComponent, {
|
|
12184
|
+
props: {
|
|
12185
|
+
type: 'integer',
|
|
12186
|
+
immediate: false,
|
|
12187
|
+
disabled: isHidden,
|
|
12188
|
+
value: column.renderResizeWidth,
|
|
12189
|
+
min: customMinWidth || undefined,
|
|
12190
|
+
max: customMaxWidth || undefined
|
|
12145
12191
|
},
|
|
12146
|
-
|
|
12147
|
-
|
|
12192
|
+
on: {
|
|
12193
|
+
modelValue(value) {
|
|
12194
|
+
const width = Math.max(0, Number(value));
|
|
12195
|
+
column.renderResizeWidth = width;
|
|
12196
|
+
},
|
|
12197
|
+
change() {
|
|
12198
|
+
$xeTableCustomPanel.changeColumnWidth(column);
|
|
12199
|
+
}
|
|
12148
12200
|
}
|
|
12149
|
-
}
|
|
12150
|
-
}
|
|
12151
|
-
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12155
|
-
|
|
12156
|
-
|
|
12157
|
-
|
|
12158
|
-
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12201
|
+
}) : panel_renderEmptyElement($xeTable)]));
|
|
12202
|
+
}
|
|
12203
|
+
if (allowFixed) {
|
|
12204
|
+
tdVNs.push(h('td', {
|
|
12205
|
+
key: 'af',
|
|
12206
|
+
class: 'vxe-table-custom-popup--column-td col--fixed'
|
|
12207
|
+
}, parentItem ? [h('span', '-')] : VxeUIRadioGroupComponent ? [h(VxeUIButtonComponent, {
|
|
12208
|
+
props: {
|
|
12209
|
+
icon: column.renderFixed === 'left' ? panel_getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : panel_getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
|
|
12210
|
+
status: column.renderFixed === 'left' ? 'primary' : '',
|
|
12211
|
+
disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
|
|
12212
|
+
title: panel_getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
|
|
12213
|
+
},
|
|
12214
|
+
on: {
|
|
12215
|
+
click: ({
|
|
12216
|
+
$event
|
|
12217
|
+
}) => {
|
|
12218
|
+
$xeTableCustomPanel.changeFixedOption(column, 'left', $event);
|
|
12219
|
+
}
|
|
12220
|
+
}
|
|
12221
|
+
}), h(VxeUIButtonComponent, {
|
|
12222
|
+
props: {
|
|
12223
|
+
icon: column.renderFixed === 'right' ? panel_getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : panel_getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
|
|
12224
|
+
status: column.renderFixed === 'right' ? 'primary' : '',
|
|
12225
|
+
disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
|
|
12226
|
+
title: panel_getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
|
|
12227
|
+
},
|
|
12228
|
+
on: {
|
|
12229
|
+
click: ({
|
|
12230
|
+
$event
|
|
12231
|
+
}) => {
|
|
12232
|
+
$xeTableCustomPanel.changeFixedOption(column, 'right', $event);
|
|
12233
|
+
}
|
|
12234
|
+
}
|
|
12235
|
+
})] : []));
|
|
12236
|
+
}
|
|
12237
|
+
if (allowAlign) {
|
|
12238
|
+
tdVNs.push(h('td', {
|
|
12239
|
+
key: 'aa',
|
|
12240
|
+
class: 'vxe-table-custom-popup--column-td col--align'
|
|
12241
|
+
}, VxeUIRadioGroupComponent ? [h(VxeUIRadioGroupComponent, {
|
|
12242
|
+
props: {
|
|
12243
|
+
value: column.renderAlign || '',
|
|
12244
|
+
type: 'button',
|
|
12245
|
+
strict: false,
|
|
12246
|
+
disabled: isHidden,
|
|
12247
|
+
options: alignList
|
|
12248
|
+
},
|
|
12249
|
+
on: {
|
|
12250
|
+
change({
|
|
12251
|
+
value,
|
|
12252
|
+
$event
|
|
12253
|
+
}) {
|
|
12254
|
+
$xeTableCustomPanel.changeAlignOption(column, value, 'align', 'renderAlign', 'custom-align-change', $event);
|
|
12255
|
+
}
|
|
12256
|
+
}
|
|
12257
|
+
})] : []));
|
|
12258
|
+
}
|
|
12259
|
+
if (allowHeaderAlign) {
|
|
12260
|
+
tdVNs.push(h('td', {
|
|
12261
|
+
key: 'aha',
|
|
12262
|
+
class: 'vxe-table-custom-popup--column-td col--header-align'
|
|
12263
|
+
}, isColGroup ? [h('span', '-')] : VxeUIRadioGroupComponent ? [h(VxeUIRadioGroupComponent, {
|
|
12264
|
+
props: {
|
|
12265
|
+
value: column.renderHeaderAlign || '',
|
|
12266
|
+
type: 'button',
|
|
12267
|
+
strict: false,
|
|
12268
|
+
disabled: isHidden,
|
|
12269
|
+
options: alignList
|
|
12270
|
+
},
|
|
12271
|
+
on: {
|
|
12272
|
+
change({
|
|
12273
|
+
value,
|
|
12274
|
+
$event
|
|
12275
|
+
}) {
|
|
12276
|
+
$xeTableCustomPanel.changeAlignOption(column, value, 'headerAlign', 'renderHeaderAlign', 'custom-header-align-change', $event);
|
|
12277
|
+
}
|
|
12278
|
+
}
|
|
12279
|
+
})] : []));
|
|
12280
|
+
}
|
|
12281
|
+
if (allowFooterAlign) {
|
|
12282
|
+
tdVNs.push(h('td', {
|
|
12283
|
+
key: 'afa',
|
|
12284
|
+
class: 'vxe-table-custom-popup--column-td col--footer-align'
|
|
12285
|
+
}, isColGroup ? [h('span', '-')] : VxeUIRadioGroupComponent ? [h(VxeUIRadioGroupComponent, {
|
|
12286
|
+
props: {
|
|
12287
|
+
value: column.renderFooterAlign || '',
|
|
12288
|
+
type: 'button',
|
|
12289
|
+
strict: false,
|
|
12290
|
+
disabled: isHidden,
|
|
12291
|
+
options: alignList
|
|
12292
|
+
},
|
|
12293
|
+
on: {
|
|
12294
|
+
change({
|
|
12295
|
+
value,
|
|
12296
|
+
$event
|
|
12297
|
+
}) {
|
|
12298
|
+
$xeTableCustomPanel.changeAlignOption(column, value, 'footerAlign', 'renderFooterAlign', 'custom-footer-align-change', $event);
|
|
12299
|
+
}
|
|
12300
|
+
}
|
|
12301
|
+
})] : []));
|
|
12302
|
+
}
|
|
12303
|
+
trVNs.push(h('tr', {
|
|
12304
|
+
key: column.id,
|
|
12305
|
+
attrs: {
|
|
12306
|
+
colid: column.id
|
|
12171
12307
|
},
|
|
12308
|
+
class: [`vxe-table-custom-popup--row level--${column.level}`, {
|
|
12309
|
+
'is--group': isColGroup
|
|
12310
|
+
}],
|
|
12172
12311
|
on: {
|
|
12173
|
-
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
}) {
|
|
12177
|
-
$xeTableCustomPanel.changeFixedOption(column, label, $event);
|
|
12178
|
-
}
|
|
12312
|
+
dragstart: $xeTableCustomPanel.sortDragstartEvent,
|
|
12313
|
+
dragend: $xeTableCustomPanel.sortDragendEvent,
|
|
12314
|
+
dragover: $xeTableCustomPanel.sortDragoverEvent
|
|
12179
12315
|
}
|
|
12180
|
-
}
|
|
12316
|
+
}, tdVNs));
|
|
12181
12317
|
}
|
|
12182
12318
|
});
|
|
12319
|
+
return trVNs;
|
|
12320
|
+
},
|
|
12321
|
+
renderPopupPanel(h) {
|
|
12322
|
+
const VxeUIModalComponent = core_.VxeUI.getComponent('VxeModal');
|
|
12323
|
+
const VxeUIDrawerComponent = core_.VxeUI.getComponent('VxeDrawer');
|
|
12324
|
+
const VxeUIButtonComponent = core_.VxeUI.getComponent('VxeButton');
|
|
12325
|
+
const $xeTableCustomPanel = this;
|
|
12326
|
+
const props = $xeTableCustomPanel;
|
|
12327
|
+
const $xeTable = $xeTableCustomPanel.$xeTable;
|
|
12328
|
+
const tableProps = $xeTable;
|
|
12329
|
+
const tableReactData = $xeTable;
|
|
12330
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
12331
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
12332
|
+
const {
|
|
12333
|
+
customStore
|
|
12334
|
+
} = props;
|
|
12335
|
+
const {
|
|
12336
|
+
treeConfig,
|
|
12337
|
+
rowGroupConfig,
|
|
12338
|
+
aggregateConfig
|
|
12339
|
+
} = tableProps;
|
|
12340
|
+
const {
|
|
12341
|
+
isCustomStatus,
|
|
12342
|
+
customColumnList
|
|
12343
|
+
} = tableReactData;
|
|
12344
|
+
const vSize = $xeTable.computeSize;
|
|
12345
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
12346
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
12347
|
+
const {
|
|
12348
|
+
panePopupStyle
|
|
12349
|
+
} = customStore;
|
|
12350
|
+
const {
|
|
12351
|
+
placement: aggPlacement
|
|
12352
|
+
} = aggregateOpts;
|
|
12353
|
+
const {
|
|
12354
|
+
mode,
|
|
12355
|
+
immediate,
|
|
12356
|
+
modalOptions,
|
|
12357
|
+
drawerOptions,
|
|
12358
|
+
allowVisible,
|
|
12359
|
+
allowFixed,
|
|
12360
|
+
allowAlign,
|
|
12361
|
+
allowHeaderAlign,
|
|
12362
|
+
allowFooterAlign,
|
|
12363
|
+
allowResizable
|
|
12364
|
+
} = customOpts;
|
|
12365
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
12366
|
+
const {
|
|
12367
|
+
maxFixedSize
|
|
12368
|
+
} = columnOpts;
|
|
12369
|
+
const modalOpts = Object.assign({}, modalOptions);
|
|
12370
|
+
const drawerOpts = Object.assign({}, drawerOptions);
|
|
12371
|
+
const slots = customOpts.slots || {};
|
|
12372
|
+
const headerSlot = slots.header;
|
|
12373
|
+
const topSlot = slots.top;
|
|
12374
|
+
const bottomSlot = slots.bottom;
|
|
12375
|
+
const defaultSlot = slots.default;
|
|
12376
|
+
const footerSlot = slots.footer;
|
|
12377
|
+
const isAllChecked = customStore.isAll;
|
|
12378
|
+
const isAllIndeterminate = customStore.isIndeterminate;
|
|
12379
|
+
const isAggRtBmLayout = aggPlacement === 'right' || aggPlacement === 'bottom';
|
|
12380
|
+
const params = {
|
|
12381
|
+
$table: $xeTable,
|
|
12382
|
+
$grid: $xeGrid,
|
|
12383
|
+
$gantt: $xeGantt,
|
|
12384
|
+
columns: customColumnList,
|
|
12385
|
+
isAllChecked,
|
|
12386
|
+
isAllIndeterminate,
|
|
12387
|
+
isCustomStatus
|
|
12388
|
+
};
|
|
12389
|
+
const colVNs = [];
|
|
12390
|
+
const headVNs = [];
|
|
12391
|
+
if (allowVisible) {
|
|
12392
|
+
colVNs.push(h('col', {
|
|
12393
|
+
key: 'av',
|
|
12394
|
+
class: 'vxe-table-custom-popup--column-col col--checkbox'
|
|
12395
|
+
}));
|
|
12396
|
+
headVNs.push(h('th', {
|
|
12397
|
+
key: 'av',
|
|
12398
|
+
class: 'vxe-table-custom-popup--column-th col--checkbox'
|
|
12399
|
+
}, [h('div', {
|
|
12400
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
12401
|
+
'is--checked': isAllChecked,
|
|
12402
|
+
'is--indeterminate': isAllIndeterminate
|
|
12403
|
+
}],
|
|
12404
|
+
attrs: {
|
|
12405
|
+
title: panel_getI18n('vxe.table.allTitle')
|
|
12406
|
+
},
|
|
12407
|
+
on: {
|
|
12408
|
+
click: $xeTableCustomPanel.allOptionEvent
|
|
12409
|
+
}
|
|
12410
|
+
}, [h('span', {
|
|
12411
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
12412
|
+
})
|
|
12413
|
+
// h('span', {
|
|
12414
|
+
// class: 'vxe-checkbox--label'
|
|
12415
|
+
// }, getI18n('vxe.toolbar.customAll'))
|
|
12416
|
+
])]));
|
|
12417
|
+
}
|
|
12418
|
+
colVNs.push(h('col', {
|
|
12419
|
+
key: 'at',
|
|
12420
|
+
class: 'vxe-table-custom-popup--column-col col--title'
|
|
12421
|
+
}));
|
|
12422
|
+
headVNs.push(h('th', {
|
|
12423
|
+
key: 'at',
|
|
12424
|
+
class: 'vxe-table-custom-popup--column-th col--title'
|
|
12425
|
+
}, panel_getI18n('vxe.custom.setting.colTitle')));
|
|
12426
|
+
if (allowResizable) {
|
|
12427
|
+
colVNs.push(h('col', {
|
|
12428
|
+
key: 'aw',
|
|
12429
|
+
class: 'vxe-table-custom-popup--column-col col--width'
|
|
12430
|
+
}));
|
|
12431
|
+
headVNs.push(h('th', {
|
|
12432
|
+
key: 'aw',
|
|
12433
|
+
class: 'vxe-table-custom-popup--column-th col--width'
|
|
12434
|
+
}, panel_getI18n('vxe.custom.setting.colResizable')));
|
|
12435
|
+
}
|
|
12436
|
+
if (allowFixed) {
|
|
12437
|
+
colVNs.push(h('col', {
|
|
12438
|
+
key: 'af',
|
|
12439
|
+
class: 'vxe-table-custom-popup--column-col col--fixed'
|
|
12440
|
+
}));
|
|
12441
|
+
headVNs.push(h('th', {
|
|
12442
|
+
key: 'af',
|
|
12443
|
+
class: 'vxe-table-custom-popup--column-th col--fixed'
|
|
12444
|
+
}, panel_getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])));
|
|
12445
|
+
}
|
|
12446
|
+
if (allowAlign) {
|
|
12447
|
+
colVNs.push(h('col', {
|
|
12448
|
+
key: 'aa',
|
|
12449
|
+
class: 'vxe-table-custom-popup--column-col col--align'
|
|
12450
|
+
}));
|
|
12451
|
+
headVNs.push(h('th', {
|
|
12452
|
+
key: 'aa',
|
|
12453
|
+
class: 'vxe-table-custom-popup--column-th col--align'
|
|
12454
|
+
}, panel_getI18n('vxe.custom.setting.colAlign')));
|
|
12455
|
+
}
|
|
12456
|
+
if (allowHeaderAlign) {
|
|
12457
|
+
colVNs.push(h('col', {
|
|
12458
|
+
key: 'aha',
|
|
12459
|
+
class: 'vxe-table-custom-popup--column-col col--header-align'
|
|
12460
|
+
}));
|
|
12461
|
+
headVNs.push(h('th', {
|
|
12462
|
+
key: 'aha',
|
|
12463
|
+
class: 'vxe-table-custom-popup--column-th col--header-align'
|
|
12464
|
+
}, panel_getI18n('vxe.custom.setting.colHeadAlign')));
|
|
12465
|
+
}
|
|
12466
|
+
if (allowFooterAlign) {
|
|
12467
|
+
colVNs.push(h('col', {
|
|
12468
|
+
key: 'afa',
|
|
12469
|
+
class: 'vxe-table-custom-popup--column-col col--footer-align'
|
|
12470
|
+
}));
|
|
12471
|
+
headVNs.push(h('th', {
|
|
12472
|
+
key: 'afa',
|
|
12473
|
+
class: 'vxe-table-custom-popup--column-th col--footer-align'
|
|
12474
|
+
}, panel_getI18n('vxe.custom.setting.colFootAlign')));
|
|
12475
|
+
}
|
|
12183
12476
|
const scopedSlots = {
|
|
12184
12477
|
default: () => {
|
|
12185
12478
|
return h('div', {
|
|
12186
12479
|
ref: 'refBodyWrapperElem',
|
|
12187
|
-
class: ['vxe-table-custom-popup--body-wrapper', `agg-layout--${aggPlacement}
|
|
12480
|
+
class: ['vxe-table-custom-popup--body-wrapper', `agg-layout--${aggPlacement}`, {
|
|
12481
|
+
[`size--${vSize}`]: vSize
|
|
12482
|
+
}],
|
|
12483
|
+
style: panePopupStyle
|
|
12188
12484
|
}, defaultSlot ? $xeTable.callSlot(defaultSlot, params, h) : [!isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel ? h($xeTable.getPivotTableAggregatePopupPanel(), {
|
|
12189
12485
|
props: {
|
|
12190
12486
|
customStore
|
|
@@ -12196,36 +12492,13 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12196
12492
|
class: 'vxe-table-custom-popup--table-top'
|
|
12197
12493
|
}, $xeTable.callSlot(topSlot, params, h)) : panel_renderEmptyElement($xeTable), h('div', {
|
|
12198
12494
|
class: 'vxe-table-custom-popup--table-wrapper'
|
|
12199
|
-
}, [h('table', {}, [h('colgroup', {}, [
|
|
12200
|
-
class: 'vxe-table-custom-popup--table-col-seq'
|
|
12201
|
-
}) : panel_renderEmptyElement($xeTable), h('col', {
|
|
12202
|
-
class: 'vxe-table-custom-popup--table-col-title'
|
|
12203
|
-
}), allowResizable ? h('col', {
|
|
12204
|
-
class: 'vxe-table-custom-popup--table-col-width'
|
|
12205
|
-
}) : panel_renderEmptyElement($xeTable), allowFixed ? h('col', {
|
|
12206
|
-
class: 'vxe-table-custom-popup--table-col-fixed'
|
|
12207
|
-
}) : panel_renderEmptyElement($xeTable)]), h('thead', {}, [h('tr', {}, [allowVisible ? h('th', {}, [h('div', {
|
|
12208
|
-
class: ['vxe-table-custom--checkbox-option', {
|
|
12209
|
-
'is--checked': isAllChecked,
|
|
12210
|
-
'is--indeterminate': isAllIndeterminate
|
|
12211
|
-
}],
|
|
12212
|
-
attrs: {
|
|
12213
|
-
title: panel_getI18n('vxe.table.allTitle')
|
|
12214
|
-
},
|
|
12215
|
-
on: {
|
|
12216
|
-
click: $xeTableCustomPanel.allOptionEvent
|
|
12217
|
-
}
|
|
12218
|
-
}, [h('span', {
|
|
12219
|
-
class: ['vxe-checkbox--icon', isAllIndeterminate ? panel_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? panel_getIcon().TABLE_CHECKBOX_CHECKED : panel_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
12220
|
-
}), h('span', {
|
|
12221
|
-
class: 'vxe-checkbox--label'
|
|
12222
|
-
}, panel_getI18n('vxe.toolbar.customAll'))])]) : panel_renderEmptyElement($xeTable), h('th', {}, panel_getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, panel_getI18n('vxe.custom.setting.colResizable')) : panel_renderEmptyElement($xeTable), allowFixed ? h('th', {}, panel_getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : panel_renderEmptyElement($xeTable)])]), h('transition-group', {
|
|
12495
|
+
}, [h('table', {}, [h('colgroup', {}, colVNs), h('thead', {}, [h('tr', {}, headVNs)]), h('transition-group', {
|
|
12223
12496
|
class: 'vxe-table-custom--panel-list',
|
|
12224
12497
|
props: {
|
|
12225
12498
|
tag: 'tbody',
|
|
12226
12499
|
name: 'vxe-table-custom--list'
|
|
12227
12500
|
}
|
|
12228
|
-
},
|
|
12501
|
+
}, $xeTableCustomPanel.renderPopupBodys(h))])]), bottomSlot ? h('div', {
|
|
12229
12502
|
class: 'vxe-table-custom-popup--table-bottom'
|
|
12230
12503
|
}, $xeTable.callSlot(bottomSlot, params, h)) : panel_renderEmptyElement($xeTable), $xeTableCustomPanel.renderDragTip(h)]), isAggRtBmLayout && !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel ? h($xeTable.getPivotTableAggregatePopupPanel(), {
|
|
12231
12504
|
props: {
|
|
@@ -12249,6 +12522,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12249
12522
|
}
|
|
12250
12523
|
}), immediate ? h(VxeUIButtonComponent, {
|
|
12251
12524
|
props: {
|
|
12525
|
+
status: 'primary',
|
|
12252
12526
|
content: customOpts.resetButtonText || panel_getI18n('vxe.table.customClose')
|
|
12253
12527
|
},
|
|
12254
12528
|
on: {
|
|
@@ -12301,11 +12575,11 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12301
12575
|
return VxeUIModalComponent ? h(VxeUIModalComponent, {
|
|
12302
12576
|
key: 'modal',
|
|
12303
12577
|
props: {
|
|
12304
|
-
className: ['vxe-table-custom-
|
|
12578
|
+
className: ['vxe-table-custom-modal-wrapper', 'vxe-table--ignore-clear', modalOpts.className || ''].join(' '),
|
|
12305
12579
|
value: customStore.visible,
|
|
12306
12580
|
title: modalOpts.title || panel_getI18n('vxe.custom.cstmTitle'),
|
|
12307
|
-
width: modalOpts.width || Math.min(
|
|
12308
|
-
minWidth: modalOpts.minWidth ||
|
|
12581
|
+
width: modalOpts.width || Math.min(1000, document.documentElement.clientWidth),
|
|
12582
|
+
minWidth: modalOpts.minWidth || 800,
|
|
12309
12583
|
height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
|
|
12310
12584
|
minHeight: modalOpts.minHeight || 400,
|
|
12311
12585
|
showZoom: modalOpts.showZoom,
|
|
@@ -12314,6 +12588,7 @@ function panel_hideDropTip($xeTableCustomPanel) {
|
|
|
12314
12588
|
mask: modalOpts.mask,
|
|
12315
12589
|
lockView: modalOpts.lockView,
|
|
12316
12590
|
resize: modalOpts.resize,
|
|
12591
|
+
transfer: modalOpts.transfer,
|
|
12317
12592
|
escClosable: !!modalOpts.escClosable,
|
|
12318
12593
|
maskClosable: !!modalOpts.maskClosable,
|
|
12319
12594
|
destroyOnClose: true,
|
|
@@ -19580,6 +19855,7 @@ function beginValidate($xeTable, rows, cols, cb, isFull) {
|
|
|
19580
19855
|
|
|
19581
19856
|
|
|
19582
19857
|
|
|
19858
|
+
const customColumnCssKeys = ['checkbox', 'sort', 'title', 'width', 'fixed', 'align', 'header-align', 'footer-align'];
|
|
19583
19859
|
function updatePopupStyle($xeTable) {
|
|
19584
19860
|
const $xeGrid = $xeTable.$xeGrid;
|
|
19585
19861
|
const $xeGantt = $xeTable.$xeGantt;
|
|
@@ -19597,6 +19873,8 @@ function updatePopupStyle($xeTable) {
|
|
|
19597
19873
|
const showSimple = !(mode === 'modal' || mode === 'drawer');
|
|
19598
19874
|
const {
|
|
19599
19875
|
transfer,
|
|
19876
|
+
minWidth,
|
|
19877
|
+
maxWidth,
|
|
19600
19878
|
maxHeight
|
|
19601
19879
|
} = popupOptions || {};
|
|
19602
19880
|
const customSimpleMode = $xeTable.computeCustomSimpleMode;
|
|
@@ -19605,7 +19883,8 @@ function updatePopupStyle($xeTable) {
|
|
|
19605
19883
|
let wrapperEl = $xeTable.$refs.refElem;
|
|
19606
19884
|
let popupTop = 0;
|
|
19607
19885
|
let popupMaxHeight = 0;
|
|
19608
|
-
const
|
|
19886
|
+
const defPupStys = {};
|
|
19887
|
+
const panePupStys = {};
|
|
19609
19888
|
if ($xeGantt) {
|
|
19610
19889
|
const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem;
|
|
19611
19890
|
if (ganttContainerElem) {
|
|
@@ -19635,23 +19914,40 @@ function updatePopupStyle($xeTable) {
|
|
|
19635
19914
|
}
|
|
19636
19915
|
if (!placement || !['left', 'right', 'bottom-left', 'bottom-right'].includes(placement)) {
|
|
19637
19916
|
if (popupTop) {
|
|
19638
|
-
|
|
19917
|
+
defPupStys.top = toCssUnit(popupTop);
|
|
19639
19918
|
}
|
|
19640
19919
|
}
|
|
19641
19920
|
if (showSimple && transfer) {
|
|
19642
19921
|
if (placement === 'bottom-left' || placement === 'bottom-right') {
|
|
19643
|
-
|
|
19922
|
+
defPupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1);
|
|
19644
19923
|
}
|
|
19645
19924
|
if (placement === 'top-left' || placement === 'bottom-left') {
|
|
19646
|
-
|
|
19925
|
+
defPupStys.left = toCssUnit(tableRect.left);
|
|
19647
19926
|
} else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
|
|
19648
|
-
|
|
19927
|
+
defPupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1);
|
|
19928
|
+
}
|
|
19929
|
+
}
|
|
19930
|
+
// 同步表格的css变量到弹窗中
|
|
19931
|
+
const bodyComputeStyle = getComputedStyle(bodyEl);
|
|
19932
|
+
const tableComputeStyle = getComputedStyle(wrapperEl);
|
|
19933
|
+
customColumnCssKeys.forEach(key => {
|
|
19934
|
+
const currCssKey = `--vxe-ui-vxe-table-custom-column-${key}-${key === 'title' ? 'min-' : ''}width`;
|
|
19935
|
+
const currCssVal = tableComputeStyle.getPropertyValue(currCssKey);
|
|
19936
|
+
if (currCssVal && currCssVal !== bodyComputeStyle.getPropertyValue(currCssKey)) {
|
|
19937
|
+
panePupStys[currCssKey] = currCssVal;
|
|
19649
19938
|
}
|
|
19939
|
+
});
|
|
19940
|
+
if (minWidth) {
|
|
19941
|
+
defPupStys['--vxe-ui-vxe-table-custom-default-min-width'] = toCssUnit(minWidth);
|
|
19942
|
+
}
|
|
19943
|
+
if (maxWidth) {
|
|
19944
|
+
defPupStys['--vxe-ui-vxe-table-custom-default-max-width'] = toCssUnit(maxWidth);
|
|
19650
19945
|
}
|
|
19651
19946
|
if (popupMxHeight) {
|
|
19652
|
-
|
|
19947
|
+
defPupStys.maxHeight = toCssUnit(popupMxHeight);
|
|
19653
19948
|
}
|
|
19654
|
-
customStore.
|
|
19949
|
+
customStore.defPopupStyle = defPupStys;
|
|
19950
|
+
customStore.panePopupStyle = panePupStys;
|
|
19655
19951
|
customStore.maxHeight = popupMxHeight;
|
|
19656
19952
|
return $xeTable.$nextTick();
|
|
19657
19953
|
}
|
|
@@ -19765,10 +20061,21 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
19765
20061
|
allowSort,
|
|
19766
20062
|
allowFixed,
|
|
19767
20063
|
allowResizable,
|
|
20064
|
+
allowAlign,
|
|
20065
|
+
allowHeaderAlign,
|
|
20066
|
+
allowFooterAlign,
|
|
19768
20067
|
allowGroup,
|
|
19769
20068
|
allowValues
|
|
19770
20069
|
} = customOpts;
|
|
19771
|
-
if (
|
|
20070
|
+
if (isDirectly) {
|
|
20071
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
|
|
20072
|
+
if (allowResizable) {
|
|
20073
|
+
if (column.renderVisible && (!column.children || !column.children.length)) {
|
|
20074
|
+
column.resizeWidth = Math.max(0, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(column.renderWidth));
|
|
20075
|
+
}
|
|
20076
|
+
}
|
|
20077
|
+
});
|
|
20078
|
+
} else {
|
|
19772
20079
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parentColumn) => {
|
|
19773
20080
|
if (parentColumn) {
|
|
19774
20081
|
// 更新子列信息
|
|
@@ -19793,13 +20100,22 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
19793
20100
|
if (allowVisible) {
|
|
19794
20101
|
column.visible = column.renderVisible;
|
|
19795
20102
|
}
|
|
20103
|
+
if (allowAlign) {
|
|
20104
|
+
column.align = column.renderAlign;
|
|
20105
|
+
}
|
|
20106
|
+
if (allowHeaderAlign) {
|
|
20107
|
+
column.headerAlign = column.renderHeaderAlign;
|
|
20108
|
+
}
|
|
20109
|
+
if (allowFooterAlign) {
|
|
20110
|
+
column.footerAlign = column.renderFooterAlign;
|
|
20111
|
+
}
|
|
19796
20112
|
if (allowGroup && allowValues) {
|
|
19797
20113
|
column.aggFunc = column.renderAggFn;
|
|
19798
20114
|
}
|
|
19799
20115
|
});
|
|
19800
20116
|
}
|
|
19801
20117
|
reactData.isCustomStatus = true;
|
|
19802
|
-
if (allowGroup &&
|
|
20118
|
+
if (allowGroup && !!$xeTable.handlePivotTableAggData) {
|
|
19803
20119
|
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
19804
20120
|
// 更新数据分组
|
|
19805
20121
|
if (aggHandleFields.length) {
|
|
@@ -19834,7 +20150,12 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
19834
20150
|
allowVisible,
|
|
19835
20151
|
allowSort,
|
|
19836
20152
|
allowFixed,
|
|
19837
|
-
|
|
20153
|
+
allowAlign,
|
|
20154
|
+
allowHeaderAlign,
|
|
20155
|
+
allowFooterAlign,
|
|
20156
|
+
allowResizable,
|
|
20157
|
+
allowGroup,
|
|
20158
|
+
allowValues
|
|
19838
20159
|
} = customOpts;
|
|
19839
20160
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, column => {
|
|
19840
20161
|
const colid = column.getKey();
|
|
@@ -19854,6 +20175,21 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
19854
20175
|
if (allowResizable) {
|
|
19855
20176
|
column.renderResizeWidth = column.renderWidth;
|
|
19856
20177
|
}
|
|
20178
|
+
if (allowAlign) {
|
|
20179
|
+
column.align = column.renderAlign;
|
|
20180
|
+
}
|
|
20181
|
+
if (allowHeaderAlign) {
|
|
20182
|
+
column.headerAlign = column.renderHeaderAlign;
|
|
20183
|
+
}
|
|
20184
|
+
if (allowFooterAlign) {
|
|
20185
|
+
column.footerAlign = column.renderFooterAlign;
|
|
20186
|
+
}
|
|
20187
|
+
if (allowGroup) {
|
|
20188
|
+
// 无
|
|
20189
|
+
}
|
|
20190
|
+
if (allowValues) {
|
|
20191
|
+
// 无
|
|
20192
|
+
}
|
|
19857
20193
|
}, {
|
|
19858
20194
|
children: 'children'
|
|
19859
20195
|
});
|
|
@@ -19878,7 +20214,10 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
19878
20214
|
resizable: options === true,
|
|
19879
20215
|
fixed: options === true,
|
|
19880
20216
|
sort: options === true,
|
|
19881
|
-
aggFunc: options === true
|
|
20217
|
+
aggFunc: options === true,
|
|
20218
|
+
align: options === true,
|
|
20219
|
+
headerAlign: options === true,
|
|
20220
|
+
footerAlign: options === true
|
|
19882
20221
|
}, options);
|
|
19883
20222
|
const allCols = [];
|
|
19884
20223
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
|
|
@@ -19887,6 +20226,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
19887
20226
|
}
|
|
19888
20227
|
if (opts.fixed) {
|
|
19889
20228
|
column.fixed = column.defaultFixed;
|
|
20229
|
+
column.renderFixed = column.defaultFixed;
|
|
19890
20230
|
}
|
|
19891
20231
|
if (opts.sort) {
|
|
19892
20232
|
column.renderSortNumber = column.sortNumber;
|
|
@@ -19898,6 +20238,18 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
19898
20238
|
})) {
|
|
19899
20239
|
column.visible = column.defaultVisible;
|
|
19900
20240
|
}
|
|
20241
|
+
if (opts.align) {
|
|
20242
|
+
column.align = column.defaultAlign;
|
|
20243
|
+
column.renderAlign = column.defaultAlign;
|
|
20244
|
+
}
|
|
20245
|
+
if (opts.headerAlign) {
|
|
20246
|
+
column.headerAlign = column.defaultHeaderAlign;
|
|
20247
|
+
column.renderHeaderAlign = column.defaultHeaderAlign;
|
|
20248
|
+
}
|
|
20249
|
+
if (opts.footerAlign) {
|
|
20250
|
+
column.footerAlign = column.defaultFooterAlign;
|
|
20251
|
+
column.renderFooterAlign = column.defaultFooterAlign;
|
|
20252
|
+
}
|
|
19901
20253
|
if (opts.aggFunc) {
|
|
19902
20254
|
column.aggFunc = column.defaultAggFunc;
|
|
19903
20255
|
column.renderAggFn = column.defaultAggFunc;
|
|
@@ -20090,6 +20442,9 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
20090
20442
|
column.renderFixed = column.fixed;
|
|
20091
20443
|
column.renderVisible = column.visible;
|
|
20092
20444
|
column.renderResizeWidth = column.renderWidth;
|
|
20445
|
+
column.renderAlign = column.align;
|
|
20446
|
+
column.renderHeaderAlign = column.headerAlign;
|
|
20447
|
+
column.renderFooterAlign = column.footerAlign;
|
|
20093
20448
|
sortMaps[colid] = column.renderSortNumber;
|
|
20094
20449
|
fixedMaps[colid] = column.fixed;
|
|
20095
20450
|
visibleMaps[colid] = column.visible;
|
|
@@ -27900,10 +28255,16 @@ const Toolbar = VxeToolbar;
|
|
|
27900
28255
|
colResizable: '列宽(像素)',
|
|
27901
28256
|
colVisible: '是否显示',
|
|
27902
28257
|
colFixed: '冻结列',
|
|
27903
|
-
colFixedMax: '
|
|
27904
|
-
|
|
27905
|
-
|
|
27906
|
-
|
|
28258
|
+
colFixedMax: '冻结列({0})',
|
|
28259
|
+
colAlign: '对齐方式',
|
|
28260
|
+
colHeadAlign: '表头对齐方式',
|
|
28261
|
+
colFootAlign: '表尾对齐方式',
|
|
28262
|
+
fixedLeft: '左',
|
|
28263
|
+
fixedUnset: '无',
|
|
28264
|
+
fixedRight: '右',
|
|
28265
|
+
alignLeft: '左',
|
|
28266
|
+
alignCenter: '中',
|
|
28267
|
+
alignRight: '右',
|
|
27907
28268
|
moveUp: '上移',
|
|
27908
28269
|
moveDn: '下移',
|
|
27909
28270
|
putTop: '置顶',
|
|
@@ -27911,7 +28272,10 @@ const Toolbar = VxeToolbar;
|
|
|
27911
28272
|
moveUpTitle: '点击向上移动',
|
|
27912
28273
|
moveDnTitle: '点击向下移动',
|
|
27913
28274
|
putTopTitle: '点击置顶',
|
|
27914
|
-
putBottomTitle: '点击置尾'
|
|
28275
|
+
putBottomTitle: '点击置尾',
|
|
28276
|
+
anLeftTitle: '左对齐',
|
|
28277
|
+
anCenterTitle: '居中',
|
|
28278
|
+
anRightTitle: '右对齐'
|
|
27915
28279
|
}
|
|
27916
28280
|
},
|
|
27917
28281
|
import: {
|