vxe-table 4.13.39 → 4.13.41
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.en.md +2 -0
- package/README.ja-JP.md +2 -0
- package/README.md +3 -0
- package/README.zh-TW.md +3 -1
- package/es/grid/src/grid.js +21 -6
- package/es/{iconfont.1749800539928.ttf → iconfont.1750153812846.ttf} +0 -0
- package/es/iconfont.1750153812846.woff +0 -0
- package/es/iconfont.1750153812846.woff2 +0 -0
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +6 -0
- package/es/locale/lang/de-DE.js +6 -0
- package/es/locale/lang/en-US.js +6 -0
- package/es/locale/lang/es-ES.js +6 -0
- package/es/locale/lang/fr-FR.js +6 -0
- package/es/locale/lang/hu-HU.js +6 -0
- package/es/locale/lang/hy-AM.js +6 -0
- package/es/locale/lang/id-ID.js +6 -0
- package/es/locale/lang/it-IT.js +6 -0
- package/es/locale/lang/ja-JP.js +6 -0
- package/es/locale/lang/ko-KR.js +6 -0
- package/es/locale/lang/ms-MY.js +6 -0
- package/es/locale/lang/nb-NO.js +6 -0
- package/es/locale/lang/pt-BR.js +6 -0
- package/es/locale/lang/ru-RU.js +6 -0
- package/es/locale/lang/th-TH.js +6 -0
- package/es/locale/lang/ug-CN.js +6 -0
- package/es/locale/lang/uk-UA.js +6 -0
- package/es/locale/lang/uz-UZ.js +6 -0
- package/es/locale/lang/vi-VN.js +6 -0
- package/es/locale/lang/zh-CHT.js +6 -0
- package/es/locale/lang/zh-CN.js +6 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +29 -4
- package/es/table/module/custom/panel.js +105 -93
- package/es/table/module/export/export-panel.js +3 -2
- package/es/table/module/export/import-panel.js +3 -2
- package/es/table/module/filter/panel.js +3 -2
- package/es/table/module/menu/panel.js +3 -2
- package/es/table/src/body.js +7 -5
- package/es/table/src/cell.js +14 -14
- package/es/table/src/column.js +3 -2
- package/es/table/src/footer.js +3 -2
- package/es/table/src/group.js +3 -2
- package/es/table/src/header.js +3 -2
- package/es/table/src/props.js +28 -7
- package/es/table/src/table.js +64 -47
- package/es/table/style.css +22 -3
- package/es/table/style.min.css +1 -1
- package/es/toolbar/src/toolbar.js +155 -61
- package/es/ui/index.js +12 -1
- package/es/ui/src/comp.js +2 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +22 -3
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +20 -5
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/{iconfont.1749800539928.ttf → iconfont.1750153812846.ttf} +0 -0
- package/lib/iconfont.1750153812846.woff +0 -0
- package/lib/iconfont.1750153812846.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +350 -150
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +6 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +6 -0
- package/lib/locale/lang/de-DE.js +6 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +6 -0
- package/lib/locale/lang/en-US.js +6 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +6 -0
- package/lib/locale/lang/es-ES.js +6 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +6 -0
- package/lib/locale/lang/fr-FR.js +6 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +6 -0
- package/lib/locale/lang/hu-HU.js +6 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +6 -0
- package/lib/locale/lang/hy-AM.js +6 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +6 -0
- package/lib/locale/lang/id-ID.js +6 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +6 -0
- package/lib/locale/lang/it-IT.js +6 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +6 -0
- package/lib/locale/lang/ja-JP.js +6 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +6 -0
- package/lib/locale/lang/ko-KR.js +6 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +6 -0
- package/lib/locale/lang/ms-MY.js +6 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +6 -0
- package/lib/locale/lang/nb-NO.js +6 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +6 -0
- package/lib/locale/lang/pt-BR.js +6 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +6 -0
- package/lib/locale/lang/ru-RU.js +6 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +6 -0
- package/lib/locale/lang/th-TH.js +6 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +6 -0
- package/lib/locale/lang/ug-CN.js +6 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +6 -0
- package/lib/locale/lang/uk-UA.js +6 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +6 -0
- package/lib/locale/lang/uz-UZ.js +6 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +6 -0
- package/lib/locale/lang/vi-VN.js +6 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +6 -0
- package/lib/locale/lang/zh-CHT.js +6 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +6 -0
- package/lib/locale/lang/zh-CN.js +6 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +6 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +32 -4
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +14 -3
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +2 -1
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +2 -1
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/filter/panel.js +2 -1
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/menu/panel.js +2 -1
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/src/body.js +9 -9
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +16 -16
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/footer.js +2 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +2 -1
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +2 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/props.js +28 -7
- package/lib/table/src/table.js +13 -11
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +22 -3
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/src/toolbar.js +180 -85
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +12 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +8 -0
- package/lib/ui/src/comp.min.js +1 -0
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +22 -3
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +29 -7
- package/packages/locale/lang/ar-EG.ts +6 -0
- package/packages/locale/lang/de-DE.ts +6 -0
- package/packages/locale/lang/en-US.ts +6 -0
- package/packages/locale/lang/es-ES.ts +6 -0
- package/packages/locale/lang/fr-FR.ts +6 -0
- package/packages/locale/lang/hu-HU.ts +6 -0
- package/packages/locale/lang/hy-AM.ts +6 -0
- package/packages/locale/lang/id-ID.ts +6 -0
- package/packages/locale/lang/it-IT.ts +6 -0
- package/packages/locale/lang/ja-JP.ts +6 -0
- package/packages/locale/lang/ko-KR.ts +6 -0
- package/packages/locale/lang/ms-MY.ts +6 -0
- package/packages/locale/lang/nb-NO.ts +6 -0
- package/packages/locale/lang/pt-BR.ts +6 -0
- package/packages/locale/lang/ru-RU.ts +6 -0
- package/packages/locale/lang/th-TH.ts +6 -0
- package/packages/locale/lang/ug-CN.ts +6 -0
- package/packages/locale/lang/uk-UA.ts +6 -0
- package/packages/locale/lang/uz-UZ.ts +6 -0
- package/packages/locale/lang/vi-VN.ts +6 -0
- package/packages/locale/lang/zh-CHT.ts +6 -0
- package/packages/locale/lang/zh-CN.ts +6 -0
- package/packages/table/module/custom/hook.ts +27 -4
- package/packages/table/module/custom/panel.ts +114 -102
- package/packages/table/module/export/export-panel.ts +3 -2
- package/packages/table/module/export/import-panel.ts +3 -2
- package/packages/table/module/filter/panel.ts +3 -2
- package/packages/table/module/menu/panel.ts +3 -2
- package/packages/table/src/body.ts +10 -8
- package/packages/table/src/cell.ts +14 -14
- package/packages/table/src/column.ts +3 -2
- package/packages/table/src/footer.ts +3 -2
- package/packages/table/src/group.ts +3 -2
- package/packages/table/src/header.ts +3 -2
- package/packages/table/src/props.ts +28 -7
- package/packages/table/src/table.ts +66 -46
- package/packages/toolbar/src/toolbar.ts +157 -58
- package/packages/ui/index.ts +11 -0
- package/packages/ui/src/comp.ts +3 -0
- package/styles/components/icon.scss +13 -1
- package/styles/components/table-module/custom.scss +9 -2
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/es/iconfont.1749800539928.woff +0 -0
- package/es/iconfont.1749800539928.woff2 +0 -0
- package/lib/iconfont.1749800539928.woff +0 -0
- package/lib/iconfont.1749800539928.woff2 +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.13.
|
|
3141
|
+
const version = "4.13.41";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3232,6 +3232,14 @@ core_.VxeUI.setConfig({
|
|
|
3232
3232
|
showFooter: true,
|
|
3233
3233
|
placement: 'top-right',
|
|
3234
3234
|
// storage: false,
|
|
3235
|
+
storeOptions: {
|
|
3236
|
+
visible: true,
|
|
3237
|
+
resizable: true,
|
|
3238
|
+
sort: true,
|
|
3239
|
+
fixed: true
|
|
3240
|
+
// rowGroup: false,
|
|
3241
|
+
// aggFunc: false
|
|
3242
|
+
},
|
|
3235
3243
|
// checkMethod () {},
|
|
3236
3244
|
modalOptions: {
|
|
3237
3245
|
showMaximize: true,
|
|
@@ -3437,6 +3445,9 @@ core_.VxeUI.setIcon({
|
|
|
3437
3445
|
TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
|
|
3438
3446
|
TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
|
|
3439
3447
|
TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
|
|
3448
|
+
TABLE_AGGREGATION_GROUPING: iconPrefix + 'grouping',
|
|
3449
|
+
TABLE_AGGREGATION_VALUES: iconPrefix + 'values',
|
|
3450
|
+
TABLE_AGGREGATION_DELETE: iconPrefix + 'close',
|
|
3440
3451
|
// toolbar
|
|
3441
3452
|
TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
|
|
3442
3453
|
TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
|
|
@@ -3589,6 +3600,9 @@ const modal = {
|
|
|
3589
3600
|
/* harmony default export */ var ui = ((/* unused pure expression or super */ null && (VxeUI)));
|
|
3590
3601
|
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
3591
3602
|
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(9274);
|
|
3603
|
+
;// ./packages/ui/src/comp.ts
|
|
3604
|
+
|
|
3605
|
+
const defineVxeComponent = external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent;
|
|
3592
3606
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
3593
3607
|
var es_array_push = __webpack_require__(4114);
|
|
3594
3608
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.map.js
|
|
@@ -3600,7 +3614,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3600
3614
|
const {
|
|
3601
3615
|
log: log_log
|
|
3602
3616
|
} = core_.VxeUI;
|
|
3603
|
-
const log_version = `table v${"4.13.
|
|
3617
|
+
const log_version = `table v${"4.13.41"}`;
|
|
3604
3618
|
const warnLog = log_log.create('warn', log_version);
|
|
3605
3619
|
const errLog = log_log.create('error', log_version);
|
|
3606
3620
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -5159,22 +5173,6 @@ const Cell = {
|
|
|
5159
5173
|
} = column;
|
|
5160
5174
|
const renderOpts = editRender || cellRender;
|
|
5161
5175
|
const defaultSlot = slots ? slots.default : null;
|
|
5162
|
-
if (defaultSlot) {
|
|
5163
|
-
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
5164
|
-
}
|
|
5165
|
-
if (renderOpts) {
|
|
5166
|
-
const compConf = cell_renderer.get(renderOpts.name);
|
|
5167
|
-
if (compConf) {
|
|
5168
|
-
const rtCell = compConf.renderTableCell || compConf.renderCell;
|
|
5169
|
-
const rtDefault = compConf.renderTableDefault || compConf.renderDefault;
|
|
5170
|
-
const renderFn = editRender ? rtCell : rtDefault;
|
|
5171
|
-
if (renderFn) {
|
|
5172
|
-
return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({
|
|
5173
|
-
$type: editRender ? 'edit' : 'cell'
|
|
5174
|
-
}, params))));
|
|
5175
|
-
}
|
|
5176
|
-
}
|
|
5177
|
-
}
|
|
5178
5176
|
let cellValue = '';
|
|
5179
5177
|
if (isRowGroupStatus && field && row.isAggregate) {
|
|
5180
5178
|
const aggRow = row;
|
|
@@ -5231,6 +5229,22 @@ const Cell = {
|
|
|
5231
5229
|
}
|
|
5232
5230
|
}
|
|
5233
5231
|
} else {
|
|
5232
|
+
if (defaultSlot) {
|
|
5233
|
+
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
5234
|
+
}
|
|
5235
|
+
if (renderOpts) {
|
|
5236
|
+
const compConf = cell_renderer.get(renderOpts.name);
|
|
5237
|
+
if (compConf) {
|
|
5238
|
+
const rtCell = compConf.renderTableCell || compConf.renderCell;
|
|
5239
|
+
const rtDefault = compConf.renderTableDefault || compConf.renderDefault;
|
|
5240
|
+
const renderFn = editRender ? rtCell : rtDefault;
|
|
5241
|
+
if (renderFn) {
|
|
5242
|
+
return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({
|
|
5243
|
+
$type: editRender ? 'edit' : 'cell'
|
|
5244
|
+
}, params))));
|
|
5245
|
+
}
|
|
5246
|
+
}
|
|
5247
|
+
}
|
|
5234
5248
|
cellValue = $table.getCellLabel(row, column);
|
|
5235
5249
|
}
|
|
5236
5250
|
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
@@ -6152,6 +6166,7 @@ const Cell = {
|
|
|
6152
6166
|
|
|
6153
6167
|
|
|
6154
6168
|
|
|
6169
|
+
|
|
6155
6170
|
const columnProps = {
|
|
6156
6171
|
// 列唯一主键
|
|
6157
6172
|
colId: [String, Number],
|
|
@@ -6277,7 +6292,7 @@ const columnProps = {
|
|
|
6277
6292
|
// 额外的参数
|
|
6278
6293
|
params: Object
|
|
6279
6294
|
};
|
|
6280
|
-
/* harmony default export */ var column = ((
|
|
6295
|
+
/* harmony default export */ var column = (defineVxeComponent({
|
|
6281
6296
|
name: 'VxeColumn',
|
|
6282
6297
|
props: columnProps,
|
|
6283
6298
|
setup(props, {
|
|
@@ -6338,7 +6353,8 @@ const Column = VxeColumn;
|
|
|
6338
6353
|
|
|
6339
6354
|
|
|
6340
6355
|
|
|
6341
|
-
|
|
6356
|
+
|
|
6357
|
+
/* harmony default export */ var group = (defineVxeComponent({
|
|
6342
6358
|
name: 'VxeColgroup',
|
|
6343
6359
|
props: columnProps,
|
|
6344
6360
|
setup(props, {
|
|
@@ -6418,13 +6434,14 @@ var esnext_iterator_to_array = __webpack_require__(1795);
|
|
|
6418
6434
|
|
|
6419
6435
|
|
|
6420
6436
|
|
|
6437
|
+
|
|
6421
6438
|
const {
|
|
6422
6439
|
getI18n: body_getI18n,
|
|
6423
6440
|
renderer: body_renderer,
|
|
6424
6441
|
renderEmptyElement: body_renderEmptyElement
|
|
6425
6442
|
} = core_.VxeUI;
|
|
6426
6443
|
const renderType = 'body';
|
|
6427
|
-
/* harmony default export */ var body = ((
|
|
6444
|
+
/* harmony default export */ var body = (defineVxeComponent({
|
|
6428
6445
|
name: 'VxeTableBody',
|
|
6429
6446
|
props: {
|
|
6430
6447
|
tableData: Array,
|
|
@@ -7110,7 +7127,7 @@ const renderType = 'body';
|
|
|
7110
7127
|
} = expandColumn || {};
|
|
7111
7128
|
const colid = expandColumn.id;
|
|
7112
7129
|
const colRest = fullColumnIdData[colid] || {};
|
|
7113
|
-
const hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().
|
|
7130
|
+
const hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
7114
7131
|
let columnIndex = -1;
|
|
7115
7132
|
let $columnIndex = -1;
|
|
7116
7133
|
let _columnIndex = -1;
|
|
@@ -7309,18 +7326,17 @@ const renderType = 'body';
|
|
|
7309
7326
|
}
|
|
7310
7327
|
let emptyContent;
|
|
7311
7328
|
const emptySlot = slots ? slots.empty : null;
|
|
7329
|
+
const emptyParams = {
|
|
7330
|
+
$table: $xeTable,
|
|
7331
|
+
$grid: $xeGrid
|
|
7332
|
+
};
|
|
7312
7333
|
if (emptySlot) {
|
|
7313
|
-
emptyContent = $xeTable.callSlot(emptySlot,
|
|
7314
|
-
$table: $xeTable,
|
|
7315
|
-
$grid: $xeGrid
|
|
7316
|
-
});
|
|
7334
|
+
emptyContent = $xeTable.callSlot(emptySlot, emptyParams);
|
|
7317
7335
|
} else {
|
|
7318
7336
|
const compConf = emptyOpts.name ? body_renderer.get(emptyOpts.name) : null;
|
|
7319
7337
|
const rtEmptyView = compConf ? compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty : null;
|
|
7320
7338
|
if (rtEmptyView) {
|
|
7321
|
-
emptyContent = getSlotVNs(rtEmptyView(emptyOpts,
|
|
7322
|
-
$table: $xeTable
|
|
7323
|
-
}));
|
|
7339
|
+
emptyContent = getSlotVNs(rtEmptyView(emptyOpts, emptyParams));
|
|
7324
7340
|
} else {
|
|
7325
7341
|
emptyContent = tableProps.emptyText || body_getI18n('vxe.table.emptyText');
|
|
7326
7342
|
}
|
|
@@ -7423,12 +7439,13 @@ const renderType = 'body';
|
|
|
7423
7439
|
|
|
7424
7440
|
|
|
7425
7441
|
|
|
7442
|
+
|
|
7426
7443
|
const {
|
|
7427
7444
|
renderer: header_renderer,
|
|
7428
7445
|
renderEmptyElement: header_renderEmptyElement
|
|
7429
7446
|
} = core_.VxeUI;
|
|
7430
7447
|
const header_renderType = 'header';
|
|
7431
|
-
/* harmony default export */ var header = ((
|
|
7448
|
+
/* harmony default export */ var header = (defineVxeComponent({
|
|
7432
7449
|
name: 'VxeTableHeader',
|
|
7433
7450
|
props: {
|
|
7434
7451
|
tableData: Array,
|
|
@@ -7865,12 +7882,13 @@ const header_renderType = 'header';
|
|
|
7865
7882
|
|
|
7866
7883
|
|
|
7867
7884
|
|
|
7885
|
+
|
|
7868
7886
|
const {
|
|
7869
7887
|
renderer: footer_renderer,
|
|
7870
7888
|
renderEmptyElement: footer_renderEmptyElement
|
|
7871
7889
|
} = core_.VxeUI;
|
|
7872
7890
|
const footer_renderType = 'footer';
|
|
7873
|
-
/* harmony default export */ var footer = ((
|
|
7891
|
+
/* harmony default export */ var footer = (defineVxeComponent({
|
|
7874
7892
|
name: 'VxeTableFooter',
|
|
7875
7893
|
props: {
|
|
7876
7894
|
footerTableData: {
|
|
@@ -8460,11 +8478,20 @@ const {
|
|
|
8460
8478
|
default: () => props_getConfig().table.showFooterOverflow
|
|
8461
8479
|
},
|
|
8462
8480
|
/** 高级属性 */
|
|
8463
|
-
|
|
8481
|
+
/**
|
|
8482
|
+
* (即将废弃)columnKey 已废弃,被 column-config.useKey 替换
|
|
8483
|
+
* @deprecated
|
|
8484
|
+
*/
|
|
8464
8485
|
columnKey: Boolean,
|
|
8465
|
-
|
|
8486
|
+
/**
|
|
8487
|
+
* (即将废弃)rowKey 已废弃,被 row-config.useKey 替换
|
|
8488
|
+
* @deprecated
|
|
8489
|
+
*/
|
|
8466
8490
|
rowKey: Boolean,
|
|
8467
|
-
|
|
8491
|
+
/**
|
|
8492
|
+
* (即将废弃)rowId 已废弃,被 row-config.keyField 替换
|
|
8493
|
+
* @deprecated
|
|
8494
|
+
*/
|
|
8468
8495
|
rowId: {
|
|
8469
8496
|
type: String,
|
|
8470
8497
|
default: () => props_getConfig().table.rowId
|
|
@@ -8501,11 +8528,17 @@ const {
|
|
|
8501
8528
|
rowConfig: Object,
|
|
8502
8529
|
// 数据聚合配置项
|
|
8503
8530
|
aggregateConfig: Object,
|
|
8504
|
-
|
|
8531
|
+
/**
|
|
8532
|
+
* 已废弃,被 aggregateConfig 替换
|
|
8533
|
+
* @deprecated
|
|
8534
|
+
*/
|
|
8505
8535
|
rowGroupConfig: Object,
|
|
8506
8536
|
// 当前行配置项
|
|
8507
8537
|
currentRowConfig: Object,
|
|
8508
|
-
|
|
8538
|
+
/**
|
|
8539
|
+
* 已废弃,被 rowDragConfig 替换
|
|
8540
|
+
* @deprecated
|
|
8541
|
+
*/
|
|
8509
8542
|
dragConfig: Object,
|
|
8510
8543
|
// 行拖拽排序配置项
|
|
8511
8544
|
rowDragConfig: Object,
|
|
@@ -8559,9 +8592,15 @@ const {
|
|
|
8559
8592
|
emptyRender: Object,
|
|
8560
8593
|
// 自定义列配置项
|
|
8561
8594
|
customConfig: Object,
|
|
8562
|
-
|
|
8595
|
+
/**
|
|
8596
|
+
* (即将废弃)横向虚拟滚动配置项
|
|
8597
|
+
* @deprecated
|
|
8598
|
+
*/
|
|
8563
8599
|
scrollX: Object,
|
|
8564
|
-
|
|
8600
|
+
/**
|
|
8601
|
+
* (即将废弃)纵向虚拟滚动配置项
|
|
8602
|
+
* @deprecated
|
|
8603
|
+
*/
|
|
8565
8604
|
scrollY: Object,
|
|
8566
8605
|
// 横向虚拟滚动配置项
|
|
8567
8606
|
virtualXConfig: Object,
|
|
@@ -8596,12 +8635,13 @@ const {
|
|
|
8596
8635
|
|
|
8597
8636
|
|
|
8598
8637
|
|
|
8638
|
+
|
|
8599
8639
|
const {
|
|
8600
8640
|
getI18n: panel_getI18n,
|
|
8601
8641
|
getIcon: panel_getIcon,
|
|
8602
8642
|
renderEmptyElement: panel_renderEmptyElement
|
|
8603
8643
|
} = core_.VxeUI;
|
|
8604
|
-
/* harmony default export */ var panel = ((
|
|
8644
|
+
/* harmony default export */ var panel = (defineVxeComponent({
|
|
8605
8645
|
name: 'TableCustomPanel',
|
|
8606
8646
|
props: {
|
|
8607
8647
|
customStore: {
|
|
@@ -9091,9 +9131,15 @@ const {
|
|
|
9091
9131
|
};
|
|
9092
9132
|
const renderSimplePanel = () => {
|
|
9093
9133
|
const $xeGrid = $xeTable.xeGrid;
|
|
9134
|
+
const tableProps = $xeTable.props;
|
|
9094
9135
|
const {
|
|
9095
9136
|
customStore
|
|
9096
9137
|
} = props;
|
|
9138
|
+
const {
|
|
9139
|
+
treeConfig,
|
|
9140
|
+
rowGroupConfig,
|
|
9141
|
+
aggregateConfig
|
|
9142
|
+
} = tableProps;
|
|
9097
9143
|
const {
|
|
9098
9144
|
isCustomStatus,
|
|
9099
9145
|
customColumnList
|
|
@@ -9235,7 +9281,11 @@ const {
|
|
|
9235
9281
|
style: maxHeight && !['left', 'right'].includes(placement) ? {
|
|
9236
9282
|
maxHeight: `${maxHeight}px`
|
|
9237
9283
|
} : {}
|
|
9238
|
-
}, customStore.visible ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(
|
|
9284
|
+
}, customStore.visible ? [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)($xeTable.getPivotTableAggregateSimplePanel(), {
|
|
9285
|
+
customStore
|
|
9286
|
+
}) : panel_renderEmptyElement($xeTable), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9287
|
+
class: 'vxe-table-custom--handle-wrapper'
|
|
9288
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9239
9289
|
class: 'vxe-table-custom--header'
|
|
9240
9290
|
}, headerSlot ? $xeTable.callSlot(headerSlot, params) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
9241
9291
|
class: 'vxe-table-custom--panel-list'
|
|
@@ -9292,7 +9342,7 @@ const {
|
|
|
9292
9342
|
status: 'primary',
|
|
9293
9343
|
content: customOpts.confirmButtonText || panel_getI18n('vxe.table.customConfirm'),
|
|
9294
9344
|
onClick: confirmCustomEvent
|
|
9295
|
-
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]) : null] : []);
|
|
9345
|
+
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]) : null])] : []);
|
|
9296
9346
|
};
|
|
9297
9347
|
const renderPopupPanel = () => {
|
|
9298
9348
|
const $xeGrid = $xeTable.xeGrid;
|
|
@@ -9631,12 +9681,13 @@ const {
|
|
|
9631
9681
|
|
|
9632
9682
|
|
|
9633
9683
|
|
|
9684
|
+
|
|
9634
9685
|
const {
|
|
9635
9686
|
getI18n: filter_panel_getI18n,
|
|
9636
9687
|
getIcon: filter_panel_getIcon,
|
|
9637
9688
|
renderer: panel_renderer
|
|
9638
9689
|
} = core_.VxeUI;
|
|
9639
|
-
/* harmony default export */ var filter_panel = ((
|
|
9690
|
+
/* harmony default export */ var filter_panel = (defineVxeComponent({
|
|
9640
9691
|
name: 'VxeTableFilterPanel',
|
|
9641
9692
|
props: {
|
|
9642
9693
|
filterStore: Object
|
|
@@ -9888,11 +9939,12 @@ var esnext_iterator_find = __webpack_require__(2577);
|
|
|
9888
9939
|
|
|
9889
9940
|
|
|
9890
9941
|
|
|
9942
|
+
|
|
9891
9943
|
const {
|
|
9892
9944
|
getI18n: import_panel_getI18n,
|
|
9893
9945
|
getIcon: import_panel_getIcon
|
|
9894
9946
|
} = core_.VxeUI;
|
|
9895
|
-
/* harmony default export */ var import_panel = ((
|
|
9947
|
+
/* harmony default export */ var import_panel = (defineVxeComponent({
|
|
9896
9948
|
name: 'VxeTableImportPanel',
|
|
9897
9949
|
props: {
|
|
9898
9950
|
defaultOptions: Object,
|
|
@@ -10109,11 +10161,12 @@ const {
|
|
|
10109
10161
|
|
|
10110
10162
|
|
|
10111
10163
|
|
|
10164
|
+
|
|
10112
10165
|
const {
|
|
10113
10166
|
getI18n: export_panel_getI18n,
|
|
10114
10167
|
getIcon: export_panel_getIcon
|
|
10115
10168
|
} = core_.VxeUI;
|
|
10116
|
-
/* harmony default export */ var export_panel = ((
|
|
10169
|
+
/* harmony default export */ var export_panel = (defineVxeComponent({
|
|
10117
10170
|
name: 'VxeTableExportPanel',
|
|
10118
10171
|
props: {
|
|
10119
10172
|
defaultOptions: Object,
|
|
@@ -10569,10 +10622,11 @@ const {
|
|
|
10569
10622
|
|
|
10570
10623
|
|
|
10571
10624
|
|
|
10625
|
+
|
|
10572
10626
|
const {
|
|
10573
10627
|
getIcon: menu_panel_getIcon
|
|
10574
10628
|
} = core_.VxeUI;
|
|
10575
|
-
/* harmony default export */ var menu_panel = ((
|
|
10629
|
+
/* harmony default export */ var menu_panel = (defineVxeComponent({
|
|
10576
10630
|
name: 'VxeTableMenuPanel',
|
|
10577
10631
|
setup(props, context) {
|
|
10578
10632
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
@@ -10693,7 +10747,7 @@ const {
|
|
|
10693
10747
|
}
|
|
10694
10748
|
}));
|
|
10695
10749
|
;// ./packages/table/src/table.ts
|
|
10696
|
-
const{getConfig: table_getConfig,getIcon: table_getIcon,getI18n: table_getI18n,renderer: table_renderer,formats: table_formats,createEvent,globalResize: table_globalResize,interceptor: table_interceptor,hooks: table_hooks,globalEvents: table_globalEvents,GLOBAL_EVENT_KEYS,useFns,renderEmptyElement: table_renderEmptyElement}=core_.VxeUI;const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;/* harmony default export */ var table = ((
|
|
10750
|
+
const{getConfig: table_getConfig,getIcon: table_getIcon,getI18n: table_getI18n,renderer: table_renderer,formats: table_formats,createEvent,globalResize: table_globalResize,interceptor: table_interceptor,hooks: table_hooks,globalEvents: table_globalEvents,GLOBAL_EVENT_KEYS,useFns,renderEmptyElement: table_renderEmptyElement}=core_.VxeUI;const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;/* harmony default export */ var table = (defineVxeComponent({name:'VxeTable',props:src_props,emits:emits,setup(props,context){const{slots,emit}=context;const xID=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();const browseObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();// 使用已安装的组件,如果未安装则不渲染
|
|
10697
10751
|
const VxeUILoadingComponent=core_.VxeUI.getComponent('VxeLoading');const VxeUITooltipComponent=core_.VxeUI.getComponent('VxeTooltip');const $xeTabs=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTabs',null);const{computeSize}=useFns.useSize(props);const reactData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({// 低性能的静态列
|
|
10698
10752
|
staticColumns:[],// 渲染的列分组
|
|
10699
10753
|
tableGroupColumn:[],// 可视区渲染的列
|
|
@@ -10733,7 +10787,7 @@ focused:{row:null,column:null}},// 存放 tooltip 相关信息
|
|
|
10733
10787
|
tooltipStore:{row:null,column:null,content:null,visible:false,currOpts:{}},// 存放数据校验相关信息
|
|
10734
10788
|
validStore:{visible:false},validErrorMaps:{},// 导入相关信息
|
|
10735
10789
|
importStore:{inited:false,file:null,type:'',modeList:[],typeList:[],filename:'',visible:false},importParams:{mode:'',types:null,message:true},// 导出相关信息
|
|
10736
|
-
exportStore:{inited:false,name:'',modeList:[],typeList:[],columns:[],isPrint:false,hasFooter:false,hasMerge:false,hasTree:false,hasColgroup:false,visible:false},exportParams:{filename:'',sheetName:'',mode:'',type:'',isColgroup:false,isMerge:false,isAllExpand:false,useStyle:false,original:false,message:true,isHeader:false,isTitle:false,isFooter:false},visiblwRowsFlag:1,isRowGroupStatus:false,rowGroupList:[],rowGroupExpandedFlag:1,rowExpandedFlag:1,treeExpandedFlag:1,updateCheckboxFlag:1,pendingRowFlag:1,insertRowFlag:1,removeRowFlag:1,mergeBodyFlag:1,mergeFootFlag:1,rowHeightStore:{large:52,default:48,medium:44,small:40,mini:36},scrollVMLoading:false,scrollYHeight:0,scrollYTop:0,isScrollYBig:false,scrollXLeft:0,scrollXWidth:0,isScrollXBig:false,rowExpandHeightFlag:1,calcCellHeightFlag:1,resizeHeightFlag:1,resizeWidthFlag:1,isCustomStatus:false,isDragRowMove:false,dragRow:null,isDragColMove:false,dragCol:null,dragTipText:'',isDragResize:false,isRowLoading:false,isColLoading:false});const internalData={tZindex:0,currKeyField:'',isCurrDeepKey:false,elemStore:{},// 存放横向 X 虚拟滚动相关的信息
|
|
10790
|
+
exportStore:{inited:false,name:'',modeList:[],typeList:[],columns:[],isPrint:false,hasFooter:false,hasMerge:false,hasTree:false,hasColgroup:false,visible:false},exportParams:{filename:'',sheetName:'',mode:'',type:'',isColgroup:false,isMerge:false,isAllExpand:false,useStyle:false,original:false,message:true,isHeader:false,isTitle:false,isFooter:false},visiblwRowsFlag:1,isRowGroupStatus:false,rowGroupList:[],aggHandleFields:[],rowGroupExpandedFlag:1,rowExpandedFlag:1,treeExpandedFlag:1,updateCheckboxFlag:1,pendingRowFlag:1,insertRowFlag:1,removeRowFlag:1,mergeBodyFlag:1,mergeFootFlag:1,rowHeightStore:{large:52,default:48,medium:44,small:40,mini:36},scrollVMLoading:false,scrollYHeight:0,scrollYTop:0,isScrollYBig:false,scrollXLeft:0,scrollXWidth:0,isScrollXBig:false,rowExpandHeightFlag:1,calcCellHeightFlag:1,resizeHeightFlag:1,resizeWidthFlag:1,isCustomStatus:false,isDragRowMove:false,dragRow:null,isDragColMove:false,dragCol:null,dragTipText:'',isDragResize:false,isRowLoading:false,isColLoading:false});const internalData={tZindex:0,currKeyField:'',isCurrDeepKey:false,elemStore:{},// 存放横向 X 虚拟滚动相关的信息
|
|
10737
10791
|
scrollXStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},// 存放纵向 Y 虚拟滚动相关信息
|
|
10738
10792
|
scrollYStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},// 表格宽度
|
|
10739
10793
|
tableWidth:0,// 表格高度
|
|
@@ -10774,16 +10828,16 @@ removeRowMaps:{},cvCacheMaps:{},inited:false,tooltipTimeout:null,initStatus:fals
|
|
|
10774
10828
|
* @deprecated
|
|
10775
10829
|
*/const computeSXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualXOpts=computeVirtualXOpts.value;return virtualXOpts;});const computeScrollXThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualXOpts=computeVirtualXOpts.value;const{threshold}=virtualXOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});/**
|
|
10776
10830
|
* @deprecated
|
|
10777
|
-
*/const computeSYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;return virtualYOpts;});const computeVirtualXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.virtualXConfig||table_getConfig().table.scrollX,props.virtualXConfig||props.scrollX);});const computeVirtualYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.virtualYConfig||table_getConfig().table.scrollY,props.virtualYConfig||props.scrollY);});const computeScrollbarOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXToTop=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.x&&scrollbarOpts.x.position==='top');});const computeScrollbarYToLeft=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.y&&scrollbarOpts.y.position==='left');});const computeScrollYThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const cellOpts=Object.assign({},table_getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const headerCellOpts=Object.assign({},table_getConfig().table.headerCellConfig,props.headerCellConfig);const cellOpts=computeCellOpts.value;headerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCellHeight(headerCellOpts.height||cellOpts.height));return headerCellOpts;});const computeFooterCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const footerCellOpts=Object.assign({},table_getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCellHeight(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateConfig||table_getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return computeAggregateOpts.value;});const computeCurrentRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({startIndex:0},table_getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.tooltipConfig,props.tooltipConfig);});const computeTableTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editConfig,props.editConfig);});const computeSortOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({orders:['asc','desc',null]},table_getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.filterConfig,props.filterConfig);});const computeMouseOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.clipConfig,props.clipConfig);});const computeFNROpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeHeaderMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerOpts=menuOpts.header;return headerOpts&&headerOpts.options?headerOpts.options:[];});const computeBodyMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const bodyOpts=menuOpts.body;return bodyOpts&&bodyOpts.options?bodyOpts.options:[];});const computeFooterMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const footerOpts=menuOpts.footer;return footerOpts&&footerOpts.options?footerOpts.options:[];});const computeIsMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerMenu=computeHeaderMenu.value;const bodyMenu=computeBodyMenu.value;const footerMenu=computeFooterMenu.value;return!!(props.menuConfig&&isEnableConf(menuOpts)&&(headerMenu.length||bodyMenu.length||footerMenu.length));});const computeMenuList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{ctxMenuStore}=reactData;const rest=[];ctxMenuStore.list.forEach(list=>{list.forEach(item=>{rest.push(item);});});return rest;});const computeExportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.exportConfig,props.exportConfig);});const computeImportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.importConfig,props.importConfig);});const computePrintOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.printConfig,props.printConfig);});const computeExpandOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.expandConfig,props.expandConfig);});const computeTreeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.treeConfig,props.treeConfig);});const computeEmptyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.emptyRender,props.emptyRender);});const computeLoadingOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.loadingConfig,props.loadingConfig);});const computeCellOffsetWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return props.border?Math.max(2,Math.ceil(reactData.scrollbarWidth/reactData.tableColumn.length)):1;});const computeCustomOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.customConfig,props.customConfig);});const computeTableRowExpandedList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{treeConfig}=props;const{rowExpandedFlag,expandColumn,rowGroupExpandedFlag,treeExpandedFlag,isRowGroupStatus}=reactData;const{visibleDataRowIdData,rowExpandedMaps}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const expandList=[];if(expandColumn&&rowExpandedFlag&&rowGroupExpandedFlag&&treeExpandedFlag){if(isRowGroupStatus||treeConfig&&transform){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps,(row,rowid)=>{if(visibleDataRowIdData[rowid]){expandList.push(row);}});}else{return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().values(rowExpandedMaps);}}return expandList;});const computeAutoWidthColumnList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{visibleColumn}=internalData;const{tableColumn}=reactData;return tableColumn.length||visibleColumn.length?visibleColumn.filter(column=>column.width==='auto'||column.minWidth==='auto'):[];});const computeFixedColumnSize=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tableColumn}=reactData;const{collectColumn}=internalData;let fixedSize=0;// 只判断第一层
|
|
10831
|
+
*/const computeSYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;return virtualYOpts;});const computeVirtualXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.virtualXConfig||table_getConfig().table.scrollX,props.virtualXConfig||props.scrollX);});const computeVirtualYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.virtualYConfig||table_getConfig().table.scrollY,props.virtualYConfig||props.scrollY);});const computeScrollbarOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXToTop=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.x&&scrollbarOpts.x.position==='top');});const computeScrollbarYToLeft=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.y&&scrollbarOpts.y.position==='left');});const computeScrollYThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const cellOpts=Object.assign({},table_getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const headerCellOpts=Object.assign({},table_getConfig().table.headerCellConfig,props.headerCellConfig);const cellOpts=computeCellOpts.value;headerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCellHeight(headerCellOpts.height||cellOpts.height));return headerCellOpts;});const computeFooterCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const footerCellOpts=Object.assign({},table_getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCellHeight(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateConfig||table_getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return computeAggregateOpts.value;});const computeCurrentRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({startIndex:0},table_getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.tooltipConfig,props.tooltipConfig);});const computeTableTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editConfig,props.editConfig);});const computeSortOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({orders:['asc','desc',null]},table_getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.filterConfig,props.filterConfig);});const computeMouseOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.clipConfig,props.clipConfig);});const computeFNROpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeHeaderMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerOpts=menuOpts.header;return headerOpts&&headerOpts.options?headerOpts.options:[];});const computeBodyMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const bodyOpts=menuOpts.body;return bodyOpts&&bodyOpts.options?bodyOpts.options:[];});const computeFooterMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const footerOpts=menuOpts.footer;return footerOpts&&footerOpts.options?footerOpts.options:[];});const computeIsMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerMenu=computeHeaderMenu.value;const bodyMenu=computeBodyMenu.value;const footerMenu=computeFooterMenu.value;return!!(props.menuConfig&&isEnableConf(menuOpts)&&(headerMenu.length||bodyMenu.length||footerMenu.length));});const computeMenuList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{ctxMenuStore}=reactData;const rest=[];ctxMenuStore.list.forEach(list=>{list.forEach(item=>{rest.push(item);});});return rest;});const computeExportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.exportConfig,props.exportConfig);});const computeImportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.importConfig,props.importConfig);});const computePrintOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.printConfig,props.printConfig);});const computeExpandOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.expandConfig,props.expandConfig);});const computeTreeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.treeConfig,props.treeConfig);});const computeEmptyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.emptyRender,props.emptyRender);});const computeLoadingOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.loadingConfig,props.loadingConfig);});const computeCellOffsetWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return props.border?Math.max(2,Math.ceil(reactData.scrollbarWidth/reactData.tableColumn.length)):1;});const computeCustomOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.customConfig,props.customConfig);});const computeTableRowExpandedList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{rowExpandedFlag,expandColumn,rowGroupExpandedFlag,treeExpandedFlag}=reactData;const{visibleDataRowIdData,rowExpandedMaps}=internalData;const expandList=[];if(expandColumn&&rowExpandedFlag&&rowGroupExpandedFlag&&treeExpandedFlag){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps,(row,rowid)=>{if(visibleDataRowIdData[rowid]){expandList.push(row);}});}return expandList;});const computeAutoWidthColumnList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{visibleColumn}=internalData;const{tableColumn}=reactData;return tableColumn.length||visibleColumn.length?visibleColumn.filter(column=>column.width==='auto'||column.minWidth==='auto'):[];});const computeFixedColumnSize=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tableColumn}=reactData;const{collectColumn}=internalData;let fixedSize=0;// 只判断第一层
|
|
10778
10832
|
if(tableColumn.length&&collectColumn.length){collectColumn.forEach(column=>{if(column.renderFixed){fixedSize++;}});}return fixedSize;});const computeIsMaxFixedColumn=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const fixedColumnSize=computeFixedColumnSize.value;const columnOpts=computeColumnOpts.value;const{maxFixedSize}=columnOpts;if(maxFixedSize){return fixedColumnSize>=maxFixedSize;}return false;});const computeTableBorder=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{border}=props;if(border===true){return'full';}if(border){return border;}return'default';});const computeIsAllCheckboxDisabled=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{treeConfig}=props;const{tableData}=reactData;const{tableFullData}=internalData;const checkboxOpts=computeCheckboxOpts.value;const{strict,checkMethod}=checkboxOpts;if(strict){if(tableData.length||tableFullData.length){if(checkMethod){if(treeConfig){// 暂时不支持树形结构
|
|
10779
10833
|
}// 如果所有行都被禁用
|
|
10780
|
-
return tableFullData.every(row=>!checkMethod({$table:$xeTable,row}));}return false;}return true;}return false;});const computeVirtualScrollBars=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{overflowX,scrollXLoad,overflowY,scrollYLoad}=reactData;return{x:overflowX&&scrollXLoad,y:overflowY&&scrollYLoad};});const computeRowGroupFields=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const rowGroupOpts=computeRowGroupOpts.value;return rowGroupOpts.groupFields;});const refMaps={refElem,refTooltip,refValidTooltip,refTableFilter,refTableCustom,refTableMenu,refTableHeader,refTableBody,refTableFooter,refTableLeftHeader,refTableLeftBody,refTableLeftFooter,refTableRightHeader,refTableRightBody,refTableRightFooter,refLeftContainer,refRightContainer,refColResizeBar,refRowResizeBar,refScrollXVirtualElem,refScrollYVirtualElem,refScrollXHandleElem,refScrollYHandleElem,refScrollXSpaceElem,refScrollYSpaceElem};const computeMaps={computeSize,computeTableId,computeValidOpts,computeRowField,computeVirtualXOpts,computeVirtualYOpts,computeScrollbarOpts,computeScrollbarXToTop,computeScrollbarYToLeft,computeColumnOpts,computeCurrentColumnOpts,computeScrollXThreshold,computeScrollYThreshold,computeRowHeightMaps,computeDefaultRowHeight,computeCellOpts,computeHeaderCellOpts,computeFooterCellOpts,computeRowOpts,computeAggregateOpts,computeRowGroupOpts,computeCurrentRowOpts,computeRowDragOpts,computeColumnDragOpts,computeResizeOpts,computeResizableOpts,computeSeqOpts,computeRadioOpts,computeCheckboxOpts,computeTooltipOpts,computeEditOpts,computeSortOpts,computeFilterOpts,computeMouseOpts,computeAreaOpts,computeKeyboardOpts,computeClipOpts,computeFNROpts,computeHeaderMenu,computeBodyMenu,computeFooterMenu,computeIsMenu,computeMenuList,computeMenuOpts,computeExportOpts,computeImportOpts,computePrintOpts,computeExpandOpts,computeTreeOpts,computeEmptyOpts,computeLoadingOpts,computeCellOffsetWidth,computeCustomOpts,computeLeftFixedWidth,computeRightFixedWidth,computeFixedColumnSize,computeIsMaxFixedColumn,computeIsAllCheckboxDisabled,computeVirtualScrollBars,computeSXOpts,computeSYOpts};const $xeTable={xID,props:props,context,reactData,internalData,getRefMaps:()=>refMaps,getComputeMaps:()=>computeMaps,xeGrid:$xeGrid,xegrid:$xeGrid};const eqCellValue=(row1,row2,field)=>{const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row1,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row2,field);if(eqEmptyValue(val1)&&eqEmptyValue(val2)){return true;}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)){return''+val1===''+val2;}return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);};const handleKeyField=()=>{const keyField=computeRowField.value;internalData.currKeyField=keyField;internalData.isCurrDeepKey=hasDeepKey(keyField);};const getNextSortOrder=column=>{const sortOpts=computeSortOpts.value;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=table_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=table_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=keyMaps=>{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;};const handleReserveRow=reserveRowMap=>{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]&&$xeTable.findRowIndexOf(reserveList,fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;};const handleVirtualXVisible=()=>{const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=computeLeftFixedWidth.value;const rightFixedWidth=computeRightFixedWidth.value;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(1,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};};const calcVarRowHeightConfig=(sizeKey,sizeEl)=>{const{rowHeightStore}=reactData;if(sizeEl&&sizeEl.clientHeight){rowHeightStore[sizeKey]=sizeEl.clientHeight;}};const computeRowHeight=()=>{const{isAllOverflow}=reactData;const tableHeader=refTableHeader.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;const defaultRowHeight=computeDefaultRowHeight.value;let rowHeight=0;if(isAllOverflow){if(tableBodyElem){const tableHeaderElem=tableHeader?tableHeader.$el:null;let firstTrElem;firstTrElem=tableBodyElem.querySelector('tr');if(!firstTrElem&&tableHeaderElem){firstTrElem=tableHeaderElem.querySelector('tr');}if(firstTrElem){rowHeight=firstTrElem.clientHeight;}}if(!rowHeight){rowHeight=defaultRowHeight;}}else{rowHeight=defaultRowHeight;}// 最低支持 18px 行高
|
|
10834
|
+
return tableFullData.every(row=>!checkMethod({$table:$xeTable,row}));}return false;}return true;}return false;});const computeVirtualScrollBars=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{overflowX,scrollXLoad,overflowY,scrollYLoad}=reactData;return{x:overflowX&&scrollXLoad,y:overflowY&&scrollYLoad};});const computeRowGroupFields=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const rowGroupOpts=computeRowGroupOpts.value;return rowGroupOpts.groupFields;});const computeRowGroupColumns=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{rowGroupList}=reactData;const{fullColumnFieldData}=internalData;const rgColumns=[];rowGroupList.forEach(aggConf=>{const colRest=fullColumnFieldData[aggConf.field];if(colRest){rgColumns.push(colRest.column);}});return rgColumns;});const refMaps={refElem,refTooltip,refValidTooltip,refTableFilter,refTableCustom,refTableMenu,refTableHeader,refTableBody,refTableFooter,refTableLeftHeader,refTableLeftBody,refTableLeftFooter,refTableRightHeader,refTableRightBody,refTableRightFooter,refLeftContainer,refRightContainer,refColResizeBar,refRowResizeBar,refScrollXVirtualElem,refScrollYVirtualElem,refScrollXHandleElem,refScrollYHandleElem,refScrollXSpaceElem,refScrollYSpaceElem};const computeMaps={computeSize,computeTableId,computeValidOpts,computeRowField,computeVirtualXOpts,computeVirtualYOpts,computeScrollbarOpts,computeScrollbarXToTop,computeScrollbarYToLeft,computeColumnOpts,computeCurrentColumnOpts,computeScrollXThreshold,computeScrollYThreshold,computeRowHeightMaps,computeDefaultRowHeight,computeCellOpts,computeHeaderCellOpts,computeFooterCellOpts,computeRowOpts,computeAggregateOpts,computeRowGroupOpts,computeCurrentRowOpts,computeRowDragOpts,computeColumnDragOpts,computeResizeOpts,computeResizableOpts,computeSeqOpts,computeRadioOpts,computeCheckboxOpts,computeTooltipOpts,computeEditOpts,computeSortOpts,computeFilterOpts,computeMouseOpts,computeAreaOpts,computeKeyboardOpts,computeClipOpts,computeFNROpts,computeHeaderMenu,computeBodyMenu,computeFooterMenu,computeIsMenu,computeMenuList,computeMenuOpts,computeExportOpts,computeImportOpts,computePrintOpts,computeExpandOpts,computeTreeOpts,computeEmptyOpts,computeLoadingOpts,computeCellOffsetWidth,computeCustomOpts,computeLeftFixedWidth,computeRightFixedWidth,computeFixedColumnSize,computeIsMaxFixedColumn,computeIsAllCheckboxDisabled,computeVirtualScrollBars,computeRowGroupFields,computeRowGroupColumns,computeSXOpts,computeSYOpts};const $xeTable={xID,props:props,context,reactData,internalData,getRefMaps:()=>refMaps,getComputeMaps:()=>computeMaps,xeGrid:$xeGrid,xegrid:$xeGrid};const eqCellValue=(row1,row2,field)=>{const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row1,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row2,field);if(eqEmptyValue(val1)&&eqEmptyValue(val2)){return true;}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)){return''+val1===''+val2;}return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);};const handleKeyField=()=>{const keyField=computeRowField.value;internalData.currKeyField=keyField;internalData.isCurrDeepKey=hasDeepKey(keyField);};const hangleStorageDefaultValue=(value,isAll)=>{return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(value)?value:isAll;};const getNextSortOrder=column=>{const sortOpts=computeSortOpts.value;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=table_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=table_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=keyMaps=>{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;};const handleReserveRow=reserveRowMap=>{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]&&$xeTable.findRowIndexOf(reserveList,fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;};const handleVirtualXVisible=()=>{const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=computeLeftFixedWidth.value;const rightFixedWidth=computeRightFixedWidth.value;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(1,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};};const calcVarRowHeightConfig=(sizeKey,sizeEl)=>{const{rowHeightStore}=reactData;if(sizeEl&&sizeEl.clientHeight){rowHeightStore[sizeKey]=sizeEl.clientHeight;}};const computeRowHeight=()=>{const{isAllOverflow}=reactData;const tableHeader=refTableHeader.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;const defaultRowHeight=computeDefaultRowHeight.value;let rowHeight=0;if(isAllOverflow){if(tableBodyElem){const tableHeaderElem=tableHeader?tableHeader.$el:null;let firstTrElem;firstTrElem=tableBodyElem.querySelector('tr');if(!firstTrElem&&tableHeaderElem){firstTrElem=tableHeaderElem.querySelector('tr');}if(firstTrElem){rowHeight=firstTrElem.clientHeight;}}if(!rowHeight){rowHeight=defaultRowHeight;}}else{rowHeight=defaultRowHeight;}// 最低支持 18px 行高
|
|
10781
10835
|
return Math.max(18,rowHeight);};const handleVirtualYVisible=()=>{const{isAllOverflow,expandColumn,isScrollYBig,scrollYHeight}=reactData;const{elemStore,isResizeCellHeight,afterFullData,fullAllDataRowIdData}=internalData;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(bodyScrollElem){const clientHeight=bodyScrollElem.clientHeight;let scrollTop=bodyScrollElem.scrollTop;if(isScrollYBig){scrollTop=Math.ceil((scrollYHeight-clientHeight)*Math.min(1,scrollTop/(maxYHeight-clientHeight)));}const startTop=scrollTop;const endTop=scrollTop+clientHeight;let toVisibleIndex=-1;let visibleSize=0;const isCustomCellHeight=isResizeCellHeight||cellOpts.height||rowOpts.height;if(!isCustomCellHeight&&!expandColumn&&isAllOverflow){toVisibleIndex=Math.floor(startTop/defaultRowHeight)-1;visibleSize=Math.ceil(clientHeight/defaultRowHeight)+1;}else{const{handleGetRowId}=createHandleGetRowId($xeTable);let leftIndex=0;let rightIndex=afterFullData.length;while(leftIndex<rightIndex){const rIndex=Math.floor((leftIndex+rightIndex)/2);const row=afterFullData[rIndex];const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid]||{};if(rowRest.oTop<=startTop){leftIndex=rIndex+1;}else{rightIndex=rIndex;}}toVisibleIndex=leftIndex===afterFullData.length?leftIndex:Math.max(0,leftIndex<afterFullData.length?leftIndex-2:0);for(let rIndex=toVisibleIndex,rLen=afterFullData.length;rIndex<rLen;rIndex++){const row=afterFullData[rIndex];const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid]||{};visibleSize++;if(rowRest.oTop>endTop||visibleSize>=100){break;}}}return{toVisibleIndex:Math.max(0,toVisibleIndex),visibleSize:Math.max(6,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};};const calculateMergerOffsetIndex=(list,offsetItem,type)=>{for(let mcIndex=0,len=list.length;mcIndex<len;mcIndex++){const mergeItem=list[mcIndex];const{startIndex,endIndex}=offsetItem;const mergeStartIndex=mergeItem[type];const mergeSpanNumber=mergeItem[type+'span'];const mergeEndIndex=mergeStartIndex+mergeSpanNumber;if(mergeStartIndex<startIndex&&startIndex<mergeEndIndex){offsetItem.startIndex=mergeStartIndex;}if(mergeStartIndex<endIndex&&endIndex<mergeEndIndex){offsetItem.endIndex=mergeEndIndex;}if(offsetItem.startIndex!==startIndex||offsetItem.endIndex!==endIndex){mcIndex=-1;}}};function buildMergeData(mergeConfigs){const mergeMaps={};if(mergeConfigs&&mergeConfigs.length){for(let mIndex=0;mIndex<mergeConfigs.length;mIndex++){const{row:_rowIndex,col:_columnIndex,rowspan:mergeRowspan,colspan:mergeColspan}=mergeConfigs[mIndex];for(let i=0;i<mergeRowspan;i++){for(let j=0;j<mergeColspan;j++){mergeMaps[`${_rowIndex+i}:${_columnIndex+j}`]=!i&&!j?{rowspan:mergeRowspan,colspan:mergeColspan}:{rowspan:0,colspan:0};}}}}return mergeMaps;}const handleBodyMerge=merges=>{const{fullAllDataRowIdData,fullColumnIdData,visibleColumn,afterFullData,mergeBodyList,mergeBodyMaps}=internalData;if(merges){const{handleGetRowId}=createHandleGetRowId($xeTable);if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)){merges=[merges];}merges.forEach(item=>{let{row:margeRow,col:margeCol,rowspan,colspan}=item;let mergeRowIndex=-1;let mergeColumnIndex=-1;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)){mergeRowIndex=margeRow;}else{const rowid=margeRow?handleGetRowId(margeRow):null;const rowRest=rowid?fullAllDataRowIdData[rowid]:null;if(rowRest){mergeRowIndex=rowRest._index;}}if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)){mergeColumnIndex=margeCol;}else{const colid=margeCol?margeCol.id:null;const colRest=colid?fullColumnIdData[colid]:null;if(colRest){mergeColumnIndex=colRest._index;}}if(mergeRowIndex>-1&&mergeColumnIndex>-1&&(rowspan||colspan)){rowspan=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(rowspan)||1;colspan=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(colspan)||1;if(rowspan>1||colspan>1){const row=afterFullData[mergeRowIndex];const column=visibleColumn[mergeColumnIndex];let mergeItem=mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`];if(mergeItem){mergeItem.rowspan=rowspan;mergeItem.colspan=colspan;mergeItem._rowspan=rowspan;mergeItem._colspan=colspan;}else{mergeItem={row:mergeRowIndex,col:mergeColumnIndex,rowspan,colspan,_row:row,_col:column,_rowspan:rowspan,_colspan:colspan};mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`]=mergeItem;mergeBodyList.push(mergeItem);}}}});}};const handleFooterMerge=merges=>{const{footerTableData}=reactData;const{mergeFooterList,mergeFooterMaps,fullColumnIdData}=internalData;if(merges){const{visibleColumn}=internalData;if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)){merges=[merges];}merges.forEach(item=>{let{row:margeRow,col:margeCol,rowspan,colspan}=item;const mergeRowIndex=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)?margeRow:-1;let mergeColumnIndex=-1;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)){mergeColumnIndex=margeCol;}else{const colid=margeCol?margeCol.id:null;const colRest=colid?fullColumnIdData[colid]:null;if(colRest){mergeColumnIndex=colRest._index;}}if(mergeRowIndex>-1&&mergeColumnIndex>-1&&(rowspan||colspan)){rowspan=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(rowspan)||1;colspan=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(colspan)||1;if(rowspan>1||colspan>1){const row=footerTableData[mergeRowIndex];const column=visibleColumn[mergeColumnIndex];let mergeItem=mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`];if(mergeItem){mergeItem.rowspan=rowspan;mergeItem.colspan=colspan;mergeItem._rowspan=rowspan;mergeItem._colspan=colspan;}else{mergeItem={row:mergeRowIndex,col:mergeColumnIndex,rowspan,colspan,_row:row,_col:column,_rowspan:rowspan,_colspan:colspan};mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`]=mergeItem;mergeFooterList.push(mergeItem);}}}});}};const removeBodyMerges=merges=>{const{mergeBodyList,fullColumnIdData,fullAllDataRowIdData,mergeBodyMaps}=internalData;const rest=[];if(merges){const{handleGetRowId}=createHandleGetRowId($xeTable);if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)){merges=[merges];}merges.forEach(item=>{const{row:margeRow,col:margeCol}=item;let mergeRowIndex=-1;let mergeColumnIndex=-1;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)){mergeRowIndex=margeRow;}else{const rowid=margeRow?handleGetRowId(margeRow):null;const rowRest=rowid?fullAllDataRowIdData[rowid]:null;if(rowRest){mergeRowIndex=rowRest._index;}}if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)){mergeColumnIndex=margeCol;}else{const colid=margeCol?margeCol.id:null;const colRest=colid?fullColumnIdData[colid]:null;if(colRest){mergeColumnIndex=colRest._index;}}const mcIndex=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(mergeBodyList,item=>item.row===mergeRowIndex&&item.col===mergeColumnIndex);if(mcIndex>-1){const rItems=mergeBodyList.splice(mcIndex,1);const item=rItems[0];if(item){rest.push(rItems[0]);if(mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`]){delete mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`];}}}});}return rest;};const removeFooterMerges=merges=>{const{mergeFooterList,fullColumnIdData,mergeFooterMaps}=internalData;const rest=[];if(merges){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)){merges=[merges];}merges.forEach(item=>{const{row:margeRow,col:margeCol}=item;const mergeRowIndex=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)?margeRow:-1;let mergeColumnIndex=-1;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)){mergeColumnIndex=margeCol;}else{const colid=margeCol?margeCol.id:null;const colRest=colid?fullColumnIdData[colid]:null;if(colRest){mergeColumnIndex=colRest._index;}}const mcIndex=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(mergeFooterList,item=>item.row===mergeRowIndex&&item.col===mergeColumnIndex);if(mcIndex>-1){const rItems=mergeFooterList.splice(mcIndex,1);const item=rItems[0];if(item){rest.push(item);if(mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`]){delete mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`];}}}});}return rest;};const handleSortEvent=(evnt,sortConfs,isUpdate)=>{const sortOpts=computeSortOpts.value;const{multiple,remote,orders}=sortOpts;if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortConfs)){sortConfs=[sortConfs];}if(sortConfs&&sortConfs.length){if(!multiple){sortConfs=[sortConfs[0]];clearAllSort();}let firstColumn=null;sortConfs.forEach((confs,index)=>{let{field,order}=confs;let column=field;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(field)){column=$xeTable.getColumnByField(field);}if(!firstColumn){firstColumn=column;}if(column&&column.sortable){if(orders&&orders.indexOf(order)===-1){order=getNextSortOrder(column);}if(column.order!==order){column.order=order;}column.sortTime=Date.now()+index;}});if(isUpdate){if(!remote){$xeTable.handleTableData(true);}}if(evnt){$xeTable.handleColumnSortEvent(evnt,firstColumn);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateRowOffsetTop();$xeTable.updateCellAreas();return updateStyle();});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const clearAllSort=()=>{const{tableFullColumn}=internalData;tableFullColumn.forEach(column=>{column.order=null;});};const calcTableHeight=key=>{const{parentHeight}=reactData;const val=props[key];let num=0;if(val){if(val==='100%'||val==='auto'){num=parentHeight;}else{const excludeHeight=$xeTable.getExcludeHeight();if(isScale(val)){num=Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(val)||1)/100*parentHeight);}else{num=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(val);}num=Math.max(40,num-excludeHeight);}}return num;};const handleCustomRestore=storeData=>{let{collectColumn}=internalData;const{resizableData,sortData,visibleData,fixedData}=storeData;let hasCustomSort=false;// 处理还原
|
|
10782
10836
|
if(resizableData||sortData||visibleData||fixedData){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();// 支持一级
|
|
10783
10837
|
if(!parentColumn){if(fixedData&&fixedData[colKey]!==undefined){column.fixed=fixedData[colKey];}if(sortData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(sortData[colKey])){hasCustomSort=true;column.renderSortNumber=sortData[colKey];}}if(resizableData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])){column.resizeWidth=resizableData[colKey];}if(visibleData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])){column.visible=visibleData[colKey];}});// 如果自定义了顺序
|
|
10784
10838
|
if(hasCustomSort){collectColumn=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(collectColumn,'renderSortNumber');internalData.collectColumn=collectColumn;internalData.tableFullColumn=getColumnList(collectColumn);}reactData.isCustomStatus=true;}else{reactData.isCustomStatus=false;}};/**
|
|
10785
10839
|
* 还原自定义列操作状态
|
|
10786
|
-
*/const restoreCustomStorage=()=>{const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{storage,restoreStore}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{});const isCustomResizable=
|
|
10840
|
+
*/const restoreCustomStorage=()=>{const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{storage,restoreStore,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);if((customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){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(storeData);}).catch(e=>e);}else{return handleCustomRestore(storeData);}}};/**
|
|
10787
10841
|
* 更新数据列的 Map
|
|
10788
10842
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
10789
10843
|
*/const cacheColumnMap=()=>{const{tableFullColumn,collectColumn}=internalData;const fullColumnIdData=internalData.fullColumnIdData={};const fullColumnFieldData=internalData.fullColumnFieldData={};const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const columnOpts=computeColumnOpts.value;const columnDragOpts=computeColumnDragOpts.value;const virtualYOpts=computeVirtualYOpts.value;const{isCrossDrag,isSelfToChildDrag}=columnDragOpts;const customOpts=computeCustomOpts.value;const{storage}=customOpts;const rowOpts=computeRowOpts.value;const isGroup=collectColumn.some(hasChildrenList);let isAllOverflow=!!props.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(fullColumnFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColumnFieldData[field]=rest;}else{if(storage&&!type||columnOpts.drag&&(isCrossDrag||isSelfToChildDrag)){errLog('vxe.error.reqProp',[`${column.getTitle()||type||''} -> column.field=?`]);}}if(!hasFixed&&fixed){hasFixed=fixed;}if(!htmlColumn&&type==='html'){htmlColumn=column;}if(treeNode){if(treeNodeColumn){warnLog('vxe.error.colRepet',['tree-node',treeNode]);}if(!treeNodeColumn){treeNodeColumn=column;}}if(rowGroupNode){if(treeNodeColumn){warnLog('vxe.error.colRepet',['row-group-node',rowGroupNode]);}if(!rowGroupColumn){rowGroupColumn=column;}}if(type==='expand'){if(expandColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!expandColumn){expandColumn=column;}}if(type==='checkbox'){if(checkboxColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!checkboxColumn){checkboxColumn=column;}}else if(type==='radio'){if(radioColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!radioColumn){radioColumn=column;}}if(isAllOverflow&&column.showOverflow===false){isAllOverflow=false;}if(fullColumnIdData[colid]){errLog('vxe.error.colRepet',['colId',colid]);}fullColumnIdData[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&&expandOpts.mode!=='fixed'&&virtualYOpts.enabled){warnLog('vxe.error.notConflictProp',['column.type="expand','virtual-y-config.enabled=false']);}if(expandColumn&&expandOpts.mode!=='fixed'&&mouseOpts.area){errLog('vxe.error.errConflicts',['mouse-config.area','column.type=expand']);}if(htmlColumn){if(!columnOpts.useKey){errLog('vxe.error.reqProp',['column-config.useKey & column.type=html']);}if(!rowOpts.useKey){errLog('vxe.error.reqProp',['row-config.useKey & column.type=html']);}}reactData.isGroup=isGroup;reactData.rowGroupColumn=rowGroupColumn;reactData.treeNodeColumn=treeNodeColumn;reactData.expandColumn=expandColumn;reactData.isAllOverflow=isAllOverflow;};const updateHeight=()=>{internalData.customHeight=calcTableHeight('height');internalData.customMinHeight=calcTableHeight('minHeight');internalData.customMaxHeight=calcTableHeight('maxHeight');// 如果启用虚拟滚动,默认高度
|
|
@@ -10899,7 +10953,7 @@ const computeScrollLoad=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_
|
|
|
10899
10953
|
if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible();const offsetXSize=Math.max(0,virtualXOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize):0);scrollXStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);scrollXStore.offsetSize=offsetXSize;scrollXStore.visibleSize=visibleXSize;scrollXStore.endIndex=Math.max(scrollXStore.startIndex+scrollXStore.visibleSize+offsetXSize,scrollXStore.endIndex);scrollXStore.visibleStartIndex=Math.max(scrollXStore.startIndex,toXVisibleIndex);scrollXStore.visibleEndIndex=Math.min(scrollXStore.endIndex,toXVisibleIndex+visibleXSize);$xeTable.updateScrollXData().then(()=>{loadScrollXData();});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
|
|
10900
10954
|
const rowHeight=computeRowHeight();scrollYStore.rowHeight=rowHeight;// 已废弃
|
|
10901
10955
|
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible();if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData();});}else{$xeTable.updateScrollYSpace();}});};const calcScrollbar=()=>{const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=computeScrollbarOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=scrollbarOpts.width||yHandleEl.offsetWidth-yHandleEl.clientWidth||14;}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=scrollbarOpts.height||xHandleEl.offsetHeight-xHandleEl.clientHeight||14;}const headerHeight=headerTableElem?headerTableElem.clientHeight:0;const footerHeight=footerTableElem?footerTableElem.clientHeight:0;internalData.tableHeight=bodyWrapperElem.offsetHeight;internalData.headerHeight=headerHeight;internalData.footerHeight=footerHeight;reactData.overflowX=overflowX;reactData.parentHeight=Math.max(internalData.headerHeight+footerHeight+20,$xeTable.getParentHeight());}if(overflowX){$xeTable.checkScrolling();}};const handleRecalculateLayout=reFull=>{const el=refElem.value;internalData.rceRunTime=Date.now();if(!el||!el.clientWidth){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const varEl=refVarElem.value;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig('default',defEl);calcVarRowHeightConfig('medium',mediumEl);calcVarRowHeightConfig('small',smallEl);calcVarRowHeightConfig('mini',miniEl);}calcCellWidth();autoCellWidth();calcScrollbar();updateStyle();updateRowExpandStyle();return computeScrollLoad().then(()=>{// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
10902
|
-
calcCellWidth();if(reFull){autoCellWidth();}calcScrollbar();updateStyle();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};const handleUpdateRowGroup=groupFields=>{
|
|
10956
|
+
calcCellWidth();if(reFull){autoCellWidth();}calcScrollbar();updateStyle();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};const handleUpdateRowGroup=groupFields=>{const aggFields=[];const aggConfs=[];if(groupFields){(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).forEach(field=>{aggFields.push(field);aggConfs.push({field});});}reactData.rowGroupList=aggConfs;reactData.aggHandleFields=aggFields;};const handleeGroupSummary=aggList=>{const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if(mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(aggList,aggRow=>{let count=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(aggRow[mapChildrenField],row=>{if(row.isAggregate){count+=row.childCount||0;}else{count++;}});aggRow.childCount=count;});if($xeTable.handlePivotTableAggregateData){$xeTable.handlePivotTableAggregateData(aggList);}}};const updateGroupData=()=>{const{aggregateConfig,rowGroupConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if((aggregateConfig||rowGroupConfig)&&isRowGroupStatus){const aggList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row.isAggregate){aggList.push(row);}},{children:mapChildrenField});handleeGroupSummary(aggList);}};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const aggregateOpts=computeAggregateOpts.value;const{rowField,parentField,childrenField,mapChildrenField}=aggregateOpts;const checkboxOpts=computeCheckboxOpts.value;const{checkField}=checkboxOpts;const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const rgItem=rowGroups[0];if(rgItem&&rowField&&parentField&&childrenField&&mapChildrenField){fullData=[];treeData=[];const groupField=rgItem.field;const groupColumn=$xeTable.getColumnByField(groupField);const groupMaps={};const aggList=[];const rowkey=getRowkey($xeTable);list.forEach(row=>{const cellValue=groupColumn?$xeTable.getCellLabel(row,groupColumn):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,groupField);const groupValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':cellValue;let childList=groupMaps[groupValue];if(!childList){childList=[];groupMaps[groupValue]=childList;}if(row.isAggregate){row.isAggregate=undefined;}childList.push(row);});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(groupMaps,(childList,groupValue)=>{const{fullData:childFullData,treeData:childTreeData}=handleGroupData(childList,rowGroups.slice(1));const aggRow={isAggregate:true,aggData:{},groupContent:groupValue,groupField,childCount:0,[rowField]:getRowUniqueId(),[parentField]:null,[rowkey]:getRowUniqueId(),[childrenField]:childTreeData,[mapChildrenField]:childTreeData};if(checkField){aggRow[checkField]=false;}if(indeterminateField){aggRow[indeterminateField]=false;}aggList.push(aggRow);treeData.push(aggRow);fullData.push(aggRow);if(childFullData.length){fullData.push(...childFullData);}});handleeGroupSummary(aggList);}}return{treeData,fullData};};/**
|
|
10903
10957
|
* 加载表格数据
|
|
10904
10958
|
* @param {Array} datas 数据
|
|
10905
10959
|
*/const loadTableData=(datas,isReset)=>{const{keepSource,treeConfig,rowGroupConfig,aggregateConfig}=props;const{rowGroupList,scrollYLoad:oldScrollYLoad}=reactData;const{scrollYStore,scrollXStore,lastScrollLeft,lastScrollTop}=internalData;const rowOpts=computeRowOpts.value;const treeOpts=computeTreeOpts.value;const expandOpts=computeExpandOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;let treeData=[];let fullData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas?datas.slice(0):[]);// 转为响应式数据
|
|
@@ -10909,7 +10963,9 @@ if(!treeOpts.rowField){errLog('vxe.error.reqProp',['tree-config.rowField']);}if(
|
|
|
10909
10963
|
// warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.children}`])
|
|
10910
10964
|
// }
|
|
10911
10965
|
// })
|
|
10912
|
-
treeData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullData,{key:treeOpts.rowField,parentKey:treeOpts.parentField,children:childrenField,mapChildren:treeOpts.mapChildrenField});fullData=treeData.slice(0);}else{treeData=fullData.slice(0);}}else if((aggregateConfig||rowGroupConfig)&&rowGroupList.length){const groupRest=handleGroupData(fullData,rowGroupList);treeData=groupRest.treeData;fullData=groupRest.fullData;isRGroup=true;}reactData.isRowGroupStatus=isRGroup;scrollYStore.startIndex=0;scrollYStore.endIndex=1;scrollXStore.startIndex=0;scrollXStore.endIndex=1;internalData.cvCacheMaps={};reactData.isRowLoading=true;reactData.scrollVMLoading=false
|
|
10966
|
+
treeData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullData,{key:treeOpts.rowField,parentKey:treeOpts.parentField,children:childrenField,mapChildren:treeOpts.mapChildrenField});fullData=treeData.slice(0);}else{treeData=fullData.slice(0);}}else if((aggregateConfig||rowGroupConfig)&&rowGroupList.length){const groupRest=handleGroupData(fullData,rowGroupList);treeData=groupRest.treeData;fullData=groupRest.fullData;isRGroup=true;}reactData.isRowGroupStatus=isRGroup;scrollYStore.startIndex=0;scrollYStore.endIndex=1;scrollXStore.startIndex=0;scrollXStore.endIndex=1;internalData.cvCacheMaps={};reactData.isRowLoading=true;reactData.scrollVMLoading=false;// internalData.treeExpandedMaps = {}
|
|
10967
|
+
reactData.treeExpandedFlag++;// internalData.rowExpandedMaps = {}
|
|
10968
|
+
reactData.rowExpandedFlag++;internalData.insertRowMaps={};reactData.insertRowFlag++;internalData.removeRowMaps={};reactData.removeRowFlag++;const sYLoad=updateScrollYStatus(fullData);reactData.isDragColMove=false;reactData.isDragRowMove=false;// 全量数据
|
|
10913
10969
|
internalData.tableFullData=fullData;internalData.tableFullTreeData=isRGroup?[]:treeData;internalData.tableFullGroupData=isRGroup?treeData:[];// 缓存数据
|
|
10914
10970
|
$xeTable.cacheRowMap(isReset);// 原始数据
|
|
10915
10971
|
internalData.tableSynchData=datas;if(isReset){internalData.isResizeCellHeight=false;}// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
@@ -10982,7 +11038,7 @@ const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe
|
|
|
10982
11038
|
* @returns
|
|
10983
11039
|
*/const handleRowGroupVirtualExpand=(rows,expanded)=>{return handleRowGroupBaseExpand(rows,expanded).then(()=>{handleVirtualTreeToList();$xeTable.handleTableData();reactData.rowGroupExpandedFlag++;updateAfterDataIndex();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}).then(()=>{return $xeTable.recalculate(true);}).then(()=>{setTimeout(()=>{$xeTable.updateCellAreas();},30);});};const handleCheckAllEvent=(evnt,value)=>{handleCheckedAllCheckboxRow(value);if(evnt){dispatchEvent('checkbox-all',{records:()=>$xeTable.getCheckboxRecords(),reserves:()=>$xeTable.getCheckboxReserveRecords(),indeterminates:()=>$xeTable.getCheckboxIndeterminateRecords(),checked:value},evnt);}};/**
|
|
10984
11040
|
* 纵向 Y 可视渲染处理
|
|
10985
|
-
*/const loadScrollYData=()=>{const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible();const offsetItem={startIndex:Math.max(0,isScrollYBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollYBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+autoOffsetYSize+preloadSize};scrollYStore.visibleStartIndex=toVisibleIndex-1;scrollYStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeBodyList,offsetItem,'row');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollYStore.startIndex=offsetStartIndex;scrollYStore.endIndex=offsetEndIndex;$xeTable.updateScrollYData();}}};const createGetRowCacheProp=prop=>{return function(row){const{fullAllDataRowIdData}=internalData;if(row){const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest[prop];}}return-1;};};const createGetColumnCacheProp=prop=>{return function(column){const{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};const lazyScrollXData=()=>{const{lxTimeout,lxRunTime,scrollXStore}=internalData;const{visibleSize}=scrollXStore;const fpsTime=visibleSize>26?26:visibleSize>16?14:6;if(lxTimeout){clearTimeout(lxTimeout);}if(!lxRunTime||lxRunTime+fpsTime<Date.now()){internalData.lxRunTime=Date.now();loadScrollXData();}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData();},fpsTime);};const lazyScrollYData=()=>{const{lyTimeout,lyRunTime,scrollYStore}=internalData;const{visibleSize}=scrollYStore;const fpsTime=visibleSize>30?32:visibleSize>20?18:8;if(lyTimeout){clearTimeout(lyTimeout);}if(!lyRunTime||lyRunTime+fpsTime<Date.now()){internalData.lyRunTime=Date.now();loadScrollYData();}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData();},fpsTime);};const checkLastSyncScroll=(isRollX,isRollY)=>{const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;const{lcsTimeout}=internalData;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{internalData.lcsRunTime=Date.now();internalData.lcsTimeout=undefined;internalData.intoRunScroll=false;internalData.inVirtualScroll=false;internalData.inWheelScroll=false;internalData.inHeaderScroll=false;internalData.inBodyScroll=false;internalData.inFooterScroll=false;internalData.scrollRenderType='';if(!isAllOverflow){calcCellHeight();updateRowOffsetTop();}if(isRollX&&scrollXLoad){$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){$xeTable.updateScrollYData().then(()=>{if(!isAllOverflow){calcCellHeight();updateRowOffsetTop();}$xeTable.updateScrollYSpace();});}updateRowExpandStyle();$xeTable.updateCellAreas();},200);};const getWheelSpeed=lastScrollTime=>{let multiple=1;const currTime=Date.now();if(lastScrollTime+25>currTime){multiple=1.18;}else if(lastScrollTime+30>currTime){multiple=1.15;}else if(lastScrollTime+40>currTime){multiple=1.12;}else if(lastScrollTime+55>currTime){multiple=1.09;}else if(lastScrollTime+75>currTime){multiple=1.06;}else if(lastScrollTime+100>currTime){multiple=1.03;}return multiple;};const wheelScrollLeftTo=(scrollLeft,cb)=>{requestAnimationFrame(()=>{cb(scrollLeft);});};const wheelScrollTopTo=(diffNum,cb)=>{const duration=Math.abs(diffNum);const startTime=performance.now();let countTop=0;const step=timestamp=>{let progress=(timestamp-startTime)/duration;if(progress>1){progress=1;}const easedProgress=Math.pow(progress,2);const offsetTop=Math.floor(diffNum*easedProgress)-countTop;countTop+=offsetTop;cb(offsetTop);if(progress<1){requestAnimationFrame(step);}};requestAnimationFrame(step);};const dispatchEvent=(type,params,evnt)=>{emit(type,createEvent(evnt,{$table:$xeTable,$grid:$xeGrid},params));};const handleScrollToRowColumn=(fieldOrColumn,row)=>{const{fullColumnIdData}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(column&&fullColumnIdData[column.id]){return colToVisible($xeTable,column,row);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const handleUpdateResize=()=>{const el=refElem.value;if(el&&el.clientWidth&&el.clientHeight){
|
|
11041
|
+
*/const loadScrollYData=()=>{const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible();const offsetItem={startIndex:Math.max(0,isScrollYBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollYBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+autoOffsetYSize+preloadSize};scrollYStore.visibleStartIndex=toVisibleIndex-1;scrollYStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeBodyList,offsetItem,'row');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollYStore.startIndex=offsetStartIndex;scrollYStore.endIndex=offsetEndIndex;$xeTable.updateScrollYData();}}};const createGetRowCacheProp=prop=>{return function(row){const{fullAllDataRowIdData}=internalData;if(row){const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest[prop];}}return-1;};};const createGetColumnCacheProp=prop=>{return function(column){const{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};const lazyScrollXData=()=>{const{lxTimeout,lxRunTime,scrollXStore}=internalData;const{visibleSize}=scrollXStore;const fpsTime=visibleSize>26?26:visibleSize>16?14:6;if(lxTimeout){clearTimeout(lxTimeout);}if(!lxRunTime||lxRunTime+fpsTime<Date.now()){internalData.lxRunTime=Date.now();loadScrollXData();}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData();},fpsTime);};const lazyScrollYData=()=>{const{lyTimeout,lyRunTime,scrollYStore}=internalData;const{visibleSize}=scrollYStore;const fpsTime=visibleSize>30?32:visibleSize>20?18:8;if(lyTimeout){clearTimeout(lyTimeout);}if(!lyRunTime||lyRunTime+fpsTime<Date.now()){internalData.lyRunTime=Date.now();loadScrollYData();}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData();},fpsTime);};const checkLastSyncScroll=(isRollX,isRollY)=>{const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;const{lcsTimeout}=internalData;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{internalData.lcsRunTime=Date.now();internalData.lcsTimeout=undefined;internalData.intoRunScroll=false;internalData.inVirtualScroll=false;internalData.inWheelScroll=false;internalData.inHeaderScroll=false;internalData.inBodyScroll=false;internalData.inFooterScroll=false;internalData.scrollRenderType='';if(!isAllOverflow){calcCellHeight();updateRowOffsetTop();}if(isRollX&&scrollXLoad){$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){$xeTable.updateScrollYData().then(()=>{if(!isAllOverflow){calcCellHeight();updateRowOffsetTop();}$xeTable.updateScrollYSpace();});}updateRowExpandStyle();$xeTable.updateCellAreas();},200);};const getWheelSpeed=lastScrollTime=>{let multiple=1;const currTime=Date.now();if(lastScrollTime+25>currTime){multiple=1.18;}else if(lastScrollTime+30>currTime){multiple=1.15;}else if(lastScrollTime+40>currTime){multiple=1.12;}else if(lastScrollTime+55>currTime){multiple=1.09;}else if(lastScrollTime+75>currTime){multiple=1.06;}else if(lastScrollTime+100>currTime){multiple=1.03;}return multiple;};const wheelScrollLeftTo=(scrollLeft,cb)=>{requestAnimationFrame(()=>{cb(scrollLeft);});};const wheelScrollTopTo=(diffNum,cb)=>{const duration=Math.abs(diffNum);const startTime=performance.now();let countTop=0;const step=timestamp=>{let progress=(timestamp-startTime)/duration;if(progress>1){progress=1;}const easedProgress=Math.pow(progress,2);const offsetTop=Math.floor(diffNum*easedProgress)-countTop;countTop+=offsetTop;cb(offsetTop);if(progress<1){requestAnimationFrame(step);}};requestAnimationFrame(step);};const dispatchEvent=(type,params,evnt)=>{emit(type,createEvent(evnt,{$table:$xeTable,$grid:$xeGrid},params));};const handleScrollToRowColumn=(fieldOrColumn,row)=>{const{fullColumnIdData}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(column&&fullColumnIdData[column.id]){return colToVisible($xeTable,column,row);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const handleUpdateResize=()=>{const el=refElem.value;if(el&&el.clientWidth&&el.clientHeight){$xeTable.recalculate();}};const handleUpdateColResize=(evnt,params)=>{$xeTable.analyColumnWidth();$xeTable.recalculate().then(()=>{$xeTable.saveCustomStore('update:width');$xeTable.updateCellAreas();$xeTable.dispatchEvent('column-resizable-change',params,evnt);// 已废弃 resizable-change
|
|
10986
11042
|
$xeTable.dispatchEvent('resizable-change',params,evnt);setTimeout(()=>$xeTable.recalculate(true),300);});};const handleUpdateRowResize=(evnt,params)=>{reactData.resizeHeightFlag++;$xeTable.recalculate().then(()=>{$xeTable.updateCellAreas();$xeTable.dispatchEvent('row-resizable-change',params,evnt);setTimeout(()=>$xeTable.recalculate(true),300);});};const updateColumnOffsetLeft=()=>{const{visibleColumn,fullColumnIdData}=internalData;let offsetLeft=0;for(let cIndex=0,rLen=visibleColumn.length;cIndex<rLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest.oLeft=offsetLeft;}offsetLeft+=column.renderWidth;}};const updateRowOffsetTop=()=>{const{expandColumn}=reactData;const{afterFullData,fullAllDataRowIdData,rowExpandedMaps}=internalData;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const{handleGetRowId}=createHandleGetRowId($xeTable);let offsetTop=0;for(let rIndex=0,rLen=afterFullData.length;rIndex<rLen;rIndex++){const row=afterFullData[rIndex];const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid]||{};rowRest.oTop=offsetTop;offsetTop+=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;// 是否展开行
|
|
10987
11043
|
if(expandColumn&&rowExpandedMaps[rowid]){offsetTop+=rowRest.expandHeight||expandOpts.height||0;}}};const updateRowExpandStyle=()=>{const{expandColumn,scrollYLoad,scrollYTop,isScrollYBig}=reactData;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const{mode}=expandOpts;if(expandColumn&&mode==='fixed'){const{elemStore,fullAllDataRowIdData}=internalData;const rowExpandEl=refRowExpandElem.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(rowExpandEl&&bodyScrollElem){let isUpdateHeight=false;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowExpandEl.children,reEl=>{const expandEl=reEl;const rowid=expandEl.getAttribute('rowid')||'';const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const expandHeight=expandEl.offsetHeight+1;const trEl=bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);let offsetTop=0;if(scrollYLoad){if(isScrollYBig&&trEl){offsetTop=trEl.offsetTop+trEl.offsetHeight;}else{offsetTop=rowRest.oTop+(rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight);}}else{if(trEl){offsetTop=trEl.offsetTop+trEl.offsetHeight;}}if(isScrollYBig){offsetTop+=scrollYTop;}expandEl.style.top=toCssUnit(offsetTop);if(!isUpdateHeight){if(rowRest.expandHeight!==expandHeight){isUpdateHeight=true;}}rowRest.expandHeight=expandHeight;}});if(isUpdateHeight){reactData.rowExpandHeightFlag++;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{updateRowOffsetTop();});}}}};const handleRowExpandScroll=()=>{const{elemStore}=internalData;const rowExpandEl=refRowExpandElem.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(rowExpandEl&&bodyScrollElem){rowExpandEl.scrollTop=bodyScrollElem.scrollTop;}};tableMethods={dispatchEvent,getEl(){return refElem.value;},/**
|
|
10988
11044
|
* 重置表格的一切数据状态
|
|
@@ -11293,7 +11349,7 @@ if(transform){return handleVirtualTreeExpand(rows,expanded);}else{return handleB
|
|
|
11293
11349
|
* 获取所有被合并的表尾
|
|
11294
11350
|
*/getMergeFooterItems(){return internalData.mergeFooterList.slice(0);},/**
|
|
11295
11351
|
* 清除所有表尾合并
|
|
11296
|
-
*/clearMergeFooterItems(){internalData.mergeFooterList=[];internalData.mergeFooterMaps={};internalData.mergeFooterCellMaps={};reactData.mergeFootFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{collectColumn}=internalData;const{storage,checkMethod}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{});const isCustomResizable=
|
|
11352
|
+
*/clearMergeFooterItems(){internalData.mergeFooterList=[];internalData.mergeFooterMaps={};internalData.mergeFooterCellMaps={};reactData.mergeFootFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{collectColumn}=internalData;const{storage,checkMethod,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);const resizableData={};const sortData={};const visibleData={};const fixedData={};const storeData={resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined};if(!id){errLog('vxe.error.reqProp',['id']);return storeData;}let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;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){errLog('vxe.error.reqProp',[`${column.getTitle()||column.type||''} -> column.field=?`]);return;}// 只支持一级
|
|
11297
11353
|
if(!parentColumn){if(isCustomSort){hasSort=1;sortData[colKey]=column.renderSortNumber;}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(hasResizable){storeData.resizableData=resizableData;}if(hasSort){storeData.sortData=sortData;}if(hasFixed){storeData.fixedData=fixedData;}if(hasVisible){storeData.visibleData=visibleData;}return storeData;},focus(){internalData.isActivated=true;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},blur(){internalData.isActivated=false;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
11298
11354
|
* 连接工具栏
|
|
11299
11355
|
* @param $toolbar
|
|
@@ -11394,7 +11450,7 @@ if(treeConfig){const childrenField=treeOpts.children||treeOpts.childrenField;ext
|
|
|
11394
11450
|
*/analyColumnWidth(){const{tableFullColumn}=internalData;const columnOpts=computeColumnOpts.value;const{width:defaultWidth,minWidth:defaultMinWidth}=columnOpts;const resizeList=[];const pxList=[];const pxMinList=[];const autoMinList=[];const scaleList=[];const scaleMinList=[];const autoList=[];const remainList=[];tableFullColumn.forEach(column=>{if(defaultWidth&&!column.width){column.width=defaultWidth;}if(defaultMinWidth&&!column.minWidth){column.minWidth=defaultMinWidth;}if(column.visible){if(column.resizeWidth){resizeList.push(column);}else if(column.width==='auto'){autoList.push(column);}else if(isPx(column.width)){pxList.push(column);}else if(isScale(column.width)){scaleList.push(column);}else if(isPx(column.minWidth)){pxMinList.push(column);}else if(column.minWidth==='auto'){autoMinList.push(column);}else if(isScale(column.minWidth)){scaleMinList.push(column);}else{remainList.push(column);}}});Object.assign(reactData.columnStore,{resizeList,pxList,pxMinList,autoMinList,scaleList,scaleMinList,autoList,remainList});},handleColResizeMousedownEvent(evnt,fixedType,params){evnt.stopPropagation();evnt.preventDefault();const{column}=params;const{columnStore,overflowX,scrollbarHeight}=reactData;const{elemStore,visibleColumn}=internalData;const{leftList,rightList}=columnStore;const resizableOpts=computeResizableOpts.value;const osbHeight=overflowX?scrollbarHeight:0;const tableEl=refElem.value;const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const resizeBarElem=refColResizeBar.value;if(!resizeBarElem){return;}const isLeftFixed=fixedType==='left';const isRightFixed=fixedType==='right';const resizeTipElem=resizeBarElem.firstElementChild;const scrollbarXToTop=computeScrollbarXToTop.value;const{clientX:dragClientX}=evnt;const dragBtnElem=evnt.target;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});let dragLeft=0;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const tableRect=tableEl.getBoundingClientRect();const rightContainerRect=rightContainerElem?rightContainerElem.getBoundingClientRect():null;const cellRect=cell.getBoundingClientRect();const dragBtnRect=dragBtnElem.getBoundingClientRect();const dragBtnWidth=dragBtnElem.clientWidth;const dragBtnOffsetWidth=Math.floor(dragBtnWidth/2);const dragPosLeft=dragBtnRect.x-tableRect.x+dragBtnOffsetWidth;const minInterval=getColReMinWidth(cellParams)-dragBtnOffsetWidth;// 列之间的最小间距
|
|
11395
11451
|
const dragMinLeft=isRightFixed?0:cellRect.x-tableRect.x+dragBtnWidth+minInterval;const dragMaxLeft=cellRect.x-tableRect.x+cell.clientWidth-minInterval;let fixedLeftRemainWidth=0;let fixedRightRemainWidth=0;if(isLeftFixed||isRightFixed){let isMach=false;const fixedColumn=isLeftFixed?leftList:rightList;for(let i=0;i<fixedColumn.length;i++){const item=fixedColumn[i];if(isMach){fixedLeftRemainWidth+=item.renderWidth;}else{isMach=item.id===resizeColumn.id;if(!isMach){fixedRightRemainWidth+=item.renderWidth;}}}}// 处理拖动事件
|
|
11396
11452
|
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const tableHeight=tableEl.clientHeight;const offsetX=evnt.clientX-dragClientX;let left=dragPosLeft+offsetX;if(isLeftFixed){if(rightContainerRect){left=Math.min(left,rightContainerRect.x-tableRect.x-fixedLeftRemainWidth-minInterval);}}else if(isRightFixed){if(leftContainerElem){left=Math.max(left,leftContainerElem.clientWidth+fixedRightRemainWidth+minInterval);}left=Math.min(left,dragMaxLeft);}dragLeft=Math.max(left,dragMinLeft);const resizeBarLeft=Math.max(1,dragLeft);resizeBarElem.style.left=`${resizeBarLeft}px`;resizeBarElem.style.top=`${scrollbarXToTop?osbHeight:0}px`;resizeBarElem.style.height=`${scrollbarXToTop?tableHeight-osbHeight:tableHeight}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeColTip',[Math.floor(resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft))]);const tableWrapperWidth=tableEl.clientWidth;const resizeBarWidth=resizeBarElem.clientWidth;const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeTipLeft=-resizeTipWidth;if(resizeBarLeft<resizeTipWidth+resizeBarWidth){resizeTipLeft=0;}else if(resizeBarLeft>tableWrapperWidth){resizeTipLeft+=tableWrapperWidth-resizeBarLeft;}resizeTipElem.style.left=`${resizeTipLeft}px`;resizeTipElem.style.top=`${Math.min(tableHeight-resizeTipHeight,Math.max(0,evnt.clientY-tableRect.y-resizeTipHeight/2))}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'col-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);const resizeWidth=resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft);const resizeParams={...params,resizeWidth,resizeColumn};if(resizableOpts.dragMode==='fixed'){visibleColumn.forEach(item=>{if(item.id!==resizeColumn.id){if(!item.resizeWidth){item.resizeWidth=item.renderWidth;}}});}if($xeTable.handleColResizeCellAreaEvent){$xeTable.handleColResizeCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoWidth}=resizableOpts;const el=refElem.value;if(isDblclickAutoWidth&&el){evnt.stopPropagation();evnt.preventDefault();const{fullColumnIdData}=internalData;const{column}=params;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const colid=resizeColumn.id;const colRest=fullColumnIdData[colid];const dragBtnElem=evnt.target;const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});const colMinWidth=getColReMinWidth(cellParams);el.setAttribute('data-calc-col','Y');let resizeWidth=calcColumnAutoWidth(resizeColumn,el);el.removeAttribute('data-calc-col');if(colRest){resizeWidth=Math.max(resizeWidth,colRest.width);}resizeWidth=Math.max(colMinWidth,resizeWidth);const resizeParams={...params,resizeWidth,resizeColumn};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleColResizeDblclickCellAreaEvent){$xeTable.handleColResizeDblclickCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}}},handleRowResizeMousedownEvent(evnt,params){evnt.stopPropagation();evnt.preventDefault();const{row}=params;const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{elemStore,fullAllDataRowIdData}=internalData;const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const scrollbarYToLeft=computeScrollbarYToLeft.value;const resizableOpts=computeResizableOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const tableEl=refElem.value;const resizeBarElem=refRowResizeBar.value;if(!resizeBarElem){return;}const{clientY:dragClientY}=evnt;const resizeTipElem=resizeBarElem.firstElementChild;const dragBtnElem=evnt.currentTarget;const tdEl=dragBtnElem.parentNode;const trEl=tdEl.parentNode;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const defaultRowHeight=computeDefaultRowHeight.value;const currCellHeight=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;const tableRect=tableEl.getBoundingClientRect();const trRect=trEl.getBoundingClientRect();const targetOffsetY=dragClientY-trRect.y-trEl.clientHeight;let resizeHeight=currCellHeight;const cellEl=tdEl.querySelector('.vxe-cell');let cellMinHeight=0;if(cellEl){const cellStyle=getComputedStyle(cellEl);cellMinHeight=Math.max(1,Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom)));}const minTop=trRect.y-tableRect.y+cellMinHeight;// 处理拖动事件
|
|
11397
|
-
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const rtWidth=tableEl.clientWidth-osbWidth;const tableHeight=tableEl.clientHeight-osbHeight;let dragTop=evnt.clientY-tableRect.y-targetOffsetY;if(dragTop<minTop){dragTop=minTop;}else{resizeHeight=Math.max(cellMinHeight,currCellHeight+evnt.clientY-dragClientY);}resizeBarElem.style.left=`${scrollbarYToLeft?osbWidth:0}px`;resizeBarElem.style.top=`${dragTop}px`;resizeBarElem.style.width=`${rtWidth}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeRowTip',[resizeHeight]);const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeBarLeft=Math.max(2,evnt.clientX-tableRect.x);let resizeBarTop=0;if(resizeBarLeft+resizeTipWidth>=rtWidth-2){resizeBarLeft=rtWidth-resizeTipWidth-2;}if(dragTop+resizeTipHeight>=tableHeight){resizeBarTop=tableHeight-(dragTop+resizeTipHeight);}resizeTipElem.style.left=`${resizeBarLeft}px`;resizeTipElem.style.top=`${resizeBarTop}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'row-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);if(resizeHeight!==currCellHeight){const resizeParams={...params,resizeHeight,resizeRow:row};internalData.isResizeCellHeight=true;if($xeTable.handleRowResizeCellAreaEvent){$xeTable.handleRowResizeCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);updateRowOffsetTop();}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},handleRowResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoHeight}=resizableOpts;const el=refElem.value;if(isDblclickAutoHeight&&el){evnt.stopPropagation();evnt.preventDefault();const{editStore}=reactData;const{fullAllDataRowIdData}=internalData;const{actived}=editStore;const{row}=params;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const handleRsHeight=()=>{el.setAttribute('data-calc-row','Y');const resizeHeight=calcCellAutoHeight(rowRest,el);el.removeAttribute('data-calc-row');const resizeParams={...params,resizeHeight,resizeRow:row};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleRowResizeDblclickCellAreaEvent){$xeTable.handleRowResizeDblclickCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},saveCustomStore(type){const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{updateStore,storage}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{});const isCustomResizable=
|
|
11453
|
+
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const rtWidth=tableEl.clientWidth-osbWidth;const tableHeight=tableEl.clientHeight-osbHeight;let dragTop=evnt.clientY-tableRect.y-targetOffsetY;if(dragTop<minTop){dragTop=minTop;}else{resizeHeight=Math.max(cellMinHeight,currCellHeight+evnt.clientY-dragClientY);}resizeBarElem.style.left=`${scrollbarYToLeft?osbWidth:0}px`;resizeBarElem.style.top=`${dragTop}px`;resizeBarElem.style.width=`${rtWidth}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeRowTip',[resizeHeight]);const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeBarLeft=Math.max(2,evnt.clientX-tableRect.x);let resizeBarTop=0;if(resizeBarLeft+resizeTipWidth>=rtWidth-2){resizeBarLeft=rtWidth-resizeTipWidth-2;}if(dragTop+resizeTipHeight>=tableHeight){resizeBarTop=tableHeight-(dragTop+resizeTipHeight);}resizeTipElem.style.left=`${resizeBarLeft}px`;resizeTipElem.style.top=`${resizeBarTop}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'row-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);if(resizeHeight!==currCellHeight){const resizeParams={...params,resizeHeight,resizeRow:row};internalData.isResizeCellHeight=true;if($xeTable.handleRowResizeCellAreaEvent){$xeTable.handleRowResizeCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);updateRowOffsetTop();}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},handleRowResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoHeight}=resizableOpts;const el=refElem.value;if(isDblclickAutoHeight&&el){evnt.stopPropagation();evnt.preventDefault();const{editStore}=reactData;const{fullAllDataRowIdData}=internalData;const{actived}=editStore;const{row}=params;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const handleRsHeight=()=>{el.setAttribute('data-calc-row','Y');const resizeHeight=calcCellAutoHeight(rowRest,el);el.removeAttribute('data-calc-row');const resizeParams={...params,resizeHeight,resizeRow:row};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleRowResizeDblclickCellAreaEvent){$xeTable.handleRowResizeDblclickCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},saveCustomStore(type){const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{updateStore,storage,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);if(type!=='reset'){// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
11398
11454
|
reactData.isCustomStatus=true;}if((customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const storeData=type==='reset'?{resizableData:{},sortData:{},visibleData:{},fixedData:{}}:tableMethods.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},handleCustom(){const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}tablePrivateMethods.analyColumnWidth();return tableMethods.refreshColumn(true);},handleUpdateDataQueue(){reactData.upDataFlag++;},handleRefreshColumnQueue(){reactData.reColumnFlag++;},preventEvent(evnt,type,args,next,end){let evntList=table_interceptor.get(type);// 兼容老版本
|
|
11399
11455
|
if(!evntList.length&&type==='event.clearEdit'){evntList=table_interceptor.get('event.clearActived');if(evntList.length){warnLog('vxe.error.delEvent',['event.clearActived','event.clearEdit']);}}// 兼容老版本
|
|
11400
11456
|
let rest=null;let isStop=false;for(let i=0;i<evntList.length;i++){const func=evntList[i];const fnRest=func(Object.assign({$grid:$xeGrid,$table:$xeTable,$event:evnt},args));if(fnRest===false){isStop=true;break;}else if(fnRest&&fnRest.status===false){rest=fnRest.result;isStop=true;break;}}if(!isStop){if(next){rest=next();}}if(end){end();}return rest;},updateCheckboxStatus(){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterTreeFullData,afterGroupFullData,selectCheckboxMaps,treeIndeterminateRowMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const checkboxOpts=computeCheckboxOpts.value;const{checkField,checkStrictly,checkMethod}=checkboxOpts;if(checkStrictly){return;}if(isRowGroupStatus||treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);const childRowMaps={};const childRowList=[];if(isRowGroupStatus){// 行分组
|
|
@@ -11523,7 +11579,7 @@ if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHei
|
|
|
11523
11579
|
* 分别渲染左边固定列和右边固定列
|
|
11524
11580
|
* 如果宽度足够情况下,则不需要渲染固定列
|
|
11525
11581
|
* @param {String} fixedType 固定列类型
|
|
11526
|
-
*/const renderFixed=fixedType=>{const{showHeader,showFooter}=props;const{tableData,tableColumn,tableGroupColumn,columnStore,footerTableData}=reactData;const isFixedLeft=fixedType==='left';const fixedColumn=isFixedLeft?columnStore.leftList:columnStore.rightList;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:isFixedLeft?refLeftContainer:refRightContainer,class:`vxe-table--fixed-${fixedType}-wrapper`},[showHeader?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(header,{ref:isFixedLeft?refTableLeftHeader:refTableRightHeader,fixedType,tableData,tableColumn,tableGroupColumn,fixedColumn}):table_renderEmptyElement($xeTable),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(body,{ref:isFixedLeft?refTableLeftBody:refTableRightBody,fixedType,tableData,tableColumn,fixedColumn}),showFooter?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(footer,{ref:isFixedLeft?refTableLeftFooter:refTableRightFooter,footerTableData,tableColumn,fixedColumn,fixedType}):table_renderEmptyElement($xeTable)]);};const renderEmptyBody=()=>{const emptyOpts=computeEmptyOpts.value;const
|
|
11582
|
+
*/const renderFixed=fixedType=>{const{showHeader,showFooter}=props;const{tableData,tableColumn,tableGroupColumn,columnStore,footerTableData}=reactData;const isFixedLeft=fixedType==='left';const fixedColumn=isFixedLeft?columnStore.leftList:columnStore.rightList;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:isFixedLeft?refLeftContainer:refRightContainer,class:`vxe-table--fixed-${fixedType}-wrapper`},[showHeader?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(header,{ref:isFixedLeft?refTableLeftHeader:refTableRightHeader,fixedType,tableData,tableColumn,tableGroupColumn,fixedColumn}):table_renderEmptyElement($xeTable),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(body,{ref:isFixedLeft?refTableLeftBody:refTableRightBody,fixedType,tableData,tableColumn,fixedColumn}),showFooter?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(footer,{ref:isFixedLeft?refTableLeftFooter:refTableRightFooter,footerTableData,tableColumn,fixedColumn,fixedType}):table_renderEmptyElement($xeTable)]);};const renderEmptyBody=()=>{const emptyOpts=computeEmptyOpts.value;const emptySlot=slots.empty;const emptyParams={$table:$xeTable,$grid:$xeGrid};if(emptySlot){return emptySlot(emptyParams);}else{const compConf=emptyOpts.name?table_renderer.get(emptyOpts.name):null;const rtEmptyView=compConf?compConf.renderTableEmpty||compConf.renderTableEmptyView||compConf.renderEmpty:null;if(rtEmptyView){return getSlotVNs(rtEmptyView(emptyOpts,emptyParams));}}return getFuncText(props.emptyText)||table_getI18n('vxe.table.emptyText');};const renderDragTipContents=()=>{const{dragConfig}=props;const{dragRow,dragCol,dragTipText}=reactData;const columnDragOpts=computeColumnDragOpts.value;const rowDragOpts=computeRowDragOpts.value;const rowDragSlots=rowDragOpts.slots||{};const rTipSlot=rowDragSlots.tip||(dragConfig&&dragConfig.slots?dragConfig.slots.rowTip:null);const columnDragSlots=columnDragOpts.slots||{};const cTipSlot=columnDragSlots.tip;if(dragRow&&rTipSlot){return callSlot(rTipSlot,{row:dragRow});}if(dragCol&&cTipSlot){return callSlot(cTipSlot,{column:dragCol});}return[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',dragTipText)];};const renderDragTip=()=>{const{dragRow,dragCol}=reactData;const rowOpts=computeRowOpts.value;const columnOpts=computeColumnOpts.value;const rowDragOpts=computeRowDragOpts.value;const columnDragOpts=computeColumnDragOpts.value;if(rowOpts.drag||columnOpts.drag){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragRowLineElem,class:['vxe-table--drag-row-line',{'is--guides':rowDragOpts.showGuidesStatus}]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragColLineElem,class:['vxe-table--drag-col-line',{'is--guides':columnDragOpts.showGuidesStatus}]}),dragRow&&rowDragOpts.showDragTip||dragCol&&columnDragOpts.showDragTip?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragTipElem,class:'vxe-table--drag-sort-tip'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-status'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-normal-status',dragRow?table_getIcon().TABLE_DRAG_STATUS_ROW:table_getIcon().TABLE_DRAG_STATUS_COLUMN]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-sub-status',table_getIcon().TABLE_DRAG_STATUS_SUB_ROW]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-disabled-status',table_getIcon().TABLE_DRAG_DISABLED]})]),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-content'},renderDragTipContents())])]):table_renderEmptyElement($xeTable)]);}return table_renderEmptyElement($xeTable);};const renderRowExpandedVNs=()=>{const{treeConfig}=props;const{expandColumn,isRowGroupStatus}=reactData;const tableRowExpandedList=computeTableRowExpandedList.value;const expandOpts=computeExpandOpts.value;const{mode}=expandOpts;if(mode!=='fixed'){return table_renderEmptyElement($xeTable);}const expandVNs=[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{key:'repY',ref:refRowExpandYSpaceElem})];if(expandColumn){const{handleGetRowId}=createHandleGetRowId($xeTable);tableRowExpandedList.forEach(row=>{const expandOpts=computeExpandOpts.value;const{height:expandHeight,padding,indent}=expandOpts;const{fullAllDataRowIdData,fullColumnIdData}=internalData;const treeOpts=computeTreeOpts.value;const{transform,seqMode}=treeOpts;const cellStyle={};const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const colid=expandColumn.id;const colRest=fullColumnIdData[colid]||{};let rowLevel=0;let seq=-1;let _rowIndex=-1;let rowIndex=-1;let $rowIndex=-1;if(rowRest){rowLevel=rowRest.level;if(isRowGroupStatus||treeConfig&&transform&&seqMode==='increasing'){seq=rowRest._index+1;}else{seq=rowRest.seq;}rowIndex=rowRest.index;$rowIndex=rowRest.$index;_rowIndex=rowRest._index;}if(expandHeight){cellStyle.height=`${expandHeight}px`;}if(isRowGroupStatus||treeConfig){cellStyle.paddingLeft=`${rowLevel*(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(indent)?indent:treeOpts.indent)+30}px`;}let columnIndex=-1;let $columnIndex=-1;let _columnIndex=-1;if(colRest){columnIndex=colRest.index;$columnIndex=colRest.$index;_columnIndex=colRest._index;}const expandParams={$grid:$xeGrid,$table:$xeTable,seq,column:expandColumn,columnIndex,$columnIndex,_columnIndex,fixed:'',type:'body',level:rowLevel,rowid,row,rowIndex,$rowIndex,_rowIndex,isHidden:false,isEdit:false,visibleData:[],data:[],items:[]};expandVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{key:rowid,class:['vxe-body--row-expanded-cell',{'is--padding':padding,'is--ellipsis':expandHeight}],rowid,style:cellStyle},expandColumn.renderData(expandParams)));});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refRowExpandElem,class:'vxe-table--row-expanded-wrapper'},expandVNs);};const renderScrollX=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{key:'vsx',ref:refScrollXVirtualElem,class:'vxe-table--scroll-x-virtual'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXLeftCornerElem,class:'vxe-table--scroll-x-left-corner'}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXWrapperElem,class:'vxe-table--scroll-x-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXHandleElem,class:'vxe-table--scroll-x-handle',onScroll:$xeTable.triggerVirtualScrollXEvent},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXSpaceElem,class:'vxe-table--scroll-x-space'})])]),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXRightCornerElem,class:'vxe-table--scroll-x-right-corner'})]);};const renderScrollY=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYVirtualElem,class:'vxe-table--scroll-y-virtual'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYTopCornerElem,class:'vxe-table--scroll-y-top-corner'}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYWrapperElem,class:'vxe-table--scroll-y-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYHandleElem,class:'vxe-table--scroll-y-handle',onScroll:$xeTable.triggerVirtualScrollYEvent},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYSpaceElem,class:'vxe-table--scroll-y-space'})])]),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYBottomCornerElem,class:'vxe-table--scroll-y-bottom-corner'})]);};const renderViewport=()=>{const{showHeader,showFooter}=props;const{overflowX,tableData,tableColumn,tableGroupColumn,footerTableData,columnStore}=reactData;const{leftList,rightList}=columnStore;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refTableViewportElem,class:'vxe-table--viewport-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--main-wrapper'},[/**
|
|
11527
11583
|
* 表头
|
|
11528
11584
|
*/showHeader?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(header,{ref:refTableHeader,tableData,tableColumn,tableGroupColumn}):table_renderEmptyElement($xeTable),/**
|
|
11529
11585
|
* 表体
|
|
@@ -11600,6 +11656,7 @@ if(props.editConfig&&!$xeTable.insert){errLog('vxe.error.reqModule',['Edit']);}i
|
|
|
11600
11656
|
|
|
11601
11657
|
|
|
11602
11658
|
|
|
11659
|
+
|
|
11603
11660
|
const {
|
|
11604
11661
|
getConfig: toolbar_getConfig,
|
|
11605
11662
|
getIcon: toolbar_getIcon,
|
|
@@ -11609,16 +11666,22 @@ const {
|
|
|
11609
11666
|
createEvent: toolbar_createEvent,
|
|
11610
11667
|
useFns: toolbar_useFns
|
|
11611
11668
|
} = core_.VxeUI;
|
|
11612
|
-
/* harmony default export */ var toolbar = ((
|
|
11669
|
+
/* harmony default export */ var toolbar = (defineVxeComponent({
|
|
11613
11670
|
name: 'VxeToolbar',
|
|
11614
11671
|
props: {
|
|
11615
11672
|
loading: Boolean,
|
|
11616
11673
|
refresh: [Boolean, Object],
|
|
11674
|
+
refreshOptions: Object,
|
|
11617
11675
|
import: [Boolean, Object],
|
|
11676
|
+
importOptions: Object,
|
|
11618
11677
|
export: [Boolean, Object],
|
|
11678
|
+
exportOptions: Object,
|
|
11619
11679
|
print: [Boolean, Object],
|
|
11680
|
+
printOptions: Object,
|
|
11620
11681
|
zoom: [Boolean, Object],
|
|
11682
|
+
zoomOptions: Object,
|
|
11621
11683
|
custom: [Boolean, Object],
|
|
11684
|
+
customOptions: Object,
|
|
11622
11685
|
buttons: {
|
|
11623
11686
|
type: Array,
|
|
11624
11687
|
default: () => toolbar_getConfig().toolbar.buttons
|
|
@@ -11672,22 +11735,22 @@ const {
|
|
|
11672
11735
|
let toolbarMethods = {};
|
|
11673
11736
|
const $xeGrid = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGrid', null);
|
|
11674
11737
|
const computeRefreshOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11675
|
-
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.refresh, true), props.refresh);
|
|
11738
|
+
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
|
|
11676
11739
|
});
|
|
11677
11740
|
const computeImportOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11678
|
-
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.import, true), props.import);
|
|
11741
|
+
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.import, true), props.importOptions, props.import);
|
|
11679
11742
|
});
|
|
11680
11743
|
const computeExportOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11681
|
-
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.export, true), props.export);
|
|
11744
|
+
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.export, true), props.exportOptions, props.export);
|
|
11682
11745
|
});
|
|
11683
11746
|
const computePrintOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11684
|
-
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.print, true), props.print);
|
|
11747
|
+
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.print, true), props.printOptions, props.print);
|
|
11685
11748
|
});
|
|
11686
11749
|
const computeZoomOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11687
|
-
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.zoom, true), props.zoom);
|
|
11750
|
+
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.zoom, true), props.zoomOptions, props.zoom);
|
|
11688
11751
|
});
|
|
11689
11752
|
const computeCustomOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11690
|
-
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.custom, true), props.custom);
|
|
11753
|
+
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.custom, true), props.customOptions, props.custom);
|
|
11691
11754
|
});
|
|
11692
11755
|
const computeTableCustomOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
11693
11756
|
const {
|
|
@@ -11796,85 +11859,44 @@ const {
|
|
|
11796
11859
|
}) => {
|
|
11797
11860
|
if ($xeGrid) {
|
|
11798
11861
|
$xeGrid.triggerZoomEvent($event);
|
|
11862
|
+
} else {
|
|
11863
|
+
warnLog('vxe.error.notProp', ['zoom']);
|
|
11799
11864
|
}
|
|
11800
11865
|
};
|
|
11801
|
-
const
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
if (code) {
|
|
11810
|
-
if ($xeGrid) {
|
|
11811
|
-
$xeGrid.triggerToolbarBtnEvent(item, evnt);
|
|
11812
|
-
} else {
|
|
11813
|
-
const gCommandOpts = toolbar_commands.get(code);
|
|
11814
|
-
const params = {
|
|
11815
|
-
code,
|
|
11816
|
-
button: item,
|
|
11817
|
-
$table: $table,
|
|
11818
|
-
$grid: $xeGrid,
|
|
11819
|
-
$event: evnt
|
|
11820
|
-
};
|
|
11821
|
-
if (gCommandOpts) {
|
|
11822
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
11823
|
-
if (tCommandMethod) {
|
|
11824
|
-
tCommandMethod(params);
|
|
11825
|
-
} else {
|
|
11826
|
-
errLog('vxe.error.notCommands', [code]);
|
|
11827
|
-
}
|
|
11828
|
-
}
|
|
11829
|
-
$xeToolbar.dispatchEvent('button-click', params, evnt);
|
|
11866
|
+
const importEvent = () => {
|
|
11867
|
+
if (checkTable()) {
|
|
11868
|
+
const {
|
|
11869
|
+
connectTable
|
|
11870
|
+
} = internalData;
|
|
11871
|
+
const $table = connectTable;
|
|
11872
|
+
if ($table) {
|
|
11873
|
+
$table.importData();
|
|
11830
11874
|
}
|
|
11831
11875
|
}
|
|
11832
11876
|
};
|
|
11833
|
-
const
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
if (code) {
|
|
11842
|
-
if ($xeGrid) {
|
|
11843
|
-
$xeGrid.triggerToolbarTolEvent(item, evnt);
|
|
11844
|
-
} else {
|
|
11845
|
-
const gCommandOpts = toolbar_commands.get(code);
|
|
11846
|
-
const params = {
|
|
11847
|
-
code,
|
|
11848
|
-
button: null,
|
|
11849
|
-
tool: item,
|
|
11850
|
-
$table: $table,
|
|
11851
|
-
$grid: $xeGrid,
|
|
11852
|
-
$event: evnt
|
|
11853
|
-
};
|
|
11854
|
-
if (gCommandOpts) {
|
|
11855
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
11856
|
-
if (tCommandMethod) {
|
|
11857
|
-
tCommandMethod(params);
|
|
11858
|
-
} else {
|
|
11859
|
-
errLog('vxe.error.notCommands', [code]);
|
|
11860
|
-
}
|
|
11861
|
-
}
|
|
11862
|
-
$xeToolbar.dispatchEvent('tool-click', params, evnt);
|
|
11877
|
+
const openImportEvent = () => {
|
|
11878
|
+
if (checkTable()) {
|
|
11879
|
+
const {
|
|
11880
|
+
connectTable
|
|
11881
|
+
} = internalData;
|
|
11882
|
+
const $table = connectTable;
|
|
11883
|
+
if ($table) {
|
|
11884
|
+
$table.openImport();
|
|
11863
11885
|
}
|
|
11864
11886
|
}
|
|
11865
11887
|
};
|
|
11866
|
-
const
|
|
11888
|
+
const exportEvent = () => {
|
|
11867
11889
|
if (checkTable()) {
|
|
11868
11890
|
const {
|
|
11869
11891
|
connectTable
|
|
11870
11892
|
} = internalData;
|
|
11871
11893
|
const $table = connectTable;
|
|
11872
11894
|
if ($table) {
|
|
11873
|
-
$table.
|
|
11895
|
+
$table.exportData();
|
|
11874
11896
|
}
|
|
11875
11897
|
}
|
|
11876
11898
|
};
|
|
11877
|
-
const
|
|
11899
|
+
const openExportEvent = () => {
|
|
11878
11900
|
if (checkTable()) {
|
|
11879
11901
|
const {
|
|
11880
11902
|
connectTable
|
|
@@ -11886,6 +11908,17 @@ const {
|
|
|
11886
11908
|
}
|
|
11887
11909
|
};
|
|
11888
11910
|
const printEvent = () => {
|
|
11911
|
+
if (checkTable()) {
|
|
11912
|
+
const {
|
|
11913
|
+
connectTable
|
|
11914
|
+
} = internalData;
|
|
11915
|
+
const $table = connectTable;
|
|
11916
|
+
if ($table) {
|
|
11917
|
+
$table.print();
|
|
11918
|
+
}
|
|
11919
|
+
}
|
|
11920
|
+
};
|
|
11921
|
+
const openPrintEvent = () => {
|
|
11889
11922
|
if (checkTable()) {
|
|
11890
11923
|
const {
|
|
11891
11924
|
connectTable
|
|
@@ -11896,6 +11929,115 @@ const {
|
|
|
11896
11929
|
}
|
|
11897
11930
|
}
|
|
11898
11931
|
};
|
|
11932
|
+
const handleDefaultCodeEvent = (eventParams, item, cb) => {
|
|
11933
|
+
switch (item.code) {
|
|
11934
|
+
case 'print':
|
|
11935
|
+
printEvent();
|
|
11936
|
+
break;
|
|
11937
|
+
case 'open_print':
|
|
11938
|
+
openPrintEvent();
|
|
11939
|
+
break;
|
|
11940
|
+
case 'custom':
|
|
11941
|
+
handleClickSettingEvent(eventParams);
|
|
11942
|
+
break;
|
|
11943
|
+
case 'export':
|
|
11944
|
+
exportEvent();
|
|
11945
|
+
break;
|
|
11946
|
+
case 'open_export':
|
|
11947
|
+
openExportEvent();
|
|
11948
|
+
break;
|
|
11949
|
+
case 'import':
|
|
11950
|
+
importEvent();
|
|
11951
|
+
break;
|
|
11952
|
+
case 'open_import':
|
|
11953
|
+
openImportEvent();
|
|
11954
|
+
break;
|
|
11955
|
+
case 'zoom':
|
|
11956
|
+
zoomEvent(eventParams);
|
|
11957
|
+
break;
|
|
11958
|
+
case 'refresh':
|
|
11959
|
+
refreshEvent(eventParams);
|
|
11960
|
+
break;
|
|
11961
|
+
default:
|
|
11962
|
+
cb();
|
|
11963
|
+
break;
|
|
11964
|
+
}
|
|
11965
|
+
};
|
|
11966
|
+
const btnEvent = (eventParams, item) => {
|
|
11967
|
+
const {
|
|
11968
|
+
$event
|
|
11969
|
+
} = eventParams;
|
|
11970
|
+
const {
|
|
11971
|
+
connectTable
|
|
11972
|
+
} = internalData;
|
|
11973
|
+
const $table = connectTable;
|
|
11974
|
+
const {
|
|
11975
|
+
code
|
|
11976
|
+
} = item;
|
|
11977
|
+
if (code) {
|
|
11978
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
11979
|
+
if ($xeGrid) {
|
|
11980
|
+
$xeGrid.triggerToolbarBtnEvent(item, $event);
|
|
11981
|
+
} else {
|
|
11982
|
+
const gCommandOpts = toolbar_commands.get(code);
|
|
11983
|
+
const params = {
|
|
11984
|
+
code,
|
|
11985
|
+
button: item,
|
|
11986
|
+
$table: $table,
|
|
11987
|
+
$grid: $xeGrid,
|
|
11988
|
+
$event
|
|
11989
|
+
};
|
|
11990
|
+
if (gCommandOpts) {
|
|
11991
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
11992
|
+
if (tCommandMethod) {
|
|
11993
|
+
tCommandMethod(params);
|
|
11994
|
+
} else {
|
|
11995
|
+
errLog('vxe.error.notCommands', [code]);
|
|
11996
|
+
}
|
|
11997
|
+
}
|
|
11998
|
+
$xeToolbar.dispatchEvent('button-click', params, $event);
|
|
11999
|
+
}
|
|
12000
|
+
});
|
|
12001
|
+
}
|
|
12002
|
+
};
|
|
12003
|
+
const tolEvent = (eventParams, item) => {
|
|
12004
|
+
const {
|
|
12005
|
+
$event
|
|
12006
|
+
} = eventParams;
|
|
12007
|
+
const {
|
|
12008
|
+
connectTable
|
|
12009
|
+
} = internalData;
|
|
12010
|
+
const $table = connectTable;
|
|
12011
|
+
const {
|
|
12012
|
+
code
|
|
12013
|
+
} = item;
|
|
12014
|
+
if (code) {
|
|
12015
|
+
handleDefaultCodeEvent(eventParams, item, () => {
|
|
12016
|
+
if ($xeGrid) {
|
|
12017
|
+
$xeGrid.triggerToolbarTolEvent(item, $event);
|
|
12018
|
+
} else {
|
|
12019
|
+
const gCommandOpts = toolbar_commands.get(code);
|
|
12020
|
+
const params = {
|
|
12021
|
+
code,
|
|
12022
|
+
button: null,
|
|
12023
|
+
tool: item,
|
|
12024
|
+
$table: $table,
|
|
12025
|
+
$grid: $xeGrid,
|
|
12026
|
+
$event
|
|
12027
|
+
};
|
|
12028
|
+
if (gCommandOpts) {
|
|
12029
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
12030
|
+
if (tCommandMethod) {
|
|
12031
|
+
tCommandMethod(params);
|
|
12032
|
+
} else {
|
|
12033
|
+
errLog('vxe.error.notCommands', [code]);
|
|
12034
|
+
}
|
|
12035
|
+
}
|
|
12036
|
+
$xeToolbar.dispatchEvent('tool-click', params, $event);
|
|
12037
|
+
}
|
|
12038
|
+
});
|
|
12039
|
+
}
|
|
12040
|
+
};
|
|
11899
12041
|
const dispatchEvent = (type, params, evnt) => {
|
|
11900
12042
|
emit(type, toolbar_createEvent(evnt, {
|
|
11901
12043
|
$toolbar: $xeToolbar
|
|
@@ -11936,9 +12078,7 @@ const {
|
|
|
11936
12078
|
permissionCode: child.permissionCode,
|
|
11937
12079
|
prefixTooltip: child.prefixTooltip,
|
|
11938
12080
|
suffixTooltip: child.suffixTooltip,
|
|
11939
|
-
onClick: (
|
|
11940
|
-
$event
|
|
11941
|
-
}) => isBtn ? btnEvent($event, child) : tolEvent($event, child)
|
|
12081
|
+
onClick: eventParams => isBtn ? btnEvent(eventParams, child) : tolEvent(eventParams, child)
|
|
11942
12082
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
11943
12083
|
});
|
|
11944
12084
|
}
|
|
@@ -12005,9 +12145,7 @@ const {
|
|
|
12005
12145
|
destroyOnClose: item.destroyOnClose,
|
|
12006
12146
|
placement: item.placement,
|
|
12007
12147
|
transfer: item.transfer,
|
|
12008
|
-
onClick: (
|
|
12009
|
-
$event
|
|
12010
|
-
}) => btnEvent($event, item)
|
|
12148
|
+
onClick: eventParams => btnEvent(eventParams, item)
|
|
12011
12149
|
}, dropdowns && dropdowns.length ? {
|
|
12012
12150
|
dropdowns: () => renderDropdowns(item, true)
|
|
12013
12151
|
} : {}));
|
|
@@ -12087,9 +12225,7 @@ const {
|
|
|
12087
12225
|
destroyOnClose: item.destroyOnClose,
|
|
12088
12226
|
placement: item.placement,
|
|
12089
12227
|
transfer: item.transfer,
|
|
12090
|
-
onClick: (
|
|
12091
|
-
$event
|
|
12092
|
-
}) => tolEvent($event, item)
|
|
12228
|
+
onClick: eventParams => tolEvent(eventParams, item)
|
|
12093
12229
|
}, dropdowns && dropdowns.length ? {
|
|
12094
12230
|
dropdowns: () => renderDropdowns(item, false)
|
|
12095
12231
|
} : {}));
|
|
@@ -12114,7 +12250,7 @@ const {
|
|
|
12114
12250
|
circle: true,
|
|
12115
12251
|
icon: importOpts.icon || toolbar_getIcon().TOOLBAR_TOOLS_IMPORT,
|
|
12116
12252
|
title: toolbar_getI18n('vxe.toolbar.import'),
|
|
12117
|
-
onClick:
|
|
12253
|
+
onClick: openImportEvent
|
|
12118
12254
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
12119
12255
|
};
|
|
12120
12256
|
const renderToolExport = () => {
|
|
@@ -12124,7 +12260,7 @@ const {
|
|
|
12124
12260
|
circle: true,
|
|
12125
12261
|
icon: exportOpts.icon || toolbar_getIcon().TOOLBAR_TOOLS_EXPORT,
|
|
12126
12262
|
title: toolbar_getI18n('vxe.toolbar.export'),
|
|
12127
|
-
onClick:
|
|
12263
|
+
onClick: openExportEvent
|
|
12128
12264
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
12129
12265
|
};
|
|
12130
12266
|
const renderToolPrint = () => {
|
|
@@ -12134,7 +12270,7 @@ const {
|
|
|
12134
12270
|
circle: true,
|
|
12135
12271
|
icon: printOpts.icon || toolbar_getIcon().TOOLBAR_TOOLS_PRINT,
|
|
12136
12272
|
title: toolbar_getI18n('vxe.toolbar.print'),
|
|
12137
|
-
onClick:
|
|
12273
|
+
onClick: openPrintEvent
|
|
12138
12274
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
12139
12275
|
};
|
|
12140
12276
|
const renderToolRefresh = () => {
|
|
@@ -12221,14 +12357,29 @@ const {
|
|
|
12221
12357
|
};
|
|
12222
12358
|
$xeToolbar.renderVN = renderVN;
|
|
12223
12359
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
12224
|
-
const {
|
|
12225
|
-
refresh
|
|
12226
|
-
} = props;
|
|
12227
12360
|
const refreshOpts = computeRefreshOpts.value;
|
|
12228
12361
|
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
12229
|
-
if (refresh && !$xeGrid && !queryMethod) {
|
|
12362
|
+
if (props.refresh && !$xeGrid && !queryMethod) {
|
|
12230
12363
|
warnLog('vxe.error.notFunc', ['queryMethod']);
|
|
12231
12364
|
}
|
|
12365
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(props.custom)) {
|
|
12366
|
+
warnLog('vxe.error.delProp', ['custom={...}', 'custom=boolean & custom-options={...}']);
|
|
12367
|
+
}
|
|
12368
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(props.print)) {
|
|
12369
|
+
warnLog('vxe.error.delProp', ['print={...}', 'print=boolean & print-options={...}']);
|
|
12370
|
+
}
|
|
12371
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(props.export)) {
|
|
12372
|
+
warnLog('vxe.error.delProp', ['export={...}', 'export=boolean & export-options={...}']);
|
|
12373
|
+
}
|
|
12374
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(props.import)) {
|
|
12375
|
+
warnLog('vxe.error.delProp', ['import={...}', 'import=boolean & import-options={...}']);
|
|
12376
|
+
}
|
|
12377
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(props.refresh)) {
|
|
12378
|
+
warnLog('vxe.error.delProp', ['refresh={...}', 'refresh=boolean & refresh-options={...}']);
|
|
12379
|
+
}
|
|
12380
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(props.refresh)) {
|
|
12381
|
+
warnLog('vxe.error.delProp', ['zoom={...}', 'zoom=boolean & zoom-options={...}']);
|
|
12382
|
+
}
|
|
12232
12383
|
const customOpts = computeCustomOpts.value;
|
|
12233
12384
|
if (customOpts.isFooter) {
|
|
12234
12385
|
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
|
|
@@ -12271,6 +12422,7 @@ const {
|
|
|
12271
12422
|
|
|
12272
12423
|
|
|
12273
12424
|
|
|
12425
|
+
|
|
12274
12426
|
const {
|
|
12275
12427
|
getConfig: grid_getConfig,
|
|
12276
12428
|
getI18n: grid_getI18n,
|
|
@@ -12285,7 +12437,7 @@ const {
|
|
|
12285
12437
|
const tableComponentPropKeys = Object.keys(src_props);
|
|
12286
12438
|
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
12287
12439
|
const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit-invalid', 'form-reset', 'form-collapse', 'form-toggle-collapse', 'proxy-query', 'proxy-delete', 'proxy-save', 'toolbar-button-click', 'toolbar-tool-click', 'zoom'];
|
|
12288
|
-
/* harmony default export */ var grid = ((
|
|
12440
|
+
/* harmony default export */ var grid = (defineVxeComponent({
|
|
12289
12441
|
name: 'VxeGrid',
|
|
12290
12442
|
props: {
|
|
12291
12443
|
...src_props,
|
|
@@ -12874,18 +13026,32 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
12874
13026
|
});
|
|
12875
13027
|
} else {
|
|
12876
13028
|
const toolbarOptSlots = toolbarOpts.slots;
|
|
12877
|
-
let buttonsSlot;
|
|
12878
|
-
let toolsSlot;
|
|
12879
13029
|
const toolbarSlots = {};
|
|
12880
13030
|
if (toolbarOptSlots) {
|
|
12881
|
-
buttonsSlot = getFuncSlot(toolbarOptSlots, 'buttons');
|
|
12882
|
-
|
|
13031
|
+
const buttonsSlot = getFuncSlot(toolbarOptSlots, 'buttons');
|
|
13032
|
+
const buttonPrefixSlot = getFuncSlot(toolbarOptSlots, 'buttonPrefix');
|
|
13033
|
+
const buttonSuffixSlot = getFuncSlot(toolbarOptSlots, 'buttonSuffix');
|
|
13034
|
+
const toolsSlot = getFuncSlot(toolbarOptSlots, 'tools');
|
|
13035
|
+
const toolPrefixSlot = getFuncSlot(toolbarOptSlots, 'toolPrefix');
|
|
13036
|
+
const toolSuffixSlot = getFuncSlot(toolbarOptSlots, 'toolSuffix');
|
|
12883
13037
|
if (buttonsSlot) {
|
|
12884
13038
|
toolbarSlots.buttons = buttonsSlot;
|
|
12885
13039
|
}
|
|
13040
|
+
if (buttonPrefixSlot) {
|
|
13041
|
+
toolbarSlots.buttonPrefix = buttonPrefixSlot;
|
|
13042
|
+
}
|
|
13043
|
+
if (buttonSuffixSlot) {
|
|
13044
|
+
toolbarSlots.buttonSuffix = buttonSuffixSlot;
|
|
13045
|
+
}
|
|
12886
13046
|
if (toolsSlot) {
|
|
12887
13047
|
toolbarSlots.tools = toolsSlot;
|
|
12888
13048
|
}
|
|
13049
|
+
if (toolPrefixSlot) {
|
|
13050
|
+
toolbarSlots.toolPrefix = toolPrefixSlot;
|
|
13051
|
+
}
|
|
13052
|
+
if (toolSuffixSlot) {
|
|
13053
|
+
toolbarSlots.toolSuffix = toolSuffixSlot;
|
|
13054
|
+
}
|
|
12889
13055
|
}
|
|
12890
13056
|
slotVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(toolbar, {
|
|
12891
13057
|
ref: refToolbar,
|
|
@@ -19102,7 +19268,8 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19102
19268
|
internalData
|
|
19103
19269
|
} = $xeTable;
|
|
19104
19270
|
const {
|
|
19105
|
-
computeCustomOpts
|
|
19271
|
+
computeCustomOpts,
|
|
19272
|
+
computeRowGroupFields
|
|
19106
19273
|
} = $xeTable.getComputeMaps();
|
|
19107
19274
|
const {
|
|
19108
19275
|
refElem
|
|
@@ -19173,7 +19340,9 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19173
19340
|
};
|
|
19174
19341
|
const saveCustom = () => {
|
|
19175
19342
|
const {
|
|
19176
|
-
customColumnList
|
|
19343
|
+
customColumnList,
|
|
19344
|
+
aggHandleFields,
|
|
19345
|
+
rowGroupList
|
|
19177
19346
|
} = reactData;
|
|
19178
19347
|
const customOpts = computeCustomOpts.value;
|
|
19179
19348
|
const {
|
|
@@ -19212,7 +19381,18 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19212
19381
|
setTimeout(() => {
|
|
19213
19382
|
reactData.isDragColMove = false;
|
|
19214
19383
|
}, 1000);
|
|
19215
|
-
return $xeTable.saveCustomStore('confirm')
|
|
19384
|
+
return $xeTable.saveCustomStore('confirm').then(() => {
|
|
19385
|
+
if ($xeTable.handlePivotTableAggregateData) {
|
|
19386
|
+
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
19387
|
+
// 改动聚合分组
|
|
19388
|
+
if (aggHandleFields.length) {
|
|
19389
|
+
$xeTable.setRowGroups(aggHandleFields);
|
|
19390
|
+
} else {
|
|
19391
|
+
$xeTable.clearRowGroups();
|
|
19392
|
+
}
|
|
19393
|
+
}
|
|
19394
|
+
}
|
|
19395
|
+
});
|
|
19216
19396
|
};
|
|
19217
19397
|
const cancelCustom = () => {
|
|
19218
19398
|
const {
|
|
@@ -19317,6 +19497,9 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19317
19497
|
saveCustom,
|
|
19318
19498
|
cancelCustom,
|
|
19319
19499
|
resetCustom(options) {
|
|
19500
|
+
const {
|
|
19501
|
+
rowGroupList
|
|
19502
|
+
} = reactData;
|
|
19320
19503
|
const {
|
|
19321
19504
|
collectColumn
|
|
19322
19505
|
} = internalData;
|
|
@@ -19350,7 +19533,18 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19350
19533
|
});
|
|
19351
19534
|
reactData.isCustomStatus = false;
|
|
19352
19535
|
$xeTable.saveCustomStore('reset');
|
|
19353
|
-
return $xeTable.handleCustom()
|
|
19536
|
+
return $xeTable.handleCustom().then(() => {
|
|
19537
|
+
if ($xeTable.handlePivotTableAggregateData) {
|
|
19538
|
+
const rowGroupFields = computeRowGroupFields.value;
|
|
19539
|
+
if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
|
|
19540
|
+
if (rowGroupFields && rowGroupFields.length) {
|
|
19541
|
+
$xeTable.setRowGroups(rowGroupFields);
|
|
19542
|
+
} else {
|
|
19543
|
+
$xeTable.clearRowGroups();
|
|
19544
|
+
}
|
|
19545
|
+
}
|
|
19546
|
+
}
|
|
19547
|
+
});
|
|
19354
19548
|
},
|
|
19355
19549
|
toggleCustomAllCheckbox() {
|
|
19356
19550
|
const {
|
|
@@ -21391,6 +21585,12 @@ const Toolbar = VxeToolbar;
|
|
|
21391
21585
|
replaceSuccess: '成功替换 {0} 个单元格'
|
|
21392
21586
|
}
|
|
21393
21587
|
},
|
|
21588
|
+
extendPivotTable: {
|
|
21589
|
+
aggregation: {
|
|
21590
|
+
grouping: '分组',
|
|
21591
|
+
values: '值'
|
|
21592
|
+
}
|
|
21593
|
+
},
|
|
21394
21594
|
filterComplexInput: {
|
|
21395
21595
|
menus: {
|
|
21396
21596
|
fixedColumn: '冻结列',
|