vxe-table 3.14.0-beta.2 → 3.14.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid/src/grid.js +78 -48
- package/es/locale/lang/ar-EG.js +7 -1
- package/es/locale/lang/de-DE.js +7 -1
- package/es/locale/lang/en-US.js +7 -1
- package/es/locale/lang/es-ES.js +7 -1
- package/es/locale/lang/fr-FR.js +7 -1
- package/es/locale/lang/hu-HU.js +7 -1
- package/es/locale/lang/hy-AM.js +7 -1
- package/es/locale/lang/id-ID.js +7 -1
- package/es/locale/lang/it-IT.js +7 -1
- package/es/locale/lang/ja-JP.js +7 -1
- package/es/locale/lang/ko-KR.js +7 -1
- package/es/locale/lang/nb-NO.js +7 -1
- package/es/locale/lang/pt-BR.js +7 -1
- package/es/locale/lang/ru-RU.js +7 -1
- package/es/locale/lang/th-TH.js +7 -1
- package/es/locale/lang/ug-CN.js +7 -1
- package/es/locale/lang/uk-UA.js +7 -1
- package/es/locale/lang/vi-VN.js +7 -1
- package/es/locale/lang/zh-CHT.js +7 -1
- package/es/locale/lang/zh-CN.js +7 -1
- package/es/style.css +1 -1
- package/es/table/module/edit/mixin.js +14 -9
- package/es/table/module/filter/panel.js +12 -2
- package/es/table/module/keyboard/mixin.js +86 -21
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/render/index.js +90 -59
- package/es/table/src/body.js +22 -17
- package/es/table/src/cell.js +25 -20
- package/es/table/src/footer.js +9 -4
- package/es/table/src/header.js +2 -2
- package/es/table/src/methods.js +942 -678
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +74 -32
- package/es/table/src/util.js +65 -7
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/grid/src/grid.js +85 -65
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1641 -1076
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +7 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/fr-FR.js +7 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +7 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -1
- package/lib/locale/lang/hy-AM.js +7 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +7 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +7 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/ko-KR.js +7 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -1
- package/lib/locale/lang/nb-NO.js +7 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/ru-RU.js +7 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -1
- package/lib/locale/lang/th-TH.js +7 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +7 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +7 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -1
- package/lib/locale/lang/vi-VN.js +7 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +7 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -1
- package/lib/locale/lang/zh-CN.js +7 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +16 -11
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +8 -2
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +89 -25
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +3 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +99 -64
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +27 -17
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +37 -21
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +9 -3
- package/lib/table/src/footer.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/methods.js +1101 -798
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +79 -31
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +72 -7
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +92 -57
- package/packages/locale/lang/ar-EG.ts +7 -1
- package/packages/locale/lang/de-DE.ts +7 -1
- package/packages/locale/lang/en-US.ts +7 -1
- package/packages/locale/lang/es-ES.ts +7 -1
- package/packages/locale/lang/fr-FR.ts +7 -1
- package/packages/locale/lang/hu-HU.ts +7 -1
- package/packages/locale/lang/hy-AM.ts +7 -1
- package/packages/locale/lang/id-ID.ts +7 -1
- package/packages/locale/lang/it-IT.ts +7 -1
- package/packages/locale/lang/ja-JP.ts +7 -1
- package/packages/locale/lang/ko-KR.ts +7 -1
- package/packages/locale/lang/nb-NO.ts +7 -1
- package/packages/locale/lang/pt-BR.ts +7 -1
- package/packages/locale/lang/ru-RU.ts +7 -1
- package/packages/locale/lang/th-TH.ts +7 -1
- package/packages/locale/lang/ug-CN.ts +7 -1
- package/packages/locale/lang/uk-UA.ts +7 -1
- package/packages/locale/lang/vi-VN.ts +7 -1
- package/packages/locale/lang/zh-CHT.ts +7 -1
- package/packages/locale/lang/zh-CN.ts +7 -1
- package/packages/table/module/edit/mixin.ts +17 -12
- package/packages/table/module/filter/panel.ts +12 -2
- package/packages/table/module/keyboard/mixin.ts +94 -27
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/render/index.ts +89 -57
- package/packages/table/src/body.ts +21 -16
- package/packages/table/src/cell.ts +25 -20
- package/packages/table/src/footer.ts +9 -4
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/methods.ts +1035 -720
- package/packages/table/src/props.ts +16 -12
- package/packages/table/src/table.ts +87 -35
- package/packages/table/src/util.ts +73 -7
- /package/es/{iconfont.1741079977180.ttf → iconfont.1742437924038.ttf} +0 -0
- /package/es/{iconfont.1741079977180.woff → iconfont.1742437924038.woff} +0 -0
- /package/es/{iconfont.1741079977180.woff2 → iconfont.1742437924038.woff2} +0 -0
- /package/lib/{iconfont.1741079977180.ttf → iconfont.1742437924038.ttf} +0 -0
- /package/lib/{iconfont.1741079977180.woff → iconfont.1742437924038.woff} +0 -0
- /package/lib/{iconfont.1741079977180.woff2 → iconfont.1742437924038.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
5
|
define([, "@vxe-ui/core", "xe-utils"], factory);
|
|
6
6
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["
|
|
7
|
+
exports["VxeUITable"] = factory(require("vue"), require("@vxe-ui/core"), require("xe-utils"));
|
|
8
8
|
else
|
|
9
|
-
root["
|
|
9
|
+
root["VxeUITable"] = factory(root["Vue"], root["VxeUI"], root["XEUtils"]);
|
|
10
10
|
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__9274__, __WEBPACK_EXTERNAL_MODULE__4345__, __WEBPACK_EXTERNAL_MODULE__8871__) {
|
|
11
11
|
return /******/ (function() { // webpackBootstrap
|
|
12
12
|
/******/ "use strict";
|
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.14.0-beta.
|
|
2223
|
+
const version = "3.14.0-beta.21";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2843,7 +2843,7 @@ function isNodeElement(elem) {
|
|
|
2843
2843
|
const {
|
|
2844
2844
|
log: log_log
|
|
2845
2845
|
} = core_.VxeUI;
|
|
2846
|
-
const log_version = `table v${"3.14.0-beta.
|
|
2846
|
+
const log_version = `table v${"3.14.0-beta.21"}`;
|
|
2847
2847
|
const warnLog = log_log.create('warn', log_version);
|
|
2848
2848
|
const errLog = log_log.create('error', log_version);
|
|
2849
2849
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3026,6 +3026,7 @@ class ColumnInfo {
|
|
|
3026
3026
|
|
|
3027
3027
|
|
|
3028
3028
|
|
|
3029
|
+
|
|
3029
3030
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
3030
3031
|
const result = [];
|
|
3031
3032
|
columns.forEach(column => {
|
|
@@ -3111,13 +3112,63 @@ function getRowUniqueId() {
|
|
|
3111
3112
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('row_');
|
|
3112
3113
|
}
|
|
3113
3114
|
// 行主键 key
|
|
3114
|
-
function getRowkey($
|
|
3115
|
-
|
|
3115
|
+
function getRowkey($xeTable) {
|
|
3116
|
+
const props = $xeTable;
|
|
3117
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
3118
|
+
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`;
|
|
3116
3119
|
}
|
|
3117
3120
|
// 行主键 value
|
|
3118
|
-
function getRowid($
|
|
3119
|
-
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, getRowkey($
|
|
3120
|
-
return
|
|
3121
|
+
function getRowid($xeTable, row) {
|
|
3122
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, getRowkey($xeTable));
|
|
3123
|
+
return encodeRowid(rowid);
|
|
3124
|
+
}
|
|
3125
|
+
function createHandleUpdateRowId($xeTable) {
|
|
3126
|
+
const rowKey = getRowkey($xeTable);
|
|
3127
|
+
const isDeepKey = rowKey.indexOf('.') > -1;
|
|
3128
|
+
const updateRId = isDeepKey ? updateDeepRowKey : updateFastRowKey;
|
|
3129
|
+
return {
|
|
3130
|
+
rowKey,
|
|
3131
|
+
handleUpdateRowId(row) {
|
|
3132
|
+
return row ? updateRId(row, rowKey) : null;
|
|
3133
|
+
}
|
|
3134
|
+
};
|
|
3135
|
+
}
|
|
3136
|
+
function createHandleGetRowId($xeTable) {
|
|
3137
|
+
const rowKey = getRowkey($xeTable);
|
|
3138
|
+
const isDeepKey = rowKey.indexOf('.') > -1;
|
|
3139
|
+
const getRId = isDeepKey ? getDeepRowIdByKey : getFastRowIdByKey;
|
|
3140
|
+
return {
|
|
3141
|
+
rowKey,
|
|
3142
|
+
handleGetRowId(row) {
|
|
3143
|
+
return row ? getRId(row, rowKey) : null;
|
|
3144
|
+
}
|
|
3145
|
+
};
|
|
3146
|
+
}
|
|
3147
|
+
// 编码行主键
|
|
3148
|
+
function encodeRowid(rowVal) {
|
|
3149
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
|
|
3150
|
+
}
|
|
3151
|
+
function getDeepRowIdByKey(row, rowKey) {
|
|
3152
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, rowKey);
|
|
3153
|
+
}
|
|
3154
|
+
function updateDeepRowKey(row, rowKey) {
|
|
3155
|
+
let rowid = getDeepRowIdByKey(row, rowKey);
|
|
3156
|
+
if (eqEmptyValue(rowid)) {
|
|
3157
|
+
rowid = getRowUniqueId();
|
|
3158
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowKey, rowid);
|
|
3159
|
+
}
|
|
3160
|
+
return rowid;
|
|
3161
|
+
}
|
|
3162
|
+
function getFastRowIdByKey(row, rowKey) {
|
|
3163
|
+
return row[rowKey];
|
|
3164
|
+
}
|
|
3165
|
+
function updateFastRowKey(row, rowKey) {
|
|
3166
|
+
let rowid = getFastRowIdByKey(row, rowKey);
|
|
3167
|
+
if (eqEmptyValue(rowid)) {
|
|
3168
|
+
rowid = getRowUniqueId();
|
|
3169
|
+
row[rowKey] = rowid;
|
|
3170
|
+
}
|
|
3171
|
+
return rowid;
|
|
3121
3172
|
}
|
|
3122
3173
|
function getPaddingLeftRightSize(elem) {
|
|
3123
3174
|
if (elem) {
|
|
@@ -3143,12 +3194,19 @@ function getCellHeight(height) {
|
|
|
3143
3194
|
}
|
|
3144
3195
|
return height || 0;
|
|
3145
3196
|
}
|
|
3146
|
-
function handleFieldOrColumn(
|
|
3197
|
+
function handleFieldOrColumn($xeTable, fieldOrColumn) {
|
|
3147
3198
|
if (fieldOrColumn) {
|
|
3148
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ?
|
|
3199
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
|
|
3149
3200
|
}
|
|
3150
3201
|
return null;
|
|
3151
3202
|
}
|
|
3203
|
+
const handleRowidOrRow = ($xeTable, rowidOrRow) => {
|
|
3204
|
+
if (rowidOrRow) {
|
|
3205
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowidOrRow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
|
|
3206
|
+
return $xeTable.getRowById(rowid);
|
|
3207
|
+
}
|
|
3208
|
+
return null;
|
|
3209
|
+
};
|
|
3152
3210
|
// 组装列配置
|
|
3153
3211
|
function assembleColumn(_vm) {
|
|
3154
3212
|
const {
|
|
@@ -4053,11 +4111,12 @@ const Cell = {
|
|
|
4053
4111
|
const tableReactData = $table;
|
|
4054
4112
|
const tableInternalData = $table;
|
|
4055
4113
|
const {
|
|
4056
|
-
|
|
4057
|
-
treeExpandLazyLoadedMaps
|
|
4114
|
+
treeExpandedFlag
|
|
4058
4115
|
} = tableReactData;
|
|
4059
4116
|
const {
|
|
4060
|
-
fullAllDataRowIdData
|
|
4117
|
+
fullAllDataRowIdData,
|
|
4118
|
+
treeExpandedMaps,
|
|
4119
|
+
treeExpandLazyLoadedMaps
|
|
4061
4120
|
} = tableInternalData;
|
|
4062
4121
|
const treeOpts = $table.computeTreeOpts;
|
|
4063
4122
|
const {
|
|
@@ -4092,7 +4151,7 @@ const Cell = {
|
|
|
4092
4151
|
}
|
|
4093
4152
|
if (!isHidden) {
|
|
4094
4153
|
const rowid = getRowid($table, row);
|
|
4095
|
-
isActive = !!treeExpandedMaps[rowid];
|
|
4154
|
+
isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid];
|
|
4096
4155
|
if (lazy) {
|
|
4097
4156
|
const rest = fullAllDataRowIdData[rowid];
|
|
4098
4157
|
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
|
|
@@ -4272,7 +4331,12 @@ const Cell = {
|
|
|
4272
4331
|
const headerSlot = slots ? slots.header : null;
|
|
4273
4332
|
const titleSlot = slots ? slots.title : null;
|
|
4274
4333
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
4275
|
-
const
|
|
4334
|
+
const {
|
|
4335
|
+
checkStrictly,
|
|
4336
|
+
showHeader,
|
|
4337
|
+
headerTitle
|
|
4338
|
+
} = checkboxOpts;
|
|
4339
|
+
const colTitle = column.getTitle();
|
|
4276
4340
|
const ons = {};
|
|
4277
4341
|
if (!isHidden) {
|
|
4278
4342
|
ons.click = evnt => {
|
|
@@ -4290,10 +4354,10 @@ const Cell = {
|
|
|
4290
4354
|
if (headerSlot) {
|
|
4291
4355
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)));
|
|
4292
4356
|
}
|
|
4293
|
-
if (
|
|
4357
|
+
if (checkStrictly ? !showHeader : showHeader === false) {
|
|
4294
4358
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [h('span', {
|
|
4295
4359
|
class: 'vxe-checkbox--label'
|
|
4296
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) :
|
|
4360
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)]));
|
|
4297
4361
|
}
|
|
4298
4362
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [h('span', {
|
|
4299
4363
|
class: ['vxe-cell--checkbox', {
|
|
@@ -4302,14 +4366,14 @@ const Cell = {
|
|
|
4302
4366
|
'is--indeterminate': isAllCheckboxIndeterminate
|
|
4303
4367
|
}],
|
|
4304
4368
|
attrs: {
|
|
4305
|
-
title: cell_getI18n('vxe.table.allTitle')
|
|
4369
|
+
title: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(headerTitle) ? cell_getI18n('vxe.table.allTitle') : `${headerTitle || ''}`
|
|
4306
4370
|
},
|
|
4307
4371
|
on: ons
|
|
4308
4372
|
}, [h('span', {
|
|
4309
4373
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? cell_getIcon().TABLE_CHECKBOX_CHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
4310
|
-
})].concat(titleSlot ||
|
|
4374
|
+
})].concat(titleSlot || colTitle ? [h('span', {
|
|
4311
4375
|
class: 'vxe-checkbox--label'
|
|
4312
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) :
|
|
4376
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)] : []))]));
|
|
4313
4377
|
},
|
|
4314
4378
|
renderCheckboxCell(h, params) {
|
|
4315
4379
|
const {
|
|
@@ -4320,13 +4384,17 @@ const Cell = {
|
|
|
4320
4384
|
} = params;
|
|
4321
4385
|
const tableProps = $table;
|
|
4322
4386
|
const tableReactData = $table;
|
|
4387
|
+
const tableInternalData = $table;
|
|
4323
4388
|
const {
|
|
4324
4389
|
treeConfig
|
|
4325
4390
|
} = tableProps;
|
|
4326
4391
|
const {
|
|
4327
|
-
|
|
4328
|
-
treeIndeterminateMaps
|
|
4392
|
+
updateCheckboxFlag
|
|
4329
4393
|
} = tableReactData;
|
|
4394
|
+
const {
|
|
4395
|
+
selectCheckboxMaps,
|
|
4396
|
+
treeIndeterminateRowMaps
|
|
4397
|
+
} = tableInternalData;
|
|
4330
4398
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
4331
4399
|
const {
|
|
4332
4400
|
labelField,
|
|
@@ -4347,7 +4415,7 @@ const Cell = {
|
|
|
4347
4415
|
const ons = {};
|
|
4348
4416
|
if (!isHidden) {
|
|
4349
4417
|
const rowid = getRowid($table, row);
|
|
4350
|
-
isChecked = !!selectCheckboxMaps[rowid];
|
|
4418
|
+
isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
|
|
4351
4419
|
ons.click = evnt => {
|
|
4352
4420
|
if (!isDisabled && isVisible) {
|
|
4353
4421
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
@@ -4359,7 +4427,7 @@ const Cell = {
|
|
|
4359
4427
|
});
|
|
4360
4428
|
}
|
|
4361
4429
|
if (treeConfig) {
|
|
4362
|
-
indeterminate = !!
|
|
4430
|
+
indeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
4363
4431
|
}
|
|
4364
4432
|
}
|
|
4365
4433
|
const checkboxParams = {
|
|
@@ -4405,12 +4473,16 @@ const Cell = {
|
|
|
4405
4473
|
} = params;
|
|
4406
4474
|
const tableProps = $table;
|
|
4407
4475
|
const tableReactData = $table;
|
|
4476
|
+
const tableInternalData = $table;
|
|
4408
4477
|
const {
|
|
4409
4478
|
treeConfig
|
|
4410
4479
|
} = tableProps;
|
|
4411
4480
|
const {
|
|
4412
|
-
|
|
4481
|
+
updateCheckboxFlag
|
|
4413
4482
|
} = tableReactData;
|
|
4483
|
+
const {
|
|
4484
|
+
treeIndeterminateRowMaps
|
|
4485
|
+
} = tableInternalData;
|
|
4414
4486
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
4415
4487
|
const {
|
|
4416
4488
|
labelField,
|
|
@@ -4433,7 +4505,7 @@ const Cell = {
|
|
|
4433
4505
|
const ons = {};
|
|
4434
4506
|
if (!isHidden) {
|
|
4435
4507
|
const rowid = getRowid($table, row);
|
|
4436
|
-
isChecked = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
|
|
4508
|
+
isChecked = !!updateCheckboxFlag && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
|
|
4437
4509
|
ons.click = evnt => {
|
|
4438
4510
|
if (!isDisabled && isVisible) {
|
|
4439
4511
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
@@ -4445,7 +4517,7 @@ const Cell = {
|
|
|
4445
4517
|
});
|
|
4446
4518
|
}
|
|
4447
4519
|
if (treeConfig) {
|
|
4448
|
-
isIndeterminate = !!
|
|
4520
|
+
isIndeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
4449
4521
|
}
|
|
4450
4522
|
}
|
|
4451
4523
|
const checkboxParams = {
|
|
@@ -4492,11 +4564,11 @@ const Cell = {
|
|
|
4492
4564
|
row,
|
|
4493
4565
|
column
|
|
4494
4566
|
} = params;
|
|
4495
|
-
const
|
|
4567
|
+
const tableInternalData = $table;
|
|
4496
4568
|
const {
|
|
4497
4569
|
rowExpandedMaps,
|
|
4498
4570
|
rowExpandLazyLoadedMaps
|
|
4499
|
-
} =
|
|
4571
|
+
} = tableInternalData;
|
|
4500
4572
|
const expandOpts = $table.computeExpandOpts;
|
|
4501
4573
|
const {
|
|
4502
4574
|
lazy,
|
|
@@ -4608,6 +4680,8 @@ const Cell = {
|
|
|
4608
4680
|
const {
|
|
4609
4681
|
showIcon,
|
|
4610
4682
|
allowBtn,
|
|
4683
|
+
ascTitle,
|
|
4684
|
+
descTitle,
|
|
4611
4685
|
iconLayout,
|
|
4612
4686
|
iconAsc,
|
|
4613
4687
|
iconDesc,
|
|
@@ -4621,7 +4695,7 @@ const Cell = {
|
|
|
4621
4695
|
'sort--active': column.order === 'asc'
|
|
4622
4696
|
}],
|
|
4623
4697
|
attrs: {
|
|
4624
|
-
title: cell_getI18n('vxe.table.sortAsc')
|
|
4698
|
+
title: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(ascTitle) ? cell_getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
|
|
4625
4699
|
},
|
|
4626
4700
|
on: allowBtn ? {
|
|
4627
4701
|
click(evnt) {
|
|
@@ -4634,7 +4708,7 @@ const Cell = {
|
|
|
4634
4708
|
'sort--active': column.order === 'desc'
|
|
4635
4709
|
}],
|
|
4636
4710
|
attrs: {
|
|
4637
|
-
title: cell_getI18n('vxe.table.sortDesc')
|
|
4711
|
+
title: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(descTitle) ? cell_getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
|
|
4638
4712
|
},
|
|
4639
4713
|
on: allowBtn ? {
|
|
4640
4714
|
click(evnt) {
|
|
@@ -5085,6 +5159,7 @@ const {
|
|
|
5085
5159
|
interceptor: methods_interceptor,
|
|
5086
5160
|
createEvent
|
|
5087
5161
|
} = core_.VxeUI;
|
|
5162
|
+
const supportMaxRow = 5e6;
|
|
5088
5163
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
5089
5164
|
const maxYHeight = 5e6;
|
|
5090
5165
|
const maxXWidth = 5e6;
|
|
@@ -5351,7 +5426,7 @@ function cacheColumnMap($xeTable) {
|
|
|
5351
5426
|
fullColumnFieldData[field] = rest;
|
|
5352
5427
|
} else {
|
|
5353
5428
|
if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
|
|
5354
|
-
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field
|
|
5429
|
+
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
|
|
5355
5430
|
}
|
|
5356
5431
|
}
|
|
5357
5432
|
if (!hasFixed && fixed) {
|
|
@@ -5457,9 +5532,12 @@ function updateAfterListIndex($xeTable) {
|
|
|
5457
5532
|
fullDataRowIdData,
|
|
5458
5533
|
fullAllDataRowIdData
|
|
5459
5534
|
} = internalData;
|
|
5535
|
+
const {
|
|
5536
|
+
handleGetRowId
|
|
5537
|
+
} = createHandleGetRowId($xeTable);
|
|
5460
5538
|
const fullMaps = {};
|
|
5461
5539
|
afterFullData.forEach((row, index) => {
|
|
5462
|
-
const rowid =
|
|
5540
|
+
const rowid = handleGetRowId(row);
|
|
5463
5541
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5464
5542
|
const seq = index + 1;
|
|
5465
5543
|
if (rowRest) {
|
|
@@ -5513,8 +5591,11 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5513
5591
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5514
5592
|
const fullMaps = {};
|
|
5515
5593
|
if (treeConfig) {
|
|
5594
|
+
const {
|
|
5595
|
+
handleGetRowId
|
|
5596
|
+
} = createHandleGetRowId($xeTable);
|
|
5516
5597
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
5517
|
-
const rowid =
|
|
5598
|
+
const rowid = handleGetRowId(row);
|
|
5518
5599
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5519
5600
|
const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
|
|
5520
5601
|
if (rowRest) {
|
|
@@ -5556,25 +5637,25 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5556
5637
|
*/
|
|
5557
5638
|
function handleVirtualTreeToList($xeTable) {
|
|
5558
5639
|
const props = $xeTable;
|
|
5559
|
-
const reactData = $xeTable;
|
|
5560
5640
|
const internalData = $xeTable;
|
|
5561
5641
|
const {
|
|
5562
5642
|
treeConfig
|
|
5563
5643
|
} = props;
|
|
5564
5644
|
const {
|
|
5645
|
+
fullAllDataRowIdData,
|
|
5565
5646
|
treeExpandedMaps
|
|
5566
|
-
} = reactData;
|
|
5567
|
-
const {
|
|
5568
|
-
fullAllDataRowIdData
|
|
5569
5647
|
} = internalData;
|
|
5570
5648
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
5571
5649
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5572
5650
|
if (treeConfig && treeOpts.transform) {
|
|
5651
|
+
const {
|
|
5652
|
+
handleGetRowId
|
|
5653
|
+
} = createHandleGetRowId($xeTable);
|
|
5573
5654
|
const fullData = [];
|
|
5574
5655
|
const expandMaps = {};
|
|
5575
5656
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterTreeFullData, (row, index, items, path, parentRow) => {
|
|
5576
|
-
const rowid =
|
|
5577
|
-
const parentRowid =
|
|
5657
|
+
const rowid = handleGetRowId(row);
|
|
5658
|
+
const parentRowid = handleGetRowId(parentRow);
|
|
5578
5659
|
if (!parentRow || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
|
|
5579
5660
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5580
5661
|
if (rowRest) {
|
|
@@ -5963,6 +6044,21 @@ function updateStyle($xeTable) {
|
|
|
5963
6044
|
}
|
|
5964
6045
|
return $xeTable.$nextTick();
|
|
5965
6046
|
}
|
|
6047
|
+
function checkValidate($xeTable, type) {
|
|
6048
|
+
if ($xeTable.triggerValidate) {
|
|
6049
|
+
return $xeTable.triggerValidate(type);
|
|
6050
|
+
}
|
|
6051
|
+
return $xeTable.$nextTick();
|
|
6052
|
+
}
|
|
6053
|
+
/**
|
|
6054
|
+
* 当单元格发生改变时
|
|
6055
|
+
* 如果存在规则,则校验
|
|
6056
|
+
*/
|
|
6057
|
+
function handleChangeCell($xeTable, evnt, params) {
|
|
6058
|
+
checkValidate($xeTable, 'blur').catch(e => e).then(() => {
|
|
6059
|
+
$xeTable.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
|
|
6060
|
+
});
|
|
6061
|
+
}
|
|
5966
6062
|
function handleRadioReserveRow($xeTable, row) {
|
|
5967
6063
|
const internalData = $xeTable;
|
|
5968
6064
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -6014,12 +6110,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6014
6110
|
const {
|
|
6015
6111
|
treeConfig
|
|
6016
6112
|
} = props;
|
|
6017
|
-
const {
|
|
6018
|
-
selectCheckboxMaps
|
|
6019
|
-
} = reactData;
|
|
6020
6113
|
const {
|
|
6021
6114
|
afterFullData,
|
|
6022
|
-
checkboxReserveRowMap
|
|
6115
|
+
checkboxReserveRowMap,
|
|
6116
|
+
selectCheckboxMaps
|
|
6023
6117
|
} = internalData;
|
|
6024
6118
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
6025
6119
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -6029,6 +6123,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6029
6123
|
reserve,
|
|
6030
6124
|
checkMethod
|
|
6031
6125
|
} = checkboxOpts;
|
|
6126
|
+
const {
|
|
6127
|
+
handleGetRowId
|
|
6128
|
+
} = createHandleGetRowId($xeTable);
|
|
6129
|
+
// indeterminateField 仅支持读取
|
|
6032
6130
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
6033
6131
|
const selectRowMaps = {};
|
|
6034
6132
|
/**
|
|
@@ -6041,7 +6139,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6041
6139
|
row
|
|
6042
6140
|
})) {
|
|
6043
6141
|
if (checked) {
|
|
6044
|
-
selectRowMaps[
|
|
6142
|
+
selectRowMaps[handleGetRowId(row)] = row;
|
|
6045
6143
|
}
|
|
6046
6144
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, checked);
|
|
6047
6145
|
}
|
|
@@ -6073,7 +6171,8 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6073
6171
|
if (isForce || !checkMethod || checkMethod({
|
|
6074
6172
|
row
|
|
6075
6173
|
})) {
|
|
6076
|
-
|
|
6174
|
+
const rowid = handleGetRowId(row);
|
|
6175
|
+
selectRowMaps[rowid] = row;
|
|
6077
6176
|
}
|
|
6078
6177
|
}, {
|
|
6079
6178
|
children: childrenField
|
|
@@ -6085,7 +6184,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6085
6184
|
*/
|
|
6086
6185
|
if (!isForce && checkMethod) {
|
|
6087
6186
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterFullData, row => {
|
|
6088
|
-
const rowid =
|
|
6187
|
+
const rowid = handleGetRowId(row);
|
|
6089
6188
|
if (checkMethod({
|
|
6090
6189
|
row
|
|
6091
6190
|
}) ? 0 : selectCheckboxMaps[rowid]) {
|
|
@@ -6105,7 +6204,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6105
6204
|
*/
|
|
6106
6205
|
if (!isForce && checkMethod) {
|
|
6107
6206
|
afterFullData.forEach(row => {
|
|
6108
|
-
const rowid =
|
|
6207
|
+
const rowid = handleGetRowId(row);
|
|
6109
6208
|
if (selectCheckboxMaps[rowid] || checkMethod({
|
|
6110
6209
|
row
|
|
6111
6210
|
})) {
|
|
@@ -6114,7 +6213,8 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6114
6213
|
});
|
|
6115
6214
|
} else {
|
|
6116
6215
|
afterFullData.forEach(row => {
|
|
6117
|
-
|
|
6216
|
+
const rowid = handleGetRowId(row);
|
|
6217
|
+
selectRowMaps[rowid] = row;
|
|
6118
6218
|
});
|
|
6119
6219
|
}
|
|
6120
6220
|
} else {
|
|
@@ -6125,7 +6225,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6125
6225
|
*/
|
|
6126
6226
|
if (!isForce && checkMethod) {
|
|
6127
6227
|
afterFullData.forEach(row => {
|
|
6128
|
-
const rowid =
|
|
6228
|
+
const rowid = handleGetRowId(row);
|
|
6129
6229
|
if (checkMethod({
|
|
6130
6230
|
row
|
|
6131
6231
|
}) ? 0 : selectCheckboxMaps[rowid]) {
|
|
@@ -6145,10 +6245,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6145
6245
|
afterFullData.forEach(row => handleCheckboxReserveRow($xeTable, row, false));
|
|
6146
6246
|
}
|
|
6147
6247
|
}
|
|
6148
|
-
reactData.
|
|
6248
|
+
reactData.updateCheckboxFlag++;
|
|
6249
|
+
internalData.selectCheckboxMaps = checkField ? {} : selectRowMaps;
|
|
6149
6250
|
reactData.isAllSelected = checked;
|
|
6150
6251
|
reactData.isIndeterminate = false;
|
|
6151
|
-
reactData.treeIndeterminateMaps = {};
|
|
6152
6252
|
internalData.treeIndeterminateRowMaps = {};
|
|
6153
6253
|
$xeTable.checkSelectionStatus();
|
|
6154
6254
|
return $xeTable.$nextTick();
|
|
@@ -6164,15 +6264,15 @@ function handleReserveStatus($xeTable) {
|
|
|
6164
6264
|
const {
|
|
6165
6265
|
expandColumn,
|
|
6166
6266
|
currentRow,
|
|
6167
|
-
|
|
6168
|
-
selectRadioRow,
|
|
6169
|
-
rowExpandedMaps,
|
|
6170
|
-
treeExpandedMaps
|
|
6267
|
+
selectRadioRow
|
|
6171
6268
|
} = reactData;
|
|
6172
6269
|
const {
|
|
6173
6270
|
fullDataRowIdData,
|
|
6174
6271
|
fullAllDataRowIdData,
|
|
6175
|
-
radioReserveRow
|
|
6272
|
+
radioReserveRow,
|
|
6273
|
+
selectCheckboxMaps,
|
|
6274
|
+
treeExpandedMaps,
|
|
6275
|
+
rowExpandedMaps
|
|
6176
6276
|
} = internalData;
|
|
6177
6277
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
6178
6278
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -6190,7 +6290,8 @@ function handleReserveStatus($xeTable) {
|
|
|
6190
6290
|
}
|
|
6191
6291
|
}
|
|
6192
6292
|
// 复选框
|
|
6193
|
-
|
|
6293
|
+
internalData.selectCheckboxMaps = getRecoverRowMaps($xeTable, selectCheckboxMaps); // 刷新多选行状态
|
|
6294
|
+
reactData.updateCheckboxFlag++;
|
|
6194
6295
|
// 还原保留选中状态
|
|
6195
6296
|
if (checkboxOpts.reserve) {
|
|
6196
6297
|
handleCheckedCheckboxRow($xeTable, handleReserveRow($xeTable, internalData.checkboxReserveRowMap), true, true);
|
|
@@ -6199,17 +6300,194 @@ function handleReserveStatus($xeTable) {
|
|
|
6199
6300
|
reactData.currentRow = null; // 刷新当前行状态
|
|
6200
6301
|
}
|
|
6201
6302
|
// 行展开
|
|
6202
|
-
|
|
6303
|
+
internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps($xeTable, rowExpandedMaps) : {}; // 刷新行展开状态
|
|
6304
|
+
reactData.rowExpandedFlag++;
|
|
6203
6305
|
// 还原保留状态
|
|
6204
6306
|
if (expandColumn && expandOpts.reserve) {
|
|
6205
6307
|
$xeTable.setRowExpand(handleReserveRow($xeTable, internalData.rowExpandedReserveRowMap), true);
|
|
6206
6308
|
}
|
|
6207
6309
|
// 树展开
|
|
6208
|
-
|
|
6310
|
+
internalData.treeExpandedMaps = treeConfig ? getRecoverRowMaps($xeTable, treeExpandedMaps) : {}; // 刷新树展开状态
|
|
6311
|
+
reactData.treeExpandedFlag++;
|
|
6209
6312
|
if (treeConfig && treeOpts.reserve) {
|
|
6210
6313
|
$xeTable.setTreeExpand(handleReserveRow($xeTable, internalData.treeExpandedReserveRowMap), true);
|
|
6211
6314
|
}
|
|
6212
6315
|
}
|
|
6316
|
+
/**
|
|
6317
|
+
* 处理默认展开树节点
|
|
6318
|
+
*/
|
|
6319
|
+
const handleDefaultTreeExpand = $xeTable => {
|
|
6320
|
+
const props = $xeTable;
|
|
6321
|
+
const internalData = $xeTable;
|
|
6322
|
+
const {
|
|
6323
|
+
treeConfig
|
|
6324
|
+
} = props;
|
|
6325
|
+
if (treeConfig) {
|
|
6326
|
+
const {
|
|
6327
|
+
tableFullData
|
|
6328
|
+
} = internalData;
|
|
6329
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
6330
|
+
const {
|
|
6331
|
+
expandAll,
|
|
6332
|
+
expandRowKeys
|
|
6333
|
+
} = treeOpts;
|
|
6334
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6335
|
+
if (expandAll) {
|
|
6336
|
+
$xeTable.setAllTreeExpand(true);
|
|
6337
|
+
} else if (expandRowKeys) {
|
|
6338
|
+
const defExpandeds = [];
|
|
6339
|
+
const rowkey = getRowkey($xeTable);
|
|
6340
|
+
expandRowKeys.forEach(rowid => {
|
|
6341
|
+
const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullData, item => rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, rowkey), {
|
|
6342
|
+
children: childrenField
|
|
6343
|
+
});
|
|
6344
|
+
if (matchObj) {
|
|
6345
|
+
defExpandeds.push(matchObj.item);
|
|
6346
|
+
}
|
|
6347
|
+
});
|
|
6348
|
+
$xeTable.setTreeExpand(defExpandeds, true);
|
|
6349
|
+
}
|
|
6350
|
+
}
|
|
6351
|
+
};
|
|
6352
|
+
const handleAsyncTreeExpandChilds = ($xeTable, row) => {
|
|
6353
|
+
const reactData = $xeTable;
|
|
6354
|
+
const internalData = $xeTable;
|
|
6355
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
6356
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6357
|
+
const {
|
|
6358
|
+
transform,
|
|
6359
|
+
loadMethod
|
|
6360
|
+
} = treeOpts;
|
|
6361
|
+
const {
|
|
6362
|
+
checkStrictly
|
|
6363
|
+
} = checkboxOpts;
|
|
6364
|
+
return new Promise(resolve => {
|
|
6365
|
+
if (loadMethod) {
|
|
6366
|
+
const {
|
|
6367
|
+
fullAllDataRowIdData,
|
|
6368
|
+
treeExpandLazyLoadedMaps
|
|
6369
|
+
} = internalData;
|
|
6370
|
+
const rowid = getRowid($xeTable, row);
|
|
6371
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
6372
|
+
treeExpandLazyLoadedMaps[rowid] = row;
|
|
6373
|
+
Promise.resolve(loadMethod({
|
|
6374
|
+
$table: $xeTable,
|
|
6375
|
+
row
|
|
6376
|
+
})).then(childRecords => {
|
|
6377
|
+
if (rowRest) {
|
|
6378
|
+
rowRest.treeLoaded = true;
|
|
6379
|
+
}
|
|
6380
|
+
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
6381
|
+
delete treeExpandLazyLoadedMaps[rowid];
|
|
6382
|
+
}
|
|
6383
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(childRecords)) {
|
|
6384
|
+
childRecords = [];
|
|
6385
|
+
}
|
|
6386
|
+
if (childRecords) {
|
|
6387
|
+
return $xeTable.loadTreeChildren(row, childRecords).then(childRows => {
|
|
6388
|
+
const {
|
|
6389
|
+
treeExpandedMaps
|
|
6390
|
+
} = internalData;
|
|
6391
|
+
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
6392
|
+
treeExpandedMaps[rowid] = row;
|
|
6393
|
+
}
|
|
6394
|
+
reactData.treeExpandedFlag++;
|
|
6395
|
+
// 如果当前节点已选中,则展开后子节点也被选中
|
|
6396
|
+
if (!checkStrictly && $xeTable.isCheckedByCheckboxRow(row)) {
|
|
6397
|
+
handleCheckedCheckboxRow($xeTable, childRows, true);
|
|
6398
|
+
}
|
|
6399
|
+
return $xeTable.$nextTick().then(() => {
|
|
6400
|
+
if (transform) {
|
|
6401
|
+
$xeTable.handleTableData();
|
|
6402
|
+
updateAfterDataIndex($xeTable);
|
|
6403
|
+
return $xeTable.$nextTick();
|
|
6404
|
+
}
|
|
6405
|
+
});
|
|
6406
|
+
});
|
|
6407
|
+
}
|
|
6408
|
+
}).catch(() => {
|
|
6409
|
+
const {
|
|
6410
|
+
treeExpandLazyLoadedMaps
|
|
6411
|
+
} = internalData;
|
|
6412
|
+
if (rowRest) {
|
|
6413
|
+
rowRest.treeLoaded = false;
|
|
6414
|
+
}
|
|
6415
|
+
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
6416
|
+
delete treeExpandLazyLoadedMaps[rowid];
|
|
6417
|
+
}
|
|
6418
|
+
}).finally(() => {
|
|
6419
|
+
reactData.treeExpandedFlag++;
|
|
6420
|
+
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve());
|
|
6421
|
+
});
|
|
6422
|
+
} else {
|
|
6423
|
+
resolve();
|
|
6424
|
+
}
|
|
6425
|
+
});
|
|
6426
|
+
};
|
|
6427
|
+
const handleTreeExpandReserve = ($xeTable, row, expanded) => {
|
|
6428
|
+
const internalData = $xeTable;
|
|
6429
|
+
const {
|
|
6430
|
+
treeExpandedReserveRowMap
|
|
6431
|
+
} = internalData;
|
|
6432
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
6433
|
+
if (treeOpts.reserve) {
|
|
6434
|
+
const rowid = getRowid($xeTable, row);
|
|
6435
|
+
if (expanded) {
|
|
6436
|
+
treeExpandedReserveRowMap[rowid] = row;
|
|
6437
|
+
} else if (treeExpandedReserveRowMap[rowid]) {
|
|
6438
|
+
delete treeExpandedReserveRowMap[rowid];
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6441
|
+
};
|
|
6442
|
+
const handleAsyncRowExpand = ($xeTable, row) => {
|
|
6443
|
+
const reactData = $xeTable;
|
|
6444
|
+
const internalData = $xeTable;
|
|
6445
|
+
return new Promise(resolve => {
|
|
6446
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
6447
|
+
const {
|
|
6448
|
+
loadMethod
|
|
6449
|
+
} = expandOpts;
|
|
6450
|
+
if (loadMethod) {
|
|
6451
|
+
const {
|
|
6452
|
+
fullAllDataRowIdData,
|
|
6453
|
+
rowExpandLazyLoadedMaps
|
|
6454
|
+
} = internalData;
|
|
6455
|
+
const rowid = getRowid($xeTable, row);
|
|
6456
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
6457
|
+
rowExpandLazyLoadedMaps[rowid] = row;
|
|
6458
|
+
loadMethod({
|
|
6459
|
+
$table: $xeTable,
|
|
6460
|
+
row,
|
|
6461
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
6462
|
+
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
6463
|
+
}).then(() => {
|
|
6464
|
+
const {
|
|
6465
|
+
rowExpandedMaps
|
|
6466
|
+
} = internalData;
|
|
6467
|
+
if (rowRest) {
|
|
6468
|
+
rowRest.expandLoaded = true;
|
|
6469
|
+
}
|
|
6470
|
+
rowExpandedMaps[rowid] = row;
|
|
6471
|
+
reactData.rowExpandedFlag++;
|
|
6472
|
+
}).catch(() => {
|
|
6473
|
+
if (rowRest) {
|
|
6474
|
+
rowRest.expandLoaded = false;
|
|
6475
|
+
}
|
|
6476
|
+
}).finally(() => {
|
|
6477
|
+
const {
|
|
6478
|
+
rowExpandLazyLoadedMaps
|
|
6479
|
+
} = internalData;
|
|
6480
|
+
if (rowExpandLazyLoadedMaps[rowid]) {
|
|
6481
|
+
delete rowExpandLazyLoadedMaps[rowid];
|
|
6482
|
+
}
|
|
6483
|
+
reactData.rowExpandedFlag++;
|
|
6484
|
+
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas()).then(() => resolve());
|
|
6485
|
+
});
|
|
6486
|
+
} else {
|
|
6487
|
+
resolve();
|
|
6488
|
+
}
|
|
6489
|
+
});
|
|
6490
|
+
};
|
|
6213
6491
|
function calcVarRowHeightConfig($xeTable, sizeKey, sizeEl) {
|
|
6214
6492
|
const reactData = $xeTable;
|
|
6215
6493
|
const {
|
|
@@ -6284,12 +6562,15 @@ function handleVirtualYVisible($xeTable) {
|
|
|
6284
6562
|
toVisibleIndex = Math.floor(startTop / defaultRowHeight) - 1;
|
|
6285
6563
|
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
6286
6564
|
} else {
|
|
6565
|
+
const {
|
|
6566
|
+
handleGetRowId
|
|
6567
|
+
} = createHandleGetRowId($xeTable);
|
|
6287
6568
|
let leftIndex = 0;
|
|
6288
6569
|
let rightIndex = afterFullData.length;
|
|
6289
6570
|
while (leftIndex < rightIndex) {
|
|
6290
6571
|
const rIndex = Math.floor((leftIndex + rightIndex) / 2);
|
|
6291
6572
|
const row = afterFullData[rIndex];
|
|
6292
|
-
const rowid =
|
|
6573
|
+
const rowid = handleGetRowId(row);
|
|
6293
6574
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
6294
6575
|
if (rowRest.oTop <= startTop) {
|
|
6295
6576
|
leftIndex = rIndex + 1;
|
|
@@ -6300,7 +6581,7 @@ function handleVirtualYVisible($xeTable) {
|
|
|
6300
6581
|
toVisibleIndex = Math.max(0, leftIndex < afterFullData.length ? leftIndex - 2 : 0);
|
|
6301
6582
|
for (let rIndex = toVisibleIndex, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
6302
6583
|
const row = afterFullData[rIndex];
|
|
6303
|
-
const rowid =
|
|
6584
|
+
const rowid = handleGetRowId(row);
|
|
6304
6585
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
6305
6586
|
visibleSize++;
|
|
6306
6587
|
if (rowRest.oTop > endTop || visibleSize >= 100) {
|
|
@@ -6339,12 +6620,16 @@ function calculateMergerOffsetIndex(list, offsetItem, type) {
|
|
|
6339
6620
|
}
|
|
6340
6621
|
}
|
|
6341
6622
|
}
|
|
6342
|
-
function setMerges(
|
|
6623
|
+
function setMerges($xeTable, merges, mList, rowList) {
|
|
6624
|
+
const props = $xeTable;
|
|
6625
|
+
const internalData = $xeTable;
|
|
6343
6626
|
if (merges) {
|
|
6344
6627
|
const {
|
|
6345
|
-
treeConfig
|
|
6628
|
+
treeConfig
|
|
6629
|
+
} = props;
|
|
6630
|
+
const {
|
|
6346
6631
|
visibleColumn
|
|
6347
|
-
} =
|
|
6632
|
+
} = internalData;
|
|
6348
6633
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
6349
6634
|
merges = [merges];
|
|
6350
6635
|
}
|
|
@@ -6394,13 +6679,17 @@ function setMerges(_vm, merges, mList, rowList) {
|
|
|
6394
6679
|
});
|
|
6395
6680
|
}
|
|
6396
6681
|
}
|
|
6397
|
-
function removeMerges(
|
|
6682
|
+
function removeMerges($xeTable, merges, mList, rowList) {
|
|
6683
|
+
const props = $xeTable;
|
|
6684
|
+
const internalData = $xeTable;
|
|
6398
6685
|
const rest = [];
|
|
6399
6686
|
if (merges) {
|
|
6400
6687
|
const {
|
|
6401
|
-
treeConfig
|
|
6688
|
+
treeConfig
|
|
6689
|
+
} = props;
|
|
6690
|
+
const {
|
|
6402
6691
|
visibleColumn
|
|
6403
|
-
} =
|
|
6692
|
+
} = internalData;
|
|
6404
6693
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
6405
6694
|
merges = [merges];
|
|
6406
6695
|
}
|
|
@@ -6631,8 +6920,11 @@ const calcCellHeight = $xeTable => {
|
|
|
6631
6920
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
6632
6921
|
const el = $xeTable.$refs.refElem;
|
|
6633
6922
|
if (!isAllOverflow && scrollYLoad && el) {
|
|
6923
|
+
const {
|
|
6924
|
+
handleGetRowId
|
|
6925
|
+
} = createHandleGetRowId($xeTable);
|
|
6634
6926
|
tableData.forEach(row => {
|
|
6635
|
-
const rowid =
|
|
6927
|
+
const rowid = handleGetRowId(row);
|
|
6636
6928
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6637
6929
|
if (rowRest) {
|
|
6638
6930
|
const height = calcCellAutoHeight(rowRest, el);
|
|
@@ -7370,6 +7662,39 @@ function loadScrollYData($xeTable) {
|
|
|
7370
7662
|
}
|
|
7371
7663
|
}
|
|
7372
7664
|
}
|
|
7665
|
+
const createGetRowCacheProp = prop => {
|
|
7666
|
+
return function (row) {
|
|
7667
|
+
const $xeTable = this;
|
|
7668
|
+
const internalData = $xeTable;
|
|
7669
|
+
const {
|
|
7670
|
+
fullAllDataRowIdData
|
|
7671
|
+
} = internalData;
|
|
7672
|
+
if (row) {
|
|
7673
|
+
const rowid = getRowid($xeTable, row);
|
|
7674
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
7675
|
+
if (rowRest) {
|
|
7676
|
+
return rowRest[prop];
|
|
7677
|
+
}
|
|
7678
|
+
}
|
|
7679
|
+
return -1;
|
|
7680
|
+
};
|
|
7681
|
+
};
|
|
7682
|
+
const createGetColumnCacheProp = prop => {
|
|
7683
|
+
return function (column) {
|
|
7684
|
+
const $xeTable = this;
|
|
7685
|
+
const internalData = $xeTable;
|
|
7686
|
+
const {
|
|
7687
|
+
fullColumnIdData
|
|
7688
|
+
} = internalData;
|
|
7689
|
+
if (column) {
|
|
7690
|
+
const colRest = fullColumnIdData[column.id];
|
|
7691
|
+
if (colRest) {
|
|
7692
|
+
return colRest[prop];
|
|
7693
|
+
}
|
|
7694
|
+
}
|
|
7695
|
+
return -1;
|
|
7696
|
+
};
|
|
7697
|
+
};
|
|
7373
7698
|
function lazyScrollXData($xeTable) {
|
|
7374
7699
|
const internalData = $xeTable;
|
|
7375
7700
|
const {
|
|
@@ -7541,7 +7866,7 @@ function calcCellWidth($xeTable) {
|
|
|
7541
7866
|
}
|
|
7542
7867
|
function handleUpdateColResize($xeTable, evnt, params) {
|
|
7543
7868
|
$xeTable.analyColumnWidth();
|
|
7544
|
-
$xeTable.recalculate(
|
|
7869
|
+
$xeTable.recalculate().then(() => {
|
|
7545
7870
|
$xeTable.saveCustomStore('update:width');
|
|
7546
7871
|
$xeTable.updateCellAreas();
|
|
7547
7872
|
$xeTable.dispatchEvent('column-resizable-change', params, evnt);
|
|
@@ -7553,7 +7878,7 @@ function handleUpdateColResize($xeTable, evnt, params) {
|
|
|
7553
7878
|
function handleUpdateRowResize($xeTable, evnt, params) {
|
|
7554
7879
|
const reactData = $xeTable;
|
|
7555
7880
|
reactData.resizeHeightFlag++;
|
|
7556
|
-
$xeTable.recalculate(
|
|
7881
|
+
$xeTable.recalculate().then(() => {
|
|
7557
7882
|
$xeTable.updateCellAreas();
|
|
7558
7883
|
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
7559
7884
|
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
@@ -7578,21 +7903,24 @@ function updateRowOffsetTop($xeTable) {
|
|
|
7578
7903
|
const reactData = $xeTable;
|
|
7579
7904
|
const internalData = $xeTable;
|
|
7580
7905
|
const {
|
|
7581
|
-
expandColumn
|
|
7582
|
-
rowExpandedMaps
|
|
7906
|
+
expandColumn
|
|
7583
7907
|
} = reactData;
|
|
7584
7908
|
const {
|
|
7585
7909
|
afterFullData,
|
|
7586
|
-
fullAllDataRowIdData
|
|
7910
|
+
fullAllDataRowIdData,
|
|
7911
|
+
rowExpandedMaps
|
|
7587
7912
|
} = internalData;
|
|
7588
7913
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
7589
7914
|
const rowOpts = $xeTable.computeRowOpts;
|
|
7590
7915
|
const cellOpts = $xeTable.computeCellOpts;
|
|
7591
7916
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
7917
|
+
const {
|
|
7918
|
+
handleGetRowId
|
|
7919
|
+
} = createHandleGetRowId($xeTable);
|
|
7592
7920
|
let offsetTop = 0;
|
|
7593
7921
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
7594
7922
|
const row = afterFullData[rIndex];
|
|
7595
|
-
const rowid =
|
|
7923
|
+
const rowid = handleGetRowId(row);
|
|
7596
7924
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
7597
7925
|
rowRest.oTop = offsetTop;
|
|
7598
7926
|
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
@@ -7608,7 +7936,8 @@ function updateRowExpandStyle($xeTable) {
|
|
|
7608
7936
|
const {
|
|
7609
7937
|
expandColumn,
|
|
7610
7938
|
scrollYLoad,
|
|
7611
|
-
|
|
7939
|
+
scrollYTop,
|
|
7940
|
+
isScrollYBig
|
|
7612
7941
|
} = reactData;
|
|
7613
7942
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
7614
7943
|
const rowOpts = $xeTable.computeRowOpts;
|
|
@@ -7620,41 +7949,35 @@ function updateRowExpandStyle($xeTable) {
|
|
|
7620
7949
|
if (expandColumn && mode === 'fixed') {
|
|
7621
7950
|
const {
|
|
7622
7951
|
elemStore,
|
|
7623
|
-
afterFullData,
|
|
7624
7952
|
fullAllDataRowIdData
|
|
7625
7953
|
} = internalData;
|
|
7626
7954
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
7627
7955
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
7628
7956
|
if (rowExpandEl && bodyScrollElem) {
|
|
7629
7957
|
let isUpdateHeight = false;
|
|
7630
|
-
if (scrollYLoad) {
|
|
7631
|
-
let offsetTop = 0;
|
|
7632
|
-
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
7633
|
-
const row = afterFullData[rIndex];
|
|
7634
|
-
const rowid = getRowid($xeTable, row);
|
|
7635
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
7636
|
-
rowRest.oTop = offsetTop;
|
|
7637
|
-
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
7638
|
-
// 是否展开行
|
|
7639
|
-
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
7640
|
-
offsetTop += rowRest.expandHeight || expandOpts.height || 0;
|
|
7641
|
-
}
|
|
7642
|
-
}
|
|
7643
|
-
}
|
|
7644
7958
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowExpandEl.children, reEl => {
|
|
7645
7959
|
const expandEl = reEl;
|
|
7646
7960
|
const rowid = expandEl.getAttribute('rowid') || '';
|
|
7647
7961
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
7648
7962
|
if (rowRest) {
|
|
7649
7963
|
const expandHeight = expandEl.offsetHeight + 1;
|
|
7964
|
+
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
|
|
7965
|
+
let offsetTop = 0;
|
|
7650
7966
|
if (scrollYLoad) {
|
|
7651
|
-
|
|
7967
|
+
if (isScrollYBig && trEl) {
|
|
7968
|
+
offsetTop = trEl.offsetTop + trEl.offsetHeight;
|
|
7969
|
+
} else {
|
|
7970
|
+
offsetTop = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
|
|
7971
|
+
}
|
|
7652
7972
|
} else {
|
|
7653
|
-
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
|
|
7654
7973
|
if (trEl) {
|
|
7655
|
-
|
|
7974
|
+
offsetTop = trEl.offsetTop + trEl.offsetHeight;
|
|
7656
7975
|
}
|
|
7657
7976
|
}
|
|
7977
|
+
if (isScrollYBig) {
|
|
7978
|
+
offsetTop += scrollYTop;
|
|
7979
|
+
}
|
|
7980
|
+
expandEl.style.top = toCssUnit(offsetTop);
|
|
7658
7981
|
if (!isUpdateHeight) {
|
|
7659
7982
|
if (rowRest.expandHeight !== expandHeight) {
|
|
7660
7983
|
isUpdateHeight = true;
|
|
@@ -7665,6 +7988,9 @@ function updateRowExpandStyle($xeTable) {
|
|
|
7665
7988
|
});
|
|
7666
7989
|
if (isUpdateHeight) {
|
|
7667
7990
|
reactData.rowExpandHeightFlag++;
|
|
7991
|
+
$xeTable.$nextTick(() => {
|
|
7992
|
+
updateRowOffsetTop($xeTable);
|
|
7993
|
+
});
|
|
7668
7994
|
}
|
|
7669
7995
|
}
|
|
7670
7996
|
}
|
|
@@ -7695,6 +8021,10 @@ const Methods = {
|
|
|
7695
8021
|
}
|
|
7696
8022
|
return [];
|
|
7697
8023
|
},
|
|
8024
|
+
getEl() {
|
|
8025
|
+
const $xeTable = this;
|
|
8026
|
+
return $xeTable.$refs.refElem;
|
|
8027
|
+
},
|
|
7698
8028
|
/**
|
|
7699
8029
|
* 获取父容器元素
|
|
7700
8030
|
*/
|
|
@@ -7709,14 +8039,27 @@ const Methods = {
|
|
|
7709
8039
|
* 获取父容器的高度
|
|
7710
8040
|
*/
|
|
7711
8041
|
getParentHeight() {
|
|
8042
|
+
const $xeTable = this;
|
|
8043
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
8044
|
+
const props = $xeTable;
|
|
7712
8045
|
const {
|
|
7713
|
-
$el,
|
|
7714
|
-
$xegrid,
|
|
7715
8046
|
height
|
|
7716
|
-
} =
|
|
7717
|
-
const
|
|
7718
|
-
|
|
7719
|
-
|
|
8047
|
+
} = props;
|
|
8048
|
+
const el = $xeTable.$refs.refElem;
|
|
8049
|
+
if (el) {
|
|
8050
|
+
const parentElem = el.parentNode;
|
|
8051
|
+
const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
|
|
8052
|
+
let parentWrapperHeight = 0;
|
|
8053
|
+
if (parentElem) {
|
|
8054
|
+
if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
|
|
8055
|
+
parentWrapperHeight = $xeGrid.getParentHeight();
|
|
8056
|
+
} else {
|
|
8057
|
+
parentWrapperHeight = parentElem.clientHeight;
|
|
8058
|
+
}
|
|
8059
|
+
}
|
|
8060
|
+
return Math.floor(parentWrapperHeight - parentPaddingSize);
|
|
8061
|
+
}
|
|
8062
|
+
return 0;
|
|
7720
8063
|
},
|
|
7721
8064
|
/**
|
|
7722
8065
|
* 获取需要排除的高度
|
|
@@ -7826,6 +8169,9 @@ const Methods = {
|
|
|
7826
8169
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
7827
8170
|
let treeData = [];
|
|
7828
8171
|
let fullData = datas ? datas.slice(0) : [];
|
|
8172
|
+
if (fullData.length > supportMaxRow) {
|
|
8173
|
+
errLog('vxe.error.errMaxRow', [supportMaxRow]);
|
|
8174
|
+
}
|
|
7829
8175
|
if (treeConfig) {
|
|
7830
8176
|
// 树结构自动转换
|
|
7831
8177
|
if (treeOpts.transform) {
|
|
@@ -7919,7 +8265,7 @@ const Methods = {
|
|
|
7919
8265
|
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
7920
8266
|
// }
|
|
7921
8267
|
if (this.spanMethod) {
|
|
7922
|
-
|
|
8268
|
+
errLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
7923
8269
|
}
|
|
7924
8270
|
}
|
|
7925
8271
|
handleReserveStatus($xeTable);
|
|
@@ -8070,45 +8416,27 @@ const Methods = {
|
|
|
8070
8416
|
const {
|
|
8071
8417
|
treeConfig
|
|
8072
8418
|
} = props;
|
|
8073
|
-
const {
|
|
8074
|
-
treeExpandedMaps
|
|
8075
|
-
} = reactData;
|
|
8076
8419
|
const {
|
|
8077
8420
|
fullAllDataRowIdData,
|
|
8078
8421
|
tableFullData,
|
|
8079
|
-
tableFullTreeData
|
|
8422
|
+
tableFullTreeData,
|
|
8423
|
+
treeExpandedMaps
|
|
8080
8424
|
} = internalData;
|
|
8081
8425
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
8082
8426
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8083
8427
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
8084
|
-
const
|
|
8428
|
+
const {
|
|
8429
|
+
lazy
|
|
8430
|
+
} = treeOpts;
|
|
8085
8431
|
const fullAllDataRowIdMaps = {
|
|
8086
8432
|
...fullAllDataRowIdData
|
|
8087
8433
|
}; // 存在已删除数据
|
|
8088
8434
|
const fullDataRowIdMaps = {};
|
|
8089
|
-
const
|
|
8090
|
-
|
|
8091
|
-
};
|
|
8092
|
-
const
|
|
8093
|
-
let
|
|
8094
|
-
const seq = treeConfig && path ? toTreePathSeq(path) : index + 1;
|
|
8095
|
-
const level = nodes ? nodes.length - 1 : 0;
|
|
8096
|
-
if (eqEmptyValue(rowid)) {
|
|
8097
|
-
rowid = getRowUniqueId();
|
|
8098
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
|
|
8099
|
-
}
|
|
8100
|
-
if (treeConfig && treeOpts.lazy) {
|
|
8101
|
-
const treeExpRest = treeExpandedMaps[rowid];
|
|
8102
|
-
if (row[hasChildField] && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(row[childrenField])) {
|
|
8103
|
-
row[childrenField] = null;
|
|
8104
|
-
}
|
|
8105
|
-
if (treeExpRest) {
|
|
8106
|
-
if (!row[childrenField] || !row[childrenField].length) {
|
|
8107
|
-
delete treeTempExpandedMaps[rowid];
|
|
8108
|
-
}
|
|
8109
|
-
}
|
|
8110
|
-
}
|
|
8111
|
-
let rowRest = fullAllDataRowIdData[rowid];
|
|
8435
|
+
const {
|
|
8436
|
+
handleUpdateRowId
|
|
8437
|
+
} = createHandleUpdateRowId($xeTable);
|
|
8438
|
+
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
8439
|
+
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
8112
8440
|
if (!rowRest) {
|
|
8113
8441
|
rowRest = {
|
|
8114
8442
|
row,
|
|
@@ -8133,40 +8461,53 @@ const Methods = {
|
|
|
8133
8461
|
rowRest.items = items;
|
|
8134
8462
|
rowRest.parent = parentRow;
|
|
8135
8463
|
rowRest.level = level;
|
|
8136
|
-
rowRest.index =
|
|
8464
|
+
rowRest.index = currIndex;
|
|
8465
|
+
rowRest.treeIndex = index;
|
|
8137
8466
|
fullDataRowIdMaps[rowid] = rowRest;
|
|
8138
8467
|
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
8139
8468
|
};
|
|
8140
8469
|
if (treeConfig) {
|
|
8141
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,
|
|
8470
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
8471
|
+
const rowid = handleUpdateRowId(row);
|
|
8472
|
+
if (treeConfig && lazy) {
|
|
8473
|
+
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
8474
|
+
row[childrenField] = null;
|
|
8475
|
+
}
|
|
8476
|
+
if (treeExpandedMaps[rowid]) {
|
|
8477
|
+
if (!row[childrenField] || !row[childrenField].length) {
|
|
8478
|
+
delete treeExpandedMaps[rowid];
|
|
8479
|
+
}
|
|
8480
|
+
}
|
|
8481
|
+
}
|
|
8482
|
+
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
|
|
8483
|
+
}, {
|
|
8142
8484
|
children: childrenField
|
|
8143
8485
|
});
|
|
8144
8486
|
} else {
|
|
8145
|
-
tableFullData.forEach(
|
|
8487
|
+
tableFullData.forEach((row, index, items) => {
|
|
8488
|
+
handleRowCache(row, index, items, index, null, handleUpdateRowId(row), 0, index + 1);
|
|
8489
|
+
});
|
|
8146
8490
|
}
|
|
8147
8491
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
8148
8492
|
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
8149
|
-
reactData.
|
|
8493
|
+
reactData.treeExpandedFlag++;
|
|
8150
8494
|
},
|
|
8151
8495
|
cacheSourceMap(fullData) {
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8496
|
+
const $xeTable = this;
|
|
8497
|
+
const props = $xeTable;
|
|
8498
|
+
const internalData = $xeTable;
|
|
8499
|
+
const {
|
|
8500
|
+
treeConfig
|
|
8501
|
+
} = props;
|
|
8502
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8157
8503
|
const sourceData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData, true);
|
|
8158
|
-
const
|
|
8159
|
-
|
|
8504
|
+
const {
|
|
8505
|
+
handleUpdateRowId
|
|
8506
|
+
} = createHandleUpdateRowId($xeTable);
|
|
8507
|
+
const sourceRowIdData = {};
|
|
8160
8508
|
const handleSourceRow = row => {
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
rowid = getRowUniqueId();
|
|
8164
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
|
|
8165
|
-
}
|
|
8166
|
-
sourceDataRowIdData[rowid] = {
|
|
8167
|
-
row,
|
|
8168
|
-
rowid
|
|
8169
|
-
};
|
|
8509
|
+
const rowid = handleUpdateRowId(row);
|
|
8510
|
+
sourceRowIdData[rowid] = row;
|
|
8170
8511
|
};
|
|
8171
8512
|
// 源数据缓存
|
|
8172
8513
|
if (treeConfig) {
|
|
@@ -8177,7 +8518,8 @@ const Methods = {
|
|
|
8177
8518
|
} else {
|
|
8178
8519
|
sourceData.forEach(handleSourceRow);
|
|
8179
8520
|
}
|
|
8180
|
-
|
|
8521
|
+
internalData.sourceDataRowIdData = sourceRowIdData;
|
|
8522
|
+
internalData.tableSourceData = sourceData;
|
|
8181
8523
|
},
|
|
8182
8524
|
getParams() {
|
|
8183
8525
|
return this.params;
|
|
@@ -8297,53 +8639,22 @@ const Methods = {
|
|
|
8297
8639
|
* 根据 row 获取序号
|
|
8298
8640
|
* @param {Row} row 行对象
|
|
8299
8641
|
*/
|
|
8300
|
-
getRowSeq(
|
|
8301
|
-
const {
|
|
8302
|
-
fullAllDataRowIdData
|
|
8303
|
-
} = this;
|
|
8304
|
-
if (row) {
|
|
8305
|
-
const rowid = getRowid(this, row);
|
|
8306
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
8307
|
-
if (rest) {
|
|
8308
|
-
return rest.seq;
|
|
8309
|
-
}
|
|
8310
|
-
}
|
|
8311
|
-
return -1;
|
|
8312
|
-
},
|
|
8642
|
+
getRowSeq: createGetRowCacheProp('seq'),
|
|
8313
8643
|
/**
|
|
8314
8644
|
* 根据 row 获取相对于 data 中的索引
|
|
8315
8645
|
* @param {Row} row 行对象
|
|
8316
8646
|
*/
|
|
8317
|
-
getRowIndex(
|
|
8318
|
-
const {
|
|
8319
|
-
fullAllDataRowIdData
|
|
8320
|
-
} = this;
|
|
8321
|
-
if (row) {
|
|
8322
|
-
const rowid = getRowid(this, row);
|
|
8323
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
8324
|
-
if (rest) {
|
|
8325
|
-
return rest.index;
|
|
8326
|
-
}
|
|
8327
|
-
}
|
|
8328
|
-
return -1;
|
|
8329
|
-
},
|
|
8647
|
+
getRowIndex: createGetRowCacheProp('index'),
|
|
8330
8648
|
/**
|
|
8331
8649
|
* 根据 row 获取相对于当前数据中的索引
|
|
8332
8650
|
* @param {Row} row 行对象
|
|
8333
8651
|
*/
|
|
8334
|
-
getVTRowIndex(
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
8341
|
-
if (rest) {
|
|
8342
|
-
return rest._index;
|
|
8343
|
-
}
|
|
8344
|
-
}
|
|
8345
|
-
return -1;
|
|
8346
|
-
},
|
|
8652
|
+
getVTRowIndex: createGetRowCacheProp('_index'),
|
|
8653
|
+
/**
|
|
8654
|
+
* 根据 row 获取渲染中的虚拟索引
|
|
8655
|
+
* @param {Row} row 行对象
|
|
8656
|
+
*/
|
|
8657
|
+
getVMRowIndex: createGetRowCacheProp('$index'),
|
|
8347
8658
|
// 在 v3 中废弃
|
|
8348
8659
|
_getRowIndex(row) {
|
|
8349
8660
|
if (true) {
|
|
@@ -8351,23 +8662,6 @@ const Methods = {
|
|
|
8351
8662
|
}
|
|
8352
8663
|
return this.getVTRowIndex(row);
|
|
8353
8664
|
},
|
|
8354
|
-
/**
|
|
8355
|
-
* 根据 row 获取渲染中的虚拟索引
|
|
8356
|
-
* @param {Row} row 行对象
|
|
8357
|
-
*/
|
|
8358
|
-
getVMRowIndex(row) {
|
|
8359
|
-
const {
|
|
8360
|
-
fullAllDataRowIdData
|
|
8361
|
-
} = this;
|
|
8362
|
-
if (row) {
|
|
8363
|
-
const rowid = getRowid(this, row);
|
|
8364
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
8365
|
-
if (rest) {
|
|
8366
|
-
return rest.$index;
|
|
8367
|
-
}
|
|
8368
|
-
}
|
|
8369
|
-
return -1;
|
|
8370
|
-
},
|
|
8371
8665
|
// 在 v3 中废弃
|
|
8372
8666
|
$getRowIndex(row) {
|
|
8373
8667
|
if (true) {
|
|
@@ -8379,34 +8673,17 @@ const Methods = {
|
|
|
8379
8673
|
* 根据 column 获取相对于 columns 中的索引
|
|
8380
8674
|
* @param {ColumnInfo} column 列配置
|
|
8381
8675
|
*/
|
|
8382
|
-
getColumnIndex(
|
|
8383
|
-
const {
|
|
8384
|
-
fullColumnIdData
|
|
8385
|
-
} = this;
|
|
8386
|
-
if (column) {
|
|
8387
|
-
const rest = fullColumnIdData[column.id];
|
|
8388
|
-
if (rest) {
|
|
8389
|
-
return rest.index;
|
|
8390
|
-
}
|
|
8391
|
-
}
|
|
8392
|
-
return -1;
|
|
8393
|
-
},
|
|
8676
|
+
getColumnIndex: createGetColumnCacheProp('index'),
|
|
8394
8677
|
/**
|
|
8395
8678
|
* 根据 column 获取相对于当前表格列中的索引
|
|
8396
8679
|
* @param {ColumnInfo} column 列配置
|
|
8397
8680
|
*/
|
|
8398
|
-
getVTColumnIndex(
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
if (rest) {
|
|
8405
|
-
return rest._index;
|
|
8406
|
-
}
|
|
8407
|
-
}
|
|
8408
|
-
return -1;
|
|
8409
|
-
},
|
|
8681
|
+
getVTColumnIndex: createGetColumnCacheProp('_index'),
|
|
8682
|
+
/**
|
|
8683
|
+
* 根据 column 获取渲染中的虚拟索引
|
|
8684
|
+
* @param {ColumnInfo} column 列配置
|
|
8685
|
+
*/
|
|
8686
|
+
getVMColumnIndex: createGetColumnCacheProp('$index'),
|
|
8410
8687
|
// 在 v3 中废弃
|
|
8411
8688
|
_getColumnIndex(column) {
|
|
8412
8689
|
if (true) {
|
|
@@ -8414,22 +8691,6 @@ const Methods = {
|
|
|
8414
8691
|
}
|
|
8415
8692
|
return this.getVTColumnIndex(column);
|
|
8416
8693
|
},
|
|
8417
|
-
/**
|
|
8418
|
-
* 根据 column 获取渲染中的虚拟索引
|
|
8419
|
-
* @param {ColumnInfo} column 列配置
|
|
8420
|
-
*/
|
|
8421
|
-
getVMColumnIndex(column) {
|
|
8422
|
-
const {
|
|
8423
|
-
fullColumnIdData
|
|
8424
|
-
} = this;
|
|
8425
|
-
if (column) {
|
|
8426
|
-
const rest = fullColumnIdData[column.id];
|
|
8427
|
-
if (rest) {
|
|
8428
|
-
return rest.$index;
|
|
8429
|
-
}
|
|
8430
|
-
}
|
|
8431
|
-
return -1;
|
|
8432
|
-
},
|
|
8433
8694
|
// 在 v3 中废弃
|
|
8434
8695
|
$getColumnIndex(column) {
|
|
8435
8696
|
if (true) {
|
|
@@ -8538,20 +8799,30 @@ const Methods = {
|
|
|
8538
8799
|
keepSource,
|
|
8539
8800
|
treeConfig
|
|
8540
8801
|
} = props;
|
|
8802
|
+
const {
|
|
8803
|
+
editStore
|
|
8804
|
+
} = reactData;
|
|
8541
8805
|
const {
|
|
8542
8806
|
fullAllDataRowIdData,
|
|
8807
|
+
fullDataRowIdData,
|
|
8543
8808
|
tableSourceData,
|
|
8544
8809
|
sourceDataRowIdData,
|
|
8545
8810
|
tableFullData,
|
|
8546
8811
|
afterFullData
|
|
8547
8812
|
} = internalData;
|
|
8813
|
+
const removeTempMaps = {
|
|
8814
|
+
...editStore.removeMaps
|
|
8815
|
+
};
|
|
8548
8816
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
8549
8817
|
const {
|
|
8550
8818
|
transform
|
|
8551
8819
|
} = treeOpts;
|
|
8820
|
+
const {
|
|
8821
|
+
handleGetRowId
|
|
8822
|
+
} = createHandleGetRowId($xeTable);
|
|
8552
8823
|
if (!keepSource) {
|
|
8553
8824
|
if (true) {
|
|
8554
|
-
|
|
8825
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
8555
8826
|
}
|
|
8556
8827
|
return $xeTable.$nextTick();
|
|
8557
8828
|
}
|
|
@@ -8565,22 +8836,23 @@ const Methods = {
|
|
|
8565
8836
|
}
|
|
8566
8837
|
let reDelFlag = false;
|
|
8567
8838
|
if (targetRows.length) {
|
|
8568
|
-
targetRows.forEach(
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8839
|
+
targetRows.forEach(item => {
|
|
8840
|
+
const rowid = handleGetRowId(item);
|
|
8841
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
8842
|
+
if (rowRest) {
|
|
8843
|
+
const row = rowRest.row;
|
|
8844
|
+
if (!$xeTable.isInsertByRow(row)) {
|
|
8845
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
8846
|
+
if (oRow && row) {
|
|
8847
|
+
if (field) {
|
|
8848
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oRow, field), true));
|
|
8849
|
+
} else {
|
|
8850
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(oRow, true));
|
|
8851
|
+
}
|
|
8852
|
+
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
8853
|
+
delete removeTempMaps[rowid];
|
|
8854
|
+
tableFullData.unshift(row);
|
|
8855
|
+
afterFullData.unshift(row);
|
|
8584
8856
|
reDelFlag = true;
|
|
8585
8857
|
}
|
|
8586
8858
|
}
|
|
@@ -8590,6 +8862,7 @@ const Methods = {
|
|
|
8590
8862
|
}
|
|
8591
8863
|
if (rows) {
|
|
8592
8864
|
if (reDelFlag) {
|
|
8865
|
+
editStore.removeMaps = removeTempMaps;
|
|
8593
8866
|
$xeTable.updateFooter();
|
|
8594
8867
|
$xeTable.cacheRowMap(false);
|
|
8595
8868
|
$xeTable.handleTableData(treeConfig && transform);
|
|
@@ -8769,25 +9042,31 @@ const Methods = {
|
|
|
8769
9042
|
},
|
|
8770
9043
|
/**
|
|
8771
9044
|
* 检查行或列数据是否发生改变
|
|
8772
|
-
* @param {Row}
|
|
9045
|
+
* @param {Row} rowOrId 行对象
|
|
8773
9046
|
* @param {String} field 字段名
|
|
8774
9047
|
*/
|
|
8775
|
-
isUpdateByRow(
|
|
9048
|
+
isUpdateByRow(rowOrId, field) {
|
|
9049
|
+
const $xeTable = this;
|
|
9050
|
+
const props = $xeTable;
|
|
9051
|
+
const internalData = $xeTable;
|
|
9052
|
+
const {
|
|
9053
|
+
keepSource
|
|
9054
|
+
} = props;
|
|
8776
9055
|
const {
|
|
8777
9056
|
tableFullColumn,
|
|
8778
|
-
|
|
8779
|
-
sourceDataRowIdData
|
|
8780
|
-
|
|
8781
|
-
} = this;
|
|
9057
|
+
fullDataRowIdData,
|
|
9058
|
+
sourceDataRowIdData
|
|
9059
|
+
} = internalData;
|
|
8782
9060
|
if (keepSource) {
|
|
8783
|
-
const rowid = getRowid(
|
|
9061
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId);
|
|
9062
|
+
const rowRest = fullDataRowIdData[rowid];
|
|
8784
9063
|
// 新增的数据不需要检测
|
|
8785
|
-
if (!
|
|
9064
|
+
if (!rowRest) {
|
|
8786
9065
|
return false;
|
|
8787
9066
|
}
|
|
8788
|
-
const
|
|
8789
|
-
|
|
8790
|
-
|
|
9067
|
+
const row = rowRest.row;
|
|
9068
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
9069
|
+
if (oRow) {
|
|
8791
9070
|
if (arguments.length > 1) {
|
|
8792
9071
|
return !eqCellValue(oRow, row, field);
|
|
8793
9072
|
}
|
|
@@ -8849,6 +9128,113 @@ const Methods = {
|
|
|
8849
9128
|
tableColumn: this.tableColumn.slice(0)
|
|
8850
9129
|
};
|
|
8851
9130
|
},
|
|
9131
|
+
/**
|
|
9132
|
+
* 移动列到指定列的位置
|
|
9133
|
+
* @param fieldOrColumn
|
|
9134
|
+
* @param targetFieldOrColumn
|
|
9135
|
+
* @param options
|
|
9136
|
+
*/
|
|
9137
|
+
moveColumnTo(fieldOrColumn, targetFieldOrColumn, options) {
|
|
9138
|
+
const $xeTable = this;
|
|
9139
|
+
const internalData = $xeTable;
|
|
9140
|
+
const {
|
|
9141
|
+
fullColumnIdData,
|
|
9142
|
+
visibleColumn
|
|
9143
|
+
} = internalData;
|
|
9144
|
+
const {
|
|
9145
|
+
dragToChild,
|
|
9146
|
+
dragPos,
|
|
9147
|
+
isCrossDrag
|
|
9148
|
+
} = Object.assign({}, options);
|
|
9149
|
+
const dragCol = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
9150
|
+
let prevDragCol = null;
|
|
9151
|
+
const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
|
|
9152
|
+
let defPos = 'left';
|
|
9153
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetFieldOrColumn)) {
|
|
9154
|
+
if (colRest && targetFieldOrColumn) {
|
|
9155
|
+
let currList = colRest.items;
|
|
9156
|
+
let offsetIndex = colRest._index + targetFieldOrColumn;
|
|
9157
|
+
if (isCrossDrag) {
|
|
9158
|
+
currList = visibleColumn;
|
|
9159
|
+
offsetIndex = colRest._index + targetFieldOrColumn;
|
|
9160
|
+
}
|
|
9161
|
+
if (offsetIndex > 0 && offsetIndex < currList.length - 1) {
|
|
9162
|
+
prevDragCol = currList[offsetIndex];
|
|
9163
|
+
}
|
|
9164
|
+
if (targetFieldOrColumn > 0) {
|
|
9165
|
+
defPos = 'right';
|
|
9166
|
+
}
|
|
9167
|
+
}
|
|
9168
|
+
} else {
|
|
9169
|
+
prevDragCol = handleFieldOrColumn($xeTable, targetFieldOrColumn);
|
|
9170
|
+
const targetColRest = prevDragCol ? fullColumnIdData[prevDragCol.id] : null;
|
|
9171
|
+
if (colRest && targetColRest) {
|
|
9172
|
+
if (targetColRest._index > colRest._index) {
|
|
9173
|
+
defPos = 'right';
|
|
9174
|
+
}
|
|
9175
|
+
}
|
|
9176
|
+
}
|
|
9177
|
+
return $xeTable.handleColDragSwapEvent(null, true, dragCol, prevDragCol, dragPos || defPos, dragToChild === true);
|
|
9178
|
+
},
|
|
9179
|
+
/**
|
|
9180
|
+
* 移动行到指定行的位置
|
|
9181
|
+
* @param rowidOrRow
|
|
9182
|
+
* @param targetRowidOrRow
|
|
9183
|
+
* @param options
|
|
9184
|
+
*/
|
|
9185
|
+
moveRowTo(rowidOrRow, targetRowidOrRow, options) {
|
|
9186
|
+
const $xeTable = this;
|
|
9187
|
+
const props = $xeTable;
|
|
9188
|
+
const internalData = $xeTable;
|
|
9189
|
+
const {
|
|
9190
|
+
treeConfig
|
|
9191
|
+
} = props;
|
|
9192
|
+
const {
|
|
9193
|
+
fullAllDataRowIdData,
|
|
9194
|
+
afterFullData
|
|
9195
|
+
} = internalData;
|
|
9196
|
+
const {
|
|
9197
|
+
dragToChild,
|
|
9198
|
+
dragPos,
|
|
9199
|
+
isCrossDrag
|
|
9200
|
+
} = Object.assign({}, options);
|
|
9201
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9202
|
+
const dragRow = handleRowidOrRow($xeTable, rowidOrRow);
|
|
9203
|
+
let prevDragRow = null;
|
|
9204
|
+
let defPos = 'top';
|
|
9205
|
+
const rowRest = dragRow ? fullAllDataRowIdData[getRowid($xeTable, dragRow)] : null;
|
|
9206
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetRowidOrRow)) {
|
|
9207
|
+
if (rowRest && targetRowidOrRow) {
|
|
9208
|
+
let currList = afterFullData;
|
|
9209
|
+
let offsetIndex = rowRest._index + targetRowidOrRow;
|
|
9210
|
+
if (treeConfig) {
|
|
9211
|
+
currList = rowRest.items;
|
|
9212
|
+
if (treeOpts.transform) {
|
|
9213
|
+
offsetIndex = rowRest.treeIndex + targetRowidOrRow;
|
|
9214
|
+
if (isCrossDrag) {
|
|
9215
|
+
currList = afterFullData;
|
|
9216
|
+
offsetIndex = rowRest._index + targetRowidOrRow;
|
|
9217
|
+
}
|
|
9218
|
+
}
|
|
9219
|
+
}
|
|
9220
|
+
if (offsetIndex >= 0 && offsetIndex <= currList.length - 1) {
|
|
9221
|
+
prevDragRow = currList[offsetIndex];
|
|
9222
|
+
}
|
|
9223
|
+
if (targetRowidOrRow > 0) {
|
|
9224
|
+
defPos = 'bottom';
|
|
9225
|
+
}
|
|
9226
|
+
}
|
|
9227
|
+
} else {
|
|
9228
|
+
prevDragRow = handleRowidOrRow($xeTable, targetRowidOrRow);
|
|
9229
|
+
const targetRowRest = prevDragRow ? fullAllDataRowIdData[getRowid($xeTable, prevDragRow)] : null;
|
|
9230
|
+
if (rowRest && targetRowRest) {
|
|
9231
|
+
if (targetRowRest._index > rowRest._index) {
|
|
9232
|
+
defPos = 'bottom';
|
|
9233
|
+
}
|
|
9234
|
+
}
|
|
9235
|
+
}
|
|
9236
|
+
return $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
|
|
9237
|
+
},
|
|
8852
9238
|
/**
|
|
8853
9239
|
* 获取表格的全量列
|
|
8854
9240
|
*/
|
|
@@ -8871,16 +9257,23 @@ const Methods = {
|
|
|
8871
9257
|
* 用于多选行,获取已选中的数据
|
|
8872
9258
|
*/
|
|
8873
9259
|
getCheckboxRecords(isFull) {
|
|
9260
|
+
const $xeTable = this;
|
|
9261
|
+
const props = $xeTable;
|
|
9262
|
+
const internalData = $xeTable;
|
|
9263
|
+
const {
|
|
9264
|
+
treeConfig
|
|
9265
|
+
} = props;
|
|
8874
9266
|
const {
|
|
8875
9267
|
tableFullData,
|
|
8876
9268
|
afterFullData,
|
|
8877
|
-
treeConfig,
|
|
8878
|
-
treeOpts,
|
|
8879
|
-
checkboxOpts,
|
|
8880
|
-
tableFullTreeData,
|
|
8881
9269
|
afterTreeFullData,
|
|
8882
|
-
|
|
8883
|
-
|
|
9270
|
+
tableFullTreeData,
|
|
9271
|
+
fullDataRowIdData,
|
|
9272
|
+
afterFullRowMaps,
|
|
9273
|
+
selectCheckboxMaps
|
|
9274
|
+
} = internalData;
|
|
9275
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9276
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
8884
9277
|
const {
|
|
8885
9278
|
transform,
|
|
8886
9279
|
mapChildrenField
|
|
@@ -8889,21 +9282,18 @@ const Methods = {
|
|
|
8889
9282
|
checkField
|
|
8890
9283
|
} = checkboxOpts;
|
|
8891
9284
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8892
|
-
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
|
|
8893
9285
|
let rowList = [];
|
|
8894
9286
|
if (checkField) {
|
|
8895
9287
|
if (treeConfig) {
|
|
9288
|
+
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
|
|
8896
9289
|
rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(currTableData, row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField), {
|
|
8897
9290
|
children: transform ? mapChildrenField : childrenField
|
|
8898
9291
|
});
|
|
8899
9292
|
} else {
|
|
9293
|
+
const currTableData = isFull ? tableFullData : afterFullData;
|
|
8900
9294
|
rowList = currTableData.filter(row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField));
|
|
8901
9295
|
}
|
|
8902
9296
|
} else {
|
|
8903
|
-
const {
|
|
8904
|
-
selectCheckboxMaps,
|
|
8905
|
-
fullDataRowIdData
|
|
8906
|
-
} = this;
|
|
8907
9297
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (row, rowid) => {
|
|
8908
9298
|
if (isFull) {
|
|
8909
9299
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -9322,6 +9712,7 @@ const Methods = {
|
|
|
9322
9712
|
* 默认执行一次,除非被重置
|
|
9323
9713
|
*/
|
|
9324
9714
|
handleLoadDefaults() {
|
|
9715
|
+
const $xeTable = this;
|
|
9325
9716
|
if (this.checkboxConfig) {
|
|
9326
9717
|
this.handleDefaultSelectionChecked();
|
|
9327
9718
|
}
|
|
@@ -9332,7 +9723,7 @@ const Methods = {
|
|
|
9332
9723
|
this.handleDefaultRowExpand();
|
|
9333
9724
|
}
|
|
9334
9725
|
if (this.treeConfig) {
|
|
9335
|
-
|
|
9726
|
+
handleDefaultTreeExpand($xeTable);
|
|
9336
9727
|
}
|
|
9337
9728
|
if (this.mergeCells) {
|
|
9338
9729
|
this.handleDefaultMergeCells();
|
|
@@ -9617,14 +10008,26 @@ const Methods = {
|
|
|
9617
10008
|
}
|
|
9618
10009
|
},
|
|
9619
10010
|
getCustomStoreData() {
|
|
10011
|
+
const $xeTable = this;
|
|
10012
|
+
const props = $xeTable;
|
|
10013
|
+
const internalData = $xeTable;
|
|
10014
|
+
const {
|
|
10015
|
+
id
|
|
10016
|
+
} = props;
|
|
10017
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
9620
10018
|
const {
|
|
9621
|
-
id,
|
|
9622
|
-
customOpts,
|
|
9623
10019
|
collectColumn
|
|
9624
|
-
} =
|
|
10020
|
+
} = internalData;
|
|
9625
10021
|
const {
|
|
10022
|
+
storage,
|
|
9626
10023
|
checkMethod
|
|
9627
10024
|
} = customOpts;
|
|
10025
|
+
const isAllCustom = storage === true;
|
|
10026
|
+
const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
|
|
10027
|
+
const isCustomResizable = isAllCustom || storageOpts.resizable;
|
|
10028
|
+
const isCustomVisible = isAllCustom || storageOpts.visible;
|
|
10029
|
+
const isCustomFixed = isAllCustom || storageOpts.fixed;
|
|
10030
|
+
const isCustomSort = isAllCustom || storageOpts.sort;
|
|
9628
10031
|
const resizableData = {};
|
|
9629
10032
|
const sortData = {};
|
|
9630
10033
|
const visibleData = {};
|
|
@@ -9641,48 +10044,38 @@ const Methods = {
|
|
|
9641
10044
|
}
|
|
9642
10045
|
let hasResizable = 0;
|
|
9643
10046
|
let hasSort = 0;
|
|
9644
|
-
let
|
|
10047
|
+
let hasFixed = 0;
|
|
9645
10048
|
let hasVisible = 0;
|
|
9646
10049
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
10050
|
+
const colKey = column.getKey();
|
|
10051
|
+
if (!colKey) {
|
|
10052
|
+
errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
|
|
10053
|
+
return;
|
|
10054
|
+
}
|
|
9647
10055
|
// 只支持一级
|
|
9648
10056
|
if (!parentColumn) {
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
hasSort = 1;
|
|
9653
|
-
sortData[colKey] = column.renderSortNumber;
|
|
9654
|
-
}
|
|
9655
|
-
});
|
|
9656
|
-
if (column.fixed !== column.defaultFixed) {
|
|
9657
|
-
const colKey = column.getKey();
|
|
9658
|
-
if (colKey) {
|
|
9659
|
-
hasFixedt = 1;
|
|
9660
|
-
fixedData[colKey] = column.fixed;
|
|
9661
|
-
}
|
|
10057
|
+
if (isCustomSort) {
|
|
10058
|
+
hasSort = 1;
|
|
10059
|
+
sortData[colKey] = column.renderSortNumber;
|
|
9662
10060
|
}
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
if (colKey) {
|
|
9667
|
-
hasResizable = 1;
|
|
9668
|
-
resizableData[colKey] = column.renderWidth;
|
|
10061
|
+
if (isCustomFixed && column.fixed !== column.defaultFixed) {
|
|
10062
|
+
hasFixed = 1;
|
|
10063
|
+
fixedData[colKey] = column.fixed;
|
|
9669
10064
|
}
|
|
9670
10065
|
}
|
|
9671
|
-
if (
|
|
10066
|
+
if (isCustomResizable && column.resizeWidth) {
|
|
10067
|
+
hasResizable = 1;
|
|
10068
|
+
resizableData[colKey] = column.renderWidth;
|
|
10069
|
+
}
|
|
10070
|
+
if (isCustomVisible && (!checkMethod || checkMethod({
|
|
9672
10071
|
column
|
|
9673
|
-
})) {
|
|
10072
|
+
}))) {
|
|
9674
10073
|
if (!column.visible && column.defaultVisible) {
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
hasVisible = 1;
|
|
9678
|
-
visibleData[colKey] = false;
|
|
9679
|
-
}
|
|
10074
|
+
hasVisible = 1;
|
|
10075
|
+
visibleData[colKey] = false;
|
|
9680
10076
|
} else if (column.visible && !column.defaultVisible) {
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
hasVisible = 1;
|
|
9684
|
-
visibleData[colKey] = true;
|
|
9685
|
-
}
|
|
10077
|
+
hasVisible = 1;
|
|
10078
|
+
visibleData[colKey] = true;
|
|
9686
10079
|
}
|
|
9687
10080
|
}
|
|
9688
10081
|
});
|
|
@@ -9692,7 +10085,7 @@ const Methods = {
|
|
|
9692
10085
|
if (hasSort) {
|
|
9693
10086
|
storeData.sortData = sortData;
|
|
9694
10087
|
}
|
|
9695
|
-
if (
|
|
10088
|
+
if (hasFixed) {
|
|
9696
10089
|
storeData.fixedData = fixedData;
|
|
9697
10090
|
}
|
|
9698
10091
|
if (hasVisible) {
|
|
@@ -10244,12 +10637,15 @@ const Methods = {
|
|
|
10244
10637
|
fullAllDataRowIdData,
|
|
10245
10638
|
afterFullData
|
|
10246
10639
|
} = internalData;
|
|
10640
|
+
const {
|
|
10641
|
+
handleGetRowId
|
|
10642
|
+
} = createHandleGetRowId($xeTable);
|
|
10247
10643
|
const rowOpts = $xeTable.computeRowOpts;
|
|
10248
10644
|
const cellOpts = $xeTable.computeCellOpts;
|
|
10249
10645
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
10250
10646
|
const rest = {};
|
|
10251
10647
|
afterFullData.forEach(row => {
|
|
10252
|
-
const rowid =
|
|
10648
|
+
const rowid = handleGetRowId(row);
|
|
10253
10649
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
10254
10650
|
if (rowRest) {
|
|
10255
10651
|
const resizeHeight = rowRest.resizeHeight;
|
|
@@ -10278,8 +10674,11 @@ const Methods = {
|
|
|
10278
10674
|
rHeight = Math.floor(rHeight * bodyHeight);
|
|
10279
10675
|
}
|
|
10280
10676
|
if (rHeight) {
|
|
10677
|
+
const {
|
|
10678
|
+
handleGetRowId
|
|
10679
|
+
} = createHandleGetRowId($xeTable);
|
|
10281
10680
|
rows.forEach(row => {
|
|
10282
|
-
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row) ? row :
|
|
10681
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row) ? row : handleGetRowId(row);
|
|
10283
10682
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
10284
10683
|
if (rowRest) {
|
|
10285
10684
|
rowRest.resizeHeight = rHeight;
|
|
@@ -10437,13 +10836,26 @@ const Methods = {
|
|
|
10437
10836
|
}
|
|
10438
10837
|
}
|
|
10439
10838
|
}
|
|
10440
|
-
// 兼容老版本
|
|
10441
|
-
let rest;
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10839
|
+
// 兼容老版本
|
|
10840
|
+
let rest = null;
|
|
10841
|
+
let isStop = false;
|
|
10842
|
+
for (let i = 0; i < evntList.length; i++) {
|
|
10843
|
+
const func = evntList[i];
|
|
10844
|
+
const fnRest = func(Object.assign({
|
|
10845
|
+
$grid: this.$xegrid,
|
|
10846
|
+
$table: this,
|
|
10847
|
+
$event: evnt
|
|
10848
|
+
}, args));
|
|
10849
|
+
if (fnRest === false) {
|
|
10850
|
+
isStop = true;
|
|
10851
|
+
break;
|
|
10852
|
+
} else if (fnRest && fnRest.status === false) {
|
|
10853
|
+
rest = fnRest.result;
|
|
10854
|
+
isStop = true;
|
|
10855
|
+
break;
|
|
10856
|
+
}
|
|
10857
|
+
}
|
|
10858
|
+
if (!isStop) {
|
|
10447
10859
|
if (next) {
|
|
10448
10860
|
rest = next();
|
|
10449
10861
|
}
|
|
@@ -10679,10 +11091,12 @@ const Methods = {
|
|
|
10679
11091
|
treeConfig,
|
|
10680
11092
|
treeOpts,
|
|
10681
11093
|
highlightCurrentRow,
|
|
11094
|
+
highlightCurrentColumn,
|
|
10682
11095
|
currentRow,
|
|
10683
11096
|
bodyCtxMenu,
|
|
10684
11097
|
rowOpts
|
|
10685
11098
|
} = this;
|
|
11099
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
10686
11100
|
const {
|
|
10687
11101
|
selected,
|
|
10688
11102
|
actived
|
|
@@ -10838,10 +11252,15 @@ const Methods = {
|
|
|
10838
11252
|
if (!isEditStatus) {
|
|
10839
11253
|
// 如果按下了方向键
|
|
10840
11254
|
if (selected.row && selected.column) {
|
|
10841
|
-
|
|
10842
|
-
}
|
|
10843
|
-
|
|
10844
|
-
|
|
11255
|
+
$xeTable.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
11256
|
+
}
|
|
11257
|
+
// 当前行按键上下移动
|
|
11258
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
11259
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
11260
|
+
}
|
|
11261
|
+
// 当前行按键左右移动
|
|
11262
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
11263
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt);
|
|
10845
11264
|
}
|
|
10846
11265
|
}
|
|
10847
11266
|
} else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
@@ -11220,15 +11639,20 @@ const Methods = {
|
|
|
11220
11639
|
* 获取复选框半选状态的行数据
|
|
11221
11640
|
*/
|
|
11222
11641
|
getCheckboxIndeterminateRecords(isFull) {
|
|
11642
|
+
const $xeTable = this;
|
|
11643
|
+
const props = $xeTable;
|
|
11644
|
+
const internalData = $xeTable;
|
|
11223
11645
|
const {
|
|
11224
|
-
treeConfig
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11646
|
+
treeConfig
|
|
11647
|
+
} = props;
|
|
11648
|
+
const {
|
|
11649
|
+
fullDataRowIdData,
|
|
11650
|
+
treeIndeterminateRowMaps
|
|
11651
|
+
} = internalData;
|
|
11228
11652
|
if (treeConfig) {
|
|
11229
11653
|
const fullRest = [];
|
|
11230
11654
|
const defRest = [];
|
|
11231
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(
|
|
11655
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(treeIndeterminateRowMaps, (item, rowid) => {
|
|
11232
11656
|
if (item) {
|
|
11233
11657
|
fullRest.push(item);
|
|
11234
11658
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -11305,9 +11729,13 @@ const Methods = {
|
|
|
11305
11729
|
isCheckedByCheckboxRow(row) {
|
|
11306
11730
|
const $xeTable = this;
|
|
11307
11731
|
const reactData = $xeTable;
|
|
11732
|
+
const internalData = $xeTable;
|
|
11308
11733
|
const {
|
|
11309
|
-
|
|
11734
|
+
updateCheckboxFlag
|
|
11310
11735
|
} = reactData;
|
|
11736
|
+
const {
|
|
11737
|
+
selectCheckboxMaps
|
|
11738
|
+
} = internalData;
|
|
11311
11739
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11312
11740
|
const {
|
|
11313
11741
|
checkField
|
|
@@ -11315,17 +11743,18 @@ const Methods = {
|
|
|
11315
11743
|
if (checkField) {
|
|
11316
11744
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
|
|
11317
11745
|
}
|
|
11318
|
-
return !!selectCheckboxMaps[getRowid($xeTable, row)];
|
|
11746
|
+
return !!updateCheckboxFlag && !!selectCheckboxMaps[getRowid($xeTable, row)];
|
|
11319
11747
|
},
|
|
11320
11748
|
isCheckedByCheckboxRowKey(rowid) {
|
|
11321
11749
|
const $xeTable = this;
|
|
11322
11750
|
const reactData = $xeTable;
|
|
11323
11751
|
const internalData = $xeTable;
|
|
11324
11752
|
const {
|
|
11325
|
-
|
|
11753
|
+
updateCheckboxFlag
|
|
11326
11754
|
} = reactData;
|
|
11327
11755
|
const {
|
|
11328
|
-
fullAllDataRowIdData
|
|
11756
|
+
fullAllDataRowIdData,
|
|
11757
|
+
selectCheckboxMaps
|
|
11329
11758
|
} = internalData;
|
|
11330
11759
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11331
11760
|
const {
|
|
@@ -11338,23 +11767,23 @@ const Methods = {
|
|
|
11338
11767
|
}
|
|
11339
11768
|
return false;
|
|
11340
11769
|
}
|
|
11341
|
-
return !!selectCheckboxMaps[rowid];
|
|
11770
|
+
return !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
|
|
11342
11771
|
},
|
|
11343
11772
|
isIndeterminateByCheckboxRow(row) {
|
|
11344
11773
|
const $xeTable = this;
|
|
11345
|
-
const
|
|
11774
|
+
const internalData = $xeTable;
|
|
11346
11775
|
const {
|
|
11347
|
-
|
|
11348
|
-
} =
|
|
11349
|
-
return !!
|
|
11776
|
+
treeIndeterminateRowMaps
|
|
11777
|
+
} = internalData;
|
|
11778
|
+
return !!treeIndeterminateRowMaps[getRowid($xeTable, row)] && !$xeTable.isCheckedByCheckboxRow(row);
|
|
11350
11779
|
},
|
|
11351
11780
|
isIndeterminateByCheckboxRowKey(rowid) {
|
|
11352
11781
|
const $xeTable = this;
|
|
11353
|
-
const
|
|
11782
|
+
const internalData = $xeTable;
|
|
11354
11783
|
const {
|
|
11355
|
-
|
|
11356
|
-
} =
|
|
11357
|
-
return !!
|
|
11784
|
+
treeIndeterminateRowMaps
|
|
11785
|
+
} = internalData;
|
|
11786
|
+
return !!treeIndeterminateRowMaps[rowid] && !$xeTable.isCheckedByCheckboxRowKey(rowid);
|
|
11358
11787
|
},
|
|
11359
11788
|
/**
|
|
11360
11789
|
* 切换选中
|
|
@@ -11364,13 +11793,13 @@ const Methods = {
|
|
|
11364
11793
|
const $xeTable = this;
|
|
11365
11794
|
const props = $xeTable;
|
|
11366
11795
|
const reactData = $xeTable;
|
|
11796
|
+
const internalData = $xeTable;
|
|
11367
11797
|
const {
|
|
11368
11798
|
treeConfig
|
|
11369
11799
|
} = props;
|
|
11370
11800
|
const {
|
|
11371
11801
|
selectCheckboxMaps
|
|
11372
|
-
} =
|
|
11373
|
-
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
11802
|
+
} = internalData;
|
|
11374
11803
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
11375
11804
|
const {
|
|
11376
11805
|
transform,
|
|
@@ -11383,6 +11812,10 @@ const Methods = {
|
|
|
11383
11812
|
checkStrictly,
|
|
11384
11813
|
checkMethod
|
|
11385
11814
|
} = checkboxOpts;
|
|
11815
|
+
const {
|
|
11816
|
+
handleGetRowId
|
|
11817
|
+
} = createHandleGetRowId($xeTable);
|
|
11818
|
+
// indeterminateField 仅支持读取
|
|
11386
11819
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
11387
11820
|
if (checkField) {
|
|
11388
11821
|
// 树结构
|
|
@@ -11401,35 +11834,34 @@ const Methods = {
|
|
|
11401
11834
|
}, {
|
|
11402
11835
|
children: transform ? mapChildrenField : childrenField
|
|
11403
11836
|
});
|
|
11404
|
-
reactData.
|
|
11837
|
+
reactData.updateCheckboxFlag++;
|
|
11405
11838
|
return;
|
|
11406
|
-
} else {
|
|
11407
|
-
// 列表
|
|
11408
|
-
rows.forEach(row => {
|
|
11409
|
-
if (isForce || !checkMethod || checkMethod({
|
|
11410
|
-
row
|
|
11411
|
-
})) {
|
|
11412
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, checked);
|
|
11413
|
-
handleCheckboxReserveRow($xeTable, row, checked);
|
|
11414
|
-
}
|
|
11415
|
-
});
|
|
11416
11839
|
}
|
|
11417
|
-
|
|
11840
|
+
// 列表
|
|
11841
|
+
rows.forEach(row => {
|
|
11842
|
+
if (isForce || !checkMethod || checkMethod({
|
|
11843
|
+
row
|
|
11844
|
+
})) {
|
|
11845
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, checked);
|
|
11846
|
+
handleCheckboxReserveRow($xeTable, row, checked);
|
|
11847
|
+
}
|
|
11848
|
+
});
|
|
11849
|
+
reactData.updateCheckboxFlag++;
|
|
11418
11850
|
return;
|
|
11419
11851
|
}
|
|
11420
11852
|
// 树结构
|
|
11421
11853
|
if (treeConfig && !checkStrictly) {
|
|
11422
11854
|
// 更新子节点状态
|
|
11423
11855
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows, row => {
|
|
11424
|
-
const rowid =
|
|
11856
|
+
const rowid = handleGetRowId(row);
|
|
11425
11857
|
if (isForce || !checkMethod || checkMethod({
|
|
11426
11858
|
row
|
|
11427
11859
|
})) {
|
|
11428
11860
|
if (checked) {
|
|
11429
|
-
|
|
11861
|
+
selectCheckboxMaps[rowid] = row;
|
|
11430
11862
|
} else {
|
|
11431
|
-
if (
|
|
11432
|
-
delete
|
|
11863
|
+
if (selectCheckboxMaps[rowid]) {
|
|
11864
|
+
delete selectCheckboxMaps[rowid];
|
|
11433
11865
|
}
|
|
11434
11866
|
}
|
|
11435
11867
|
handleCheckboxReserveRow($xeTable, row, checked);
|
|
@@ -11437,28 +11869,28 @@ const Methods = {
|
|
|
11437
11869
|
}, {
|
|
11438
11870
|
children: transform ? mapChildrenField : childrenField
|
|
11439
11871
|
});
|
|
11440
|
-
reactData.
|
|
11872
|
+
reactData.updateCheckboxFlag++;
|
|
11441
11873
|
return;
|
|
11442
11874
|
}
|
|
11443
11875
|
// 列表
|
|
11444
11876
|
rows.forEach(row => {
|
|
11445
|
-
const rowid =
|
|
11877
|
+
const rowid = handleGetRowId(row);
|
|
11446
11878
|
if (isForce || !checkMethod || checkMethod({
|
|
11447
11879
|
row
|
|
11448
11880
|
})) {
|
|
11449
11881
|
if (checked) {
|
|
11450
|
-
if (!
|
|
11451
|
-
|
|
11882
|
+
if (!selectCheckboxMaps[rowid]) {
|
|
11883
|
+
selectCheckboxMaps[rowid] = row;
|
|
11452
11884
|
}
|
|
11453
11885
|
} else {
|
|
11454
|
-
if (
|
|
11455
|
-
delete
|
|
11886
|
+
if (selectCheckboxMaps[rowid]) {
|
|
11887
|
+
delete selectCheckboxMaps[rowid];
|
|
11456
11888
|
}
|
|
11457
11889
|
}
|
|
11458
11890
|
handleCheckboxReserveRow($xeTable, row, checked);
|
|
11891
|
+
reactData.updateCheckboxFlag++;
|
|
11459
11892
|
}
|
|
11460
11893
|
});
|
|
11461
|
-
reactData.selectCheckboxMaps = selectRowMaps;
|
|
11462
11894
|
},
|
|
11463
11895
|
/**
|
|
11464
11896
|
* 即将移除
|
|
@@ -11471,10 +11903,12 @@ const Methods = {
|
|
|
11471
11903
|
$xeTable.handleBatchSelectRows([row], checked, isForce);
|
|
11472
11904
|
},
|
|
11473
11905
|
handleToggleCheckRowEvent(evnt, params) {
|
|
11906
|
+
const $xeTable = this;
|
|
11907
|
+
const internalData = $xeTable;
|
|
11474
11908
|
const {
|
|
11475
|
-
selectCheckboxMaps
|
|
11476
|
-
|
|
11477
|
-
|
|
11909
|
+
selectCheckboxMaps
|
|
11910
|
+
} = internalData;
|
|
11911
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11478
11912
|
const {
|
|
11479
11913
|
checkField,
|
|
11480
11914
|
trigger
|
|
@@ -11489,43 +11923,47 @@ const Methods = {
|
|
|
11489
11923
|
if (checkField) {
|
|
11490
11924
|
checked = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
|
|
11491
11925
|
} else {
|
|
11492
|
-
checked = !selectCheckboxMaps[getRowid(
|
|
11926
|
+
checked = !selectCheckboxMaps[getRowid($xeTable, row)];
|
|
11493
11927
|
}
|
|
11494
11928
|
if (evnt) {
|
|
11495
|
-
|
|
11929
|
+
$xeTable.triggerCheckRowEvent(evnt, params, checked);
|
|
11496
11930
|
} else {
|
|
11497
|
-
|
|
11498
|
-
|
|
11931
|
+
$xeTable.handleBatchSelectRows([row], checked);
|
|
11932
|
+
$xeTable.checkSelectionStatus();
|
|
11499
11933
|
}
|
|
11500
11934
|
},
|
|
11501
11935
|
triggerCheckRowEvent(evnt, params, checked) {
|
|
11502
11936
|
const $xeTable = this;
|
|
11937
|
+
const props = $xeTable;
|
|
11938
|
+
const internalData = $xeTable;
|
|
11939
|
+
const {
|
|
11940
|
+
row
|
|
11941
|
+
} = params;
|
|
11503
11942
|
const {
|
|
11504
|
-
checkboxOpts,
|
|
11505
11943
|
afterFullData
|
|
11506
|
-
} =
|
|
11944
|
+
} = internalData;
|
|
11945
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11507
11946
|
const {
|
|
11508
11947
|
checkMethod,
|
|
11509
11948
|
trigger
|
|
11510
11949
|
} = checkboxOpts;
|
|
11511
|
-
const {
|
|
11512
|
-
row
|
|
11513
|
-
} = params;
|
|
11514
11950
|
if (trigger === 'manual') {
|
|
11515
11951
|
return;
|
|
11516
11952
|
}
|
|
11517
11953
|
evnt.stopPropagation();
|
|
11518
|
-
if (checkboxOpts.isShiftKey && evnt.shiftKey && !
|
|
11519
|
-
const checkboxRecords =
|
|
11954
|
+
if (checkboxOpts.isShiftKey && evnt.shiftKey && !props.treeConfig) {
|
|
11955
|
+
const checkboxRecords = $xeTable.getCheckboxRecords();
|
|
11520
11956
|
if (checkboxRecords.length) {
|
|
11521
11957
|
const firstRow = checkboxRecords[0];
|
|
11522
|
-
const _rowIndex =
|
|
11523
|
-
const _firstRowIndex =
|
|
11958
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
11959
|
+
const _firstRowIndex = $xeTable.getVTRowIndex(firstRow);
|
|
11524
11960
|
if (_rowIndex !== _firstRowIndex) {
|
|
11525
|
-
|
|
11961
|
+
$xeTable.setAllCheckboxRow(false);
|
|
11526
11962
|
const rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1);
|
|
11527
|
-
|
|
11528
|
-
|
|
11963
|
+
$xeTable.$nextTick(() => {
|
|
11964
|
+
handleCheckedCheckboxRow($xeTable, rangeRows, true, false);
|
|
11965
|
+
});
|
|
11966
|
+
$xeTable.dispatchEvent('checkbox-range-select', Object.assign({
|
|
11529
11967
|
rangeRecords: rangeRows
|
|
11530
11968
|
}, params), evnt);
|
|
11531
11969
|
return;
|
|
@@ -11535,12 +11973,12 @@ const Methods = {
|
|
|
11535
11973
|
if (!checkMethod || checkMethod({
|
|
11536
11974
|
row
|
|
11537
11975
|
})) {
|
|
11538
|
-
|
|
11539
|
-
|
|
11540
|
-
|
|
11541
|
-
records:
|
|
11542
|
-
reserves:
|
|
11543
|
-
indeterminates:
|
|
11976
|
+
$xeTable.handleBatchSelectRows([row], checked);
|
|
11977
|
+
$xeTable.checkSelectionStatus();
|
|
11978
|
+
$xeTable.dispatchEvent('checkbox-change', Object.assign({
|
|
11979
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
11980
|
+
reserves: () => $xeTable.getCheckboxReserveRecords(),
|
|
11981
|
+
indeterminates: () => $xeTable.getCheckboxIndeterminateRecords(),
|
|
11544
11982
|
checked
|
|
11545
11983
|
}, params), evnt);
|
|
11546
11984
|
}
|
|
@@ -11550,10 +11988,11 @@ const Methods = {
|
|
|
11550
11988
|
*/
|
|
11551
11989
|
toggleCheckboxRow(row) {
|
|
11552
11990
|
const $xeTable = this;
|
|
11991
|
+
const internalData = $xeTable;
|
|
11553
11992
|
const {
|
|
11554
|
-
selectCheckboxMaps
|
|
11555
|
-
|
|
11556
|
-
|
|
11993
|
+
selectCheckboxMaps
|
|
11994
|
+
} = internalData;
|
|
11995
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11557
11996
|
const {
|
|
11558
11997
|
checkField
|
|
11559
11998
|
} = checkboxOpts;
|
|
@@ -11580,10 +12019,8 @@ const Methods = {
|
|
|
11580
12019
|
} = props;
|
|
11581
12020
|
const {
|
|
11582
12021
|
selectCheckboxMaps,
|
|
11583
|
-
|
|
11584
|
-
} =
|
|
11585
|
-
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
11586
|
-
const halfRowMaps = Object.assign({}, treeIndeterminateMaps);
|
|
12022
|
+
treeIndeterminateRowMaps
|
|
12023
|
+
} = internalData;
|
|
11587
12024
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
11588
12025
|
const {
|
|
11589
12026
|
transform,
|
|
@@ -11604,10 +12041,13 @@ const Methods = {
|
|
|
11604
12041
|
}
|
|
11605
12042
|
// 树结构
|
|
11606
12043
|
if (treeConfig) {
|
|
12044
|
+
const {
|
|
12045
|
+
handleGetRowId
|
|
12046
|
+
} = createHandleGetRowId($xeTable);
|
|
11607
12047
|
const childRowMaps = {};
|
|
11608
12048
|
const childRowList = [];
|
|
11609
12049
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, row => {
|
|
11610
|
-
const rowid =
|
|
12050
|
+
const rowid = handleGetRowId(row);
|
|
11611
12051
|
const childList = row[transform ? mapChildrenField : childrenField];
|
|
11612
12052
|
if (childList && childList.length && !childRowMaps[rowid]) {
|
|
11613
12053
|
childRowMaps[rowid] = 1;
|
|
@@ -11624,30 +12064,30 @@ const Methods = {
|
|
|
11624
12064
|
let hLen = 0; // 半选
|
|
11625
12065
|
let vLen = 0; // 有效行
|
|
11626
12066
|
childList.forEach(checkMethod ? item => {
|
|
11627
|
-
const childRowid =
|
|
11628
|
-
const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) :
|
|
12067
|
+
const childRowid = handleGetRowId(item);
|
|
12068
|
+
const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) : selectCheckboxMaps[childRowid];
|
|
11629
12069
|
if (checkMethod({
|
|
11630
12070
|
row: item
|
|
11631
12071
|
})) {
|
|
11632
12072
|
if (isSelect) {
|
|
11633
12073
|
sLen++;
|
|
11634
|
-
} else if (
|
|
12074
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11635
12075
|
hLen++;
|
|
11636
12076
|
}
|
|
11637
12077
|
vLen++;
|
|
11638
12078
|
} else {
|
|
11639
12079
|
if (isSelect) {
|
|
11640
12080
|
sLen++;
|
|
11641
|
-
} else if (
|
|
12081
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11642
12082
|
hLen++;
|
|
11643
12083
|
}
|
|
11644
12084
|
}
|
|
11645
12085
|
} : item => {
|
|
11646
|
-
const childRowid =
|
|
11647
|
-
const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) :
|
|
12086
|
+
const childRowid = handleGetRowId(item);
|
|
12087
|
+
const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) : selectCheckboxMaps[childRowid];
|
|
11648
12088
|
if (isSelect) {
|
|
11649
12089
|
sLen++;
|
|
11650
|
-
} else if (
|
|
12090
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11651
12091
|
hLen++;
|
|
11652
12092
|
}
|
|
11653
12093
|
vLen++;
|
|
@@ -11659,29 +12099,28 @@ const Methods = {
|
|
|
11659
12099
|
}
|
|
11660
12100
|
if (isSelected) {
|
|
11661
12101
|
if (!checkField) {
|
|
11662
|
-
|
|
12102
|
+
selectCheckboxMaps[rowid] = row;
|
|
11663
12103
|
}
|
|
11664
|
-
if (
|
|
11665
|
-
delete
|
|
12104
|
+
if (treeIndeterminateRowMaps[rowid]) {
|
|
12105
|
+
delete treeIndeterminateRowMaps[rowid];
|
|
11666
12106
|
}
|
|
11667
12107
|
} else {
|
|
11668
12108
|
if (!checkField) {
|
|
11669
|
-
if (
|
|
11670
|
-
delete
|
|
12109
|
+
if (selectCheckboxMaps[rowid]) {
|
|
12110
|
+
delete selectCheckboxMaps[rowid];
|
|
11671
12111
|
}
|
|
11672
12112
|
}
|
|
11673
12113
|
if (halfSelect) {
|
|
11674
|
-
|
|
12114
|
+
treeIndeterminateRowMaps[rowid] = row;
|
|
11675
12115
|
} else {
|
|
11676
|
-
if (
|
|
11677
|
-
delete
|
|
12116
|
+
if (treeIndeterminateRowMaps[rowid]) {
|
|
12117
|
+
delete treeIndeterminateRowMaps[rowid];
|
|
11678
12118
|
}
|
|
11679
12119
|
}
|
|
11680
12120
|
}
|
|
11681
12121
|
});
|
|
11682
12122
|
}
|
|
11683
|
-
reactData.
|
|
11684
|
-
reactData.treeIndeterminateMaps = halfRowMaps;
|
|
12123
|
+
reactData.updateCheckboxFlag++;
|
|
11685
12124
|
},
|
|
11686
12125
|
updateAllCheckboxStatus() {
|
|
11687
12126
|
const $xeTable = this;
|
|
@@ -11692,9 +12131,12 @@ const Methods = {
|
|
|
11692
12131
|
treeConfig
|
|
11693
12132
|
} = props;
|
|
11694
12133
|
const {
|
|
12134
|
+
afterFullData,
|
|
12135
|
+
afterTreeFullData,
|
|
12136
|
+
checkboxReserveRowMap,
|
|
11695
12137
|
selectCheckboxMaps,
|
|
11696
|
-
|
|
11697
|
-
} =
|
|
12138
|
+
treeIndeterminateRowMaps
|
|
12139
|
+
} = internalData;
|
|
11698
12140
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11699
12141
|
const {
|
|
11700
12142
|
checkField,
|
|
@@ -11702,39 +12144,37 @@ const Methods = {
|
|
|
11702
12144
|
showReserveStatus
|
|
11703
12145
|
} = checkboxOpts;
|
|
11704
12146
|
const {
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
checkboxReserveRowMap
|
|
11708
|
-
} = internalData;
|
|
12147
|
+
handleGetRowId
|
|
12148
|
+
} = createHandleGetRowId($xeTable);
|
|
11709
12149
|
let sLen = 0; // 已选
|
|
11710
12150
|
let hLen = 0; // 半选
|
|
11711
12151
|
let vLen = 0; // 有效行
|
|
11712
12152
|
const rootList = treeConfig ? afterTreeFullData : afterFullData;
|
|
11713
12153
|
rootList.forEach(checkMethod ? row => {
|
|
11714
|
-
const childRowid =
|
|
12154
|
+
const childRowid = handleGetRowId(row);
|
|
11715
12155
|
const selected = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
11716
12156
|
if (checkMethod({
|
|
11717
12157
|
row
|
|
11718
12158
|
})) {
|
|
11719
12159
|
if (selected) {
|
|
11720
12160
|
sLen++;
|
|
11721
|
-
} else if (
|
|
12161
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11722
12162
|
hLen++;
|
|
11723
12163
|
}
|
|
11724
12164
|
vLen++;
|
|
11725
12165
|
} else {
|
|
11726
12166
|
if (selected) {
|
|
11727
12167
|
sLen++;
|
|
11728
|
-
} else if (
|
|
12168
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11729
12169
|
hLen++;
|
|
11730
12170
|
}
|
|
11731
12171
|
}
|
|
11732
12172
|
} : row => {
|
|
11733
|
-
const childRowid =
|
|
12173
|
+
const childRowid = handleGetRowId(row);
|
|
11734
12174
|
const selected = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
11735
12175
|
if (selected) {
|
|
11736
12176
|
sLen++;
|
|
11737
|
-
} else if (
|
|
12177
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11738
12178
|
hLen++;
|
|
11739
12179
|
}
|
|
11740
12180
|
vLen++;
|
|
@@ -11798,27 +12238,35 @@ const Methods = {
|
|
|
11798
12238
|
* 获取复选框保留选中的行
|
|
11799
12239
|
*/
|
|
11800
12240
|
getCheckboxReserveRecords(isFull) {
|
|
12241
|
+
const $xeTable = this;
|
|
12242
|
+
const props = $xeTable;
|
|
12243
|
+
const internalData = $xeTable;
|
|
12244
|
+
const {
|
|
12245
|
+
treeConfig
|
|
12246
|
+
} = props;
|
|
11801
12247
|
const {
|
|
11802
|
-
fullDataRowIdData,
|
|
11803
12248
|
afterFullData,
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
12249
|
+
fullDataRowIdData,
|
|
12250
|
+
checkboxReserveRowMap
|
|
12251
|
+
} = internalData;
|
|
12252
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
12253
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
11809
12254
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
11810
12255
|
const reserveSelection = [];
|
|
11811
12256
|
if (checkboxOpts.reserve) {
|
|
12257
|
+
const {
|
|
12258
|
+
handleGetRowId
|
|
12259
|
+
} = createHandleGetRowId($xeTable);
|
|
11812
12260
|
const afterFullIdMaps = {};
|
|
11813
12261
|
if (treeConfig) {
|
|
11814
12262
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterFullData, row => {
|
|
11815
|
-
afterFullIdMaps[
|
|
12263
|
+
afterFullIdMaps[handleGetRowId(row)] = 1;
|
|
11816
12264
|
}, {
|
|
11817
12265
|
children: childrenField
|
|
11818
12266
|
});
|
|
11819
12267
|
} else {
|
|
11820
12268
|
afterFullData.forEach(row => {
|
|
11821
|
-
afterFullIdMaps[
|
|
12269
|
+
afterFullIdMaps[handleGetRowId(row)] = 1;
|
|
11822
12270
|
});
|
|
11823
12271
|
}
|
|
11824
12272
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(checkboxReserveRowMap, (oldRow, oldRowid) => {
|
|
@@ -11860,9 +12308,9 @@ const Methods = {
|
|
|
11860
12308
|
handleCheckedAllCheckboxRow($xeTable, value);
|
|
11861
12309
|
if (evnt) {
|
|
11862
12310
|
$xeTable.dispatchEvent('checkbox-all', {
|
|
11863
|
-
records: $xeTable.getCheckboxRecords(),
|
|
11864
|
-
reserves: $xeTable.getCheckboxReserveRecords(),
|
|
11865
|
-
indeterminates: $xeTable.getCheckboxIndeterminateRecords(),
|
|
12311
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
12312
|
+
reserves: () => $xeTable.getCheckboxReserveRecords(),
|
|
12313
|
+
indeterminates: () => $xeTable.getCheckboxIndeterminateRecords(),
|
|
11866
12314
|
checked: value
|
|
11867
12315
|
}, evnt);
|
|
11868
12316
|
}
|
|
@@ -11898,17 +12346,24 @@ const Methods = {
|
|
|
11898
12346
|
* 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
|
|
11899
12347
|
*/
|
|
11900
12348
|
clearCheckboxRow() {
|
|
12349
|
+
const $xeTable = this;
|
|
12350
|
+
const props = $xeTable;
|
|
12351
|
+
const reactData = $xeTable;
|
|
12352
|
+
const internalData = $xeTable;
|
|
11901
12353
|
const {
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
} =
|
|
12354
|
+
treeConfig
|
|
12355
|
+
} = props;
|
|
12356
|
+
const {
|
|
12357
|
+
tableFullData
|
|
12358
|
+
} = internalData;
|
|
12359
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
12360
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12361
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11907
12362
|
const {
|
|
11908
12363
|
checkField,
|
|
11909
12364
|
reserve
|
|
11910
12365
|
} = checkboxOpts;
|
|
11911
|
-
|
|
12366
|
+
// indeterminateField 仅支持读取
|
|
11912
12367
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
11913
12368
|
if (checkField) {
|
|
11914
12369
|
const handleClearChecked = item => {
|
|
@@ -11928,10 +12383,11 @@ const Methods = {
|
|
|
11928
12383
|
if (reserve) {
|
|
11929
12384
|
tableFullData.forEach(row => this.handleCheckboxReserveRow(row, false));
|
|
11930
12385
|
}
|
|
11931
|
-
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
12386
|
+
reactData.isAllSelected = false;
|
|
12387
|
+
reactData.isIndeterminate = false;
|
|
12388
|
+
internalData.selectCheckboxMaps = {};
|
|
12389
|
+
internalData.treeIndeterminateRowMaps = {};
|
|
12390
|
+
reactData.updateCheckboxFlag++;
|
|
11935
12391
|
return this.$nextTick();
|
|
11936
12392
|
},
|
|
11937
12393
|
/**
|
|
@@ -12184,12 +12640,14 @@ const Methods = {
|
|
|
12184
12640
|
},
|
|
12185
12641
|
triggerHeaderCellClickEvent(evnt, params) {
|
|
12186
12642
|
const $xeTable = this;
|
|
12643
|
+
const props = $xeTable;
|
|
12187
12644
|
const internalData = $xeTable;
|
|
12188
12645
|
const {
|
|
12189
12646
|
_lastResizeTime
|
|
12190
12647
|
} = internalData;
|
|
12191
12648
|
const sortOpts = $xeTable.computeSortOpts;
|
|
12192
12649
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
12650
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
12193
12651
|
const {
|
|
12194
12652
|
column
|
|
12195
12653
|
} = params;
|
|
@@ -12206,7 +12664,7 @@ const Methods = {
|
|
|
12206
12664
|
triggerFilter,
|
|
12207
12665
|
cell
|
|
12208
12666
|
}, params), evnt);
|
|
12209
|
-
if (columnOpts.isCurrent ||
|
|
12667
|
+
if ((columnOpts.isCurrent || props.highlightCurrentColumn) && (!currentColumnOpts.trigger || ['header', 'default'].includes(currentColumnOpts.trigger))) {
|
|
12210
12668
|
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
12211
12669
|
}
|
|
12212
12670
|
return $xeTable.$nextTick();
|
|
@@ -12224,13 +12682,25 @@ const Methods = {
|
|
|
12224
12682
|
* @param {ColumnInfo} fieldOrColumn 列配置
|
|
12225
12683
|
*/
|
|
12226
12684
|
setCurrentColumn(fieldOrColumn) {
|
|
12227
|
-
const
|
|
12685
|
+
const $xeTable = this;
|
|
12686
|
+
const props = $xeTable;
|
|
12687
|
+
const reactData = $xeTable;
|
|
12688
|
+
const {
|
|
12689
|
+
mouseConfig
|
|
12690
|
+
} = props;
|
|
12691
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
12692
|
+
const isMouseSelected = mouseConfig && mouseOpts.selected;
|
|
12693
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
12228
12694
|
if (column) {
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
this.currentColumn = column;
|
|
12695
|
+
$xeTable.clearCurrentColumn();
|
|
12696
|
+
reactData.currentColumn = column;
|
|
12232
12697
|
}
|
|
12233
|
-
return
|
|
12698
|
+
return $xeTable.$nextTick().then(() => {
|
|
12699
|
+
// 更新状选中态
|
|
12700
|
+
if (isMouseSelected) {
|
|
12701
|
+
$xeTable.addCellSelectedClass();
|
|
12702
|
+
}
|
|
12703
|
+
});
|
|
12234
12704
|
},
|
|
12235
12705
|
/**
|
|
12236
12706
|
* 用于当前列,手动清空当前高亮的状态
|
|
@@ -12239,21 +12709,6 @@ const Methods = {
|
|
|
12239
12709
|
this.currentColumn = null;
|
|
12240
12710
|
return this.$nextTick();
|
|
12241
12711
|
},
|
|
12242
|
-
checkValidate(type) {
|
|
12243
|
-
if (this.triggerValidate) {
|
|
12244
|
-
return this.triggerValidate(type);
|
|
12245
|
-
}
|
|
12246
|
-
return this.$nextTick();
|
|
12247
|
-
},
|
|
12248
|
-
/**
|
|
12249
|
-
* 当单元格发生改变时
|
|
12250
|
-
* 如果存在规则,则校验
|
|
12251
|
-
*/
|
|
12252
|
-
handleChangeCell(evnt, params) {
|
|
12253
|
-
this.checkValidate('blur').catch(e => e).then(() => {
|
|
12254
|
-
this.handleEdit(params, evnt).then(() => this.checkValidate('change')).catch(e => e);
|
|
12255
|
-
});
|
|
12256
|
-
},
|
|
12257
12712
|
/**
|
|
12258
12713
|
* 列点击事件
|
|
12259
12714
|
* 如果是单击模式,则激活为编辑状态
|
|
@@ -12265,6 +12720,7 @@ const Methods = {
|
|
|
12265
12720
|
const reactData = $xeTable;
|
|
12266
12721
|
const {
|
|
12267
12722
|
highlightCurrentRow,
|
|
12723
|
+
highlightCurrentColumn,
|
|
12268
12724
|
editConfig
|
|
12269
12725
|
} = props;
|
|
12270
12726
|
const {
|
|
@@ -12281,6 +12737,8 @@ const Methods = {
|
|
|
12281
12737
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
12282
12738
|
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
12283
12739
|
const rowOpts = $xeTable.computeRowOpts;
|
|
12740
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
12741
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
12284
12742
|
const {
|
|
12285
12743
|
actived,
|
|
12286
12744
|
focused
|
|
@@ -12311,11 +12769,11 @@ const Methods = {
|
|
|
12311
12769
|
if (!triggerCheckbox && !triggerRadio) {
|
|
12312
12770
|
// 如果是展开行
|
|
12313
12771
|
if (!triggerExpandNode && (expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
|
|
12314
|
-
|
|
12772
|
+
$xeTable.triggerRowExpandEvent(evnt, params);
|
|
12315
12773
|
}
|
|
12316
12774
|
// 如果是树形表格
|
|
12317
12775
|
if (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell') {
|
|
12318
|
-
|
|
12776
|
+
$xeTable.triggerTreeExpandEvent(evnt, params);
|
|
12319
12777
|
}
|
|
12320
12778
|
}
|
|
12321
12779
|
// 如果点击了树节点
|
|
@@ -12324,16 +12782,22 @@ const Methods = {
|
|
|
12324
12782
|
// 如果是高亮行
|
|
12325
12783
|
if (rowOpts.isCurrent || highlightCurrentRow) {
|
|
12326
12784
|
if (!triggerCheckbox && !triggerRadio) {
|
|
12327
|
-
|
|
12785
|
+
$xeTable.triggerCurrentRowEvent(evnt, params);
|
|
12786
|
+
}
|
|
12787
|
+
}
|
|
12788
|
+
// 如果是当前列
|
|
12789
|
+
if ((columnOpts.isCurrent || highlightCurrentColumn) && (!currentColumnOpts.trigger || ['cell', 'default'].includes(currentColumnOpts.trigger))) {
|
|
12790
|
+
if (!triggerCheckbox && !triggerRadio) {
|
|
12791
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
12328
12792
|
}
|
|
12329
12793
|
}
|
|
12330
12794
|
// 如果是单选框
|
|
12331
12795
|
if (!triggerRadio && (radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
|
|
12332
|
-
|
|
12796
|
+
$xeTable.triggerRadioRowEvent(evnt, params);
|
|
12333
12797
|
}
|
|
12334
12798
|
// 如果是复选框
|
|
12335
12799
|
if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
|
|
12336
|
-
|
|
12800
|
+
$xeTable.handleToggleCheckRowEvent(evnt, params);
|
|
12337
12801
|
}
|
|
12338
12802
|
}
|
|
12339
12803
|
// 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式)
|
|
@@ -12345,14 +12809,14 @@ const Methods = {
|
|
|
12345
12809
|
}
|
|
12346
12810
|
if (editOpts.trigger === 'manual') {
|
|
12347
12811
|
if (actived.args && actived.row === row && column !== actived.column) {
|
|
12348
|
-
|
|
12812
|
+
handleChangeCell($xeTable, evnt, params);
|
|
12349
12813
|
}
|
|
12350
12814
|
} else if (!actived.args || row !== actived.row || column !== actived.column) {
|
|
12351
12815
|
if (editOpts.trigger === 'click') {
|
|
12352
|
-
|
|
12816
|
+
handleChangeCell($xeTable, evnt, params);
|
|
12353
12817
|
} else if (editOpts.trigger === 'dblclick') {
|
|
12354
12818
|
if (editOpts.mode === 'row' && actived.row === row) {
|
|
12355
|
-
|
|
12819
|
+
handleChangeCell($xeTable, evnt, params);
|
|
12356
12820
|
}
|
|
12357
12821
|
}
|
|
12358
12822
|
}
|
|
@@ -12372,7 +12836,7 @@ const Methods = {
|
|
|
12372
12836
|
}
|
|
12373
12837
|
}
|
|
12374
12838
|
}
|
|
12375
|
-
|
|
12839
|
+
$xeTable.dispatchEvent('cell-click', params, evnt);
|
|
12376
12840
|
},
|
|
12377
12841
|
/**
|
|
12378
12842
|
* 列双击点击事件
|
|
@@ -12403,11 +12867,11 @@ const Methods = {
|
|
|
12403
12867
|
if (isEnableConf(editConfig) && editOpts.trigger === 'dblclick') {
|
|
12404
12868
|
if (!actived.args || evnt.currentTarget !== actived.args.cell) {
|
|
12405
12869
|
if (editOpts.mode === 'row') {
|
|
12406
|
-
|
|
12407
|
-
this.handleEdit(params, evnt).then(() =>
|
|
12870
|
+
checkValidate($xeTable, 'blur').catch(e => e).then(() => {
|
|
12871
|
+
this.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
|
|
12408
12872
|
});
|
|
12409
12873
|
} else if (editOpts.mode === 'cell') {
|
|
12410
|
-
this.handleEdit(params, evnt).then(() =>
|
|
12874
|
+
this.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
|
|
12411
12875
|
}
|
|
12412
12876
|
}
|
|
12413
12877
|
}
|
|
@@ -12659,6 +13123,8 @@ const Methods = {
|
|
|
12659
13123
|
} = props;
|
|
12660
13124
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
12661
13125
|
const {
|
|
13126
|
+
afterFullData,
|
|
13127
|
+
tableFullData,
|
|
12662
13128
|
fullAllDataRowIdData
|
|
12663
13129
|
} = internalData;
|
|
12664
13130
|
const {
|
|
@@ -12676,12 +13142,11 @@ const Methods = {
|
|
|
12676
13142
|
parentField
|
|
12677
13143
|
} = treeOpts;
|
|
12678
13144
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12679
|
-
const {
|
|
12680
|
-
afterFullData,
|
|
12681
|
-
tableFullData
|
|
12682
|
-
} = internalData;
|
|
12683
13145
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
12684
13146
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
13147
|
+
const errRest = {
|
|
13148
|
+
status: false
|
|
13149
|
+
};
|
|
12685
13150
|
if (prevDragRow && dragRow) {
|
|
12686
13151
|
// 判断是否有拖动
|
|
12687
13152
|
if (prevDragRow !== dragRow) {
|
|
@@ -12696,7 +13161,7 @@ const Methods = {
|
|
|
12696
13161
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
12697
13162
|
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
12698
13163
|
if (!status) {
|
|
12699
|
-
return;
|
|
13164
|
+
return errRest;
|
|
12700
13165
|
}
|
|
12701
13166
|
let oafIndex = -1;
|
|
12702
13167
|
let nafIndex = -1;
|
|
@@ -12727,11 +13192,11 @@ const Methods = {
|
|
|
12727
13192
|
if (isPeerDrag && !isCrossDrag) {
|
|
12728
13193
|
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
12729
13194
|
// 非同级
|
|
12730
|
-
return;
|
|
13195
|
+
return errRest;
|
|
12731
13196
|
}
|
|
12732
13197
|
} else {
|
|
12733
13198
|
if (!isCrossDrag) {
|
|
12734
|
-
return;
|
|
13199
|
+
return errRest;
|
|
12735
13200
|
}
|
|
12736
13201
|
if (oldAllMaps[newRowid]) {
|
|
12737
13202
|
isSelfToChildStatus = true;
|
|
@@ -12742,19 +13207,19 @@ const Methods = {
|
|
|
12742
13207
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
12743
13208
|
});
|
|
12744
13209
|
}
|
|
12745
|
-
return;
|
|
13210
|
+
return errRest;
|
|
12746
13211
|
}
|
|
12747
13212
|
}
|
|
12748
13213
|
}
|
|
12749
13214
|
} else if (oldLevel) {
|
|
12750
13215
|
// 子到根
|
|
12751
13216
|
if (!isCrossDrag) {
|
|
12752
|
-
return;
|
|
13217
|
+
return errRest;
|
|
12753
13218
|
}
|
|
12754
13219
|
} else if (newLevel) {
|
|
12755
13220
|
// 根到子
|
|
12756
13221
|
if (!isCrossDrag) {
|
|
12757
|
-
return;
|
|
13222
|
+
return errRest;
|
|
12758
13223
|
}
|
|
12759
13224
|
if (oldAllMaps[newRowid]) {
|
|
12760
13225
|
isSelfToChildStatus = true;
|
|
@@ -12765,7 +13230,7 @@ const Methods = {
|
|
|
12765
13230
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
12766
13231
|
});
|
|
12767
13232
|
}
|
|
12768
|
-
return;
|
|
13233
|
+
return errRest;
|
|
12769
13234
|
}
|
|
12770
13235
|
}
|
|
12771
13236
|
} else {
|
|
@@ -12823,26 +13288,34 @@ const Methods = {
|
|
|
12823
13288
|
if (reactData.scrollYLoad) {
|
|
12824
13289
|
$xeTable.updateScrollYSpace();
|
|
12825
13290
|
}
|
|
12826
|
-
|
|
13291
|
+
if (evnt) {
|
|
13292
|
+
$xeTable.dispatchEvent('row-dragend', {
|
|
13293
|
+
oldRow: dragRow,
|
|
13294
|
+
newRow: prevDragRow,
|
|
13295
|
+
dragRow,
|
|
13296
|
+
dragPos: prevDragPos,
|
|
13297
|
+
dragToChild: isDragToChildFlag,
|
|
13298
|
+
offsetIndex: dragOffsetIndex,
|
|
13299
|
+
_index: {
|
|
13300
|
+
newIndex: nafIndex,
|
|
13301
|
+
oldIndex: oafIndex
|
|
13302
|
+
}
|
|
13303
|
+
}, evnt);
|
|
13304
|
+
}
|
|
13305
|
+
return $xeTable.$nextTick().then(() => {
|
|
12827
13306
|
$xeTable.updateCellAreas();
|
|
12828
13307
|
$xeTable.recalculate();
|
|
13308
|
+
}).then(() => {
|
|
13309
|
+
return {
|
|
13310
|
+
status: true
|
|
13311
|
+
};
|
|
12829
13312
|
});
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
dragRow,
|
|
12834
|
-
dragPos: prevDragPos,
|
|
12835
|
-
dragToChild: isDragToChildFlag,
|
|
12836
|
-
offsetIndex: dragOffsetIndex,
|
|
12837
|
-
_index: {
|
|
12838
|
-
newIndex: nafIndex,
|
|
12839
|
-
oldIndex: oafIndex
|
|
12840
|
-
}
|
|
12841
|
-
}, evnt);
|
|
12842
|
-
}).catch(() => {});
|
|
13313
|
+
}).catch(() => {
|
|
13314
|
+
return errRest;
|
|
13315
|
+
});
|
|
12843
13316
|
}
|
|
12844
13317
|
}
|
|
12845
|
-
return Promise.resolve();
|
|
13318
|
+
return Promise.resolve(errRest);
|
|
12846
13319
|
},
|
|
12847
13320
|
handleRowDragDragendEvent(evnt) {
|
|
12848
13321
|
const $xeTable = this;
|
|
@@ -13028,6 +13501,9 @@ const Methods = {
|
|
|
13028
13501
|
collectColumn
|
|
13029
13502
|
} = internalData;
|
|
13030
13503
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
13504
|
+
const errRest = {
|
|
13505
|
+
status: false
|
|
13506
|
+
};
|
|
13031
13507
|
if (prevDragCol && dragCol) {
|
|
13032
13508
|
// 判断是否有拖动
|
|
13033
13509
|
if (prevDragCol !== dragCol) {
|
|
@@ -13044,7 +13520,7 @@ const Methods = {
|
|
|
13044
13520
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
13045
13521
|
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
13046
13522
|
if (!status) {
|
|
13047
|
-
return;
|
|
13523
|
+
return errRest;
|
|
13048
13524
|
}
|
|
13049
13525
|
let oafIndex = -1;
|
|
13050
13526
|
let nafIndex = -1;
|
|
@@ -13058,11 +13534,11 @@ const Methods = {
|
|
|
13058
13534
|
if (isPeerDrag && !isCrossDrag) {
|
|
13059
13535
|
if (dragColumn.parentId !== newColumn.parentId) {
|
|
13060
13536
|
// 非同级
|
|
13061
|
-
return;
|
|
13537
|
+
return errRest;
|
|
13062
13538
|
}
|
|
13063
13539
|
} else {
|
|
13064
13540
|
if (!isCrossDrag) {
|
|
13065
|
-
return;
|
|
13541
|
+
return errRest;
|
|
13066
13542
|
}
|
|
13067
13543
|
if (oldAllMaps[newColumn.id]) {
|
|
13068
13544
|
isSelfToChildStatus = true;
|
|
@@ -13073,19 +13549,19 @@ const Methods = {
|
|
|
13073
13549
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
13074
13550
|
});
|
|
13075
13551
|
}
|
|
13076
|
-
return;
|
|
13552
|
+
return errRest;
|
|
13077
13553
|
}
|
|
13078
13554
|
}
|
|
13079
13555
|
}
|
|
13080
13556
|
} else if (dragColumn.parentId) {
|
|
13081
13557
|
// 子到根
|
|
13082
13558
|
if (!isCrossDrag) {
|
|
13083
|
-
return;
|
|
13559
|
+
return errRest;
|
|
13084
13560
|
}
|
|
13085
13561
|
} else if (newColumn.parentId) {
|
|
13086
13562
|
// 根到子
|
|
13087
13563
|
if (!isCrossDrag) {
|
|
13088
|
-
return;
|
|
13564
|
+
return errRest;
|
|
13089
13565
|
}
|
|
13090
13566
|
if (oldAllMaps[newColumn.id]) {
|
|
13091
13567
|
isSelfToChildStatus = true;
|
|
@@ -13096,7 +13572,7 @@ const Methods = {
|
|
|
13096
13572
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
13097
13573
|
});
|
|
13098
13574
|
}
|
|
13099
|
-
return;
|
|
13575
|
+
return errRest;
|
|
13100
13576
|
}
|
|
13101
13577
|
}
|
|
13102
13578
|
} else {
|
|
@@ -13165,25 +13641,32 @@ const Methods = {
|
|
|
13165
13641
|
$xeTable.clearCopyCellArea();
|
|
13166
13642
|
}
|
|
13167
13643
|
}
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13644
|
+
if (evnt) {
|
|
13645
|
+
$xeTable.dispatchEvent('column-dragend', {
|
|
13646
|
+
oldColumn: dragColumn,
|
|
13647
|
+
newColumn,
|
|
13648
|
+
dragColumn,
|
|
13649
|
+
dragPos: prevDragPos,
|
|
13650
|
+
dragToChild: isDragToChildFlag,
|
|
13651
|
+
offsetIndex: dragOffsetIndex,
|
|
13652
|
+
_index: {
|
|
13653
|
+
newIndex: nafIndex,
|
|
13654
|
+
oldIndex: oafIndex
|
|
13655
|
+
}
|
|
13656
|
+
}, evnt);
|
|
13657
|
+
}
|
|
13180
13658
|
if (isSyncColumn) {
|
|
13181
13659
|
$xeTable.handleColDragSwapColumn();
|
|
13182
13660
|
}
|
|
13183
|
-
|
|
13661
|
+
return {
|
|
13662
|
+
status: true
|
|
13663
|
+
};
|
|
13664
|
+
}).catch(() => {
|
|
13665
|
+
return errRest;
|
|
13666
|
+
});
|
|
13184
13667
|
}
|
|
13185
13668
|
}
|
|
13186
|
-
return Promise.resolve();
|
|
13669
|
+
return Promise.resolve(errRest);
|
|
13187
13670
|
},
|
|
13188
13671
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
13189
13672
|
const $xeTable = this;
|
|
@@ -13324,46 +13807,58 @@ const Methods = {
|
|
|
13324
13807
|
setPendingRow(rows, status) {
|
|
13325
13808
|
const $xeTable = this;
|
|
13326
13809
|
const reactData = $xeTable;
|
|
13327
|
-
const
|
|
13810
|
+
const internalData = $xeTable;
|
|
13811
|
+
const {
|
|
13812
|
+
handleGetRowId
|
|
13813
|
+
} = createHandleGetRowId($xeTable);
|
|
13814
|
+
const {
|
|
13815
|
+
pendingRowMaps
|
|
13816
|
+
} = internalData;
|
|
13328
13817
|
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
13329
13818
|
rows = [rows];
|
|
13330
13819
|
}
|
|
13331
13820
|
if (status) {
|
|
13332
13821
|
rows.forEach(row => {
|
|
13333
|
-
const rowid =
|
|
13334
|
-
if (rowid && !
|
|
13335
|
-
|
|
13822
|
+
const rowid = handleGetRowId(row);
|
|
13823
|
+
if (rowid && !pendingRowMaps[rowid]) {
|
|
13824
|
+
pendingRowMaps[rowid] = row;
|
|
13336
13825
|
}
|
|
13337
13826
|
});
|
|
13338
13827
|
} else {
|
|
13339
13828
|
rows.forEach(row => {
|
|
13340
|
-
const rowid =
|
|
13341
|
-
if (rowid &&
|
|
13342
|
-
delete
|
|
13829
|
+
const rowid = handleGetRowId(row);
|
|
13830
|
+
if (rowid && pendingRowMaps[rowid]) {
|
|
13831
|
+
delete pendingRowMaps[rowid];
|
|
13343
13832
|
}
|
|
13344
13833
|
});
|
|
13345
13834
|
}
|
|
13346
|
-
reactData.
|
|
13835
|
+
reactData.pendingRowFlag++;
|
|
13347
13836
|
return $xeTable.$nextTick();
|
|
13348
13837
|
},
|
|
13349
13838
|
togglePendingRow(rows) {
|
|
13350
13839
|
const $xeTable = this;
|
|
13351
13840
|
const reactData = $xeTable;
|
|
13352
|
-
const
|
|
13841
|
+
const internalData = $xeTable;
|
|
13842
|
+
const {
|
|
13843
|
+
handleGetRowId
|
|
13844
|
+
} = createHandleGetRowId($xeTable);
|
|
13845
|
+
const {
|
|
13846
|
+
pendingRowMaps
|
|
13847
|
+
} = internalData;
|
|
13353
13848
|
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
13354
13849
|
rows = [rows];
|
|
13355
13850
|
}
|
|
13356
13851
|
rows.forEach(row => {
|
|
13357
|
-
const rowid =
|
|
13852
|
+
const rowid = handleGetRowId(row);
|
|
13358
13853
|
if (rowid) {
|
|
13359
|
-
if (
|
|
13360
|
-
delete
|
|
13854
|
+
if (pendingRowMaps[rowid]) {
|
|
13855
|
+
delete pendingRowMaps[rowid];
|
|
13361
13856
|
} else {
|
|
13362
|
-
|
|
13857
|
+
pendingRowMaps[rowid] = row;
|
|
13363
13858
|
}
|
|
13364
13859
|
}
|
|
13365
13860
|
});
|
|
13366
|
-
reactData.
|
|
13861
|
+
reactData.pendingRowFlag++;
|
|
13367
13862
|
return $xeTable.$nextTick();
|
|
13368
13863
|
},
|
|
13369
13864
|
hasPendingByRow(row) {
|
|
@@ -13381,13 +13876,10 @@ const Methods = {
|
|
|
13381
13876
|
},
|
|
13382
13877
|
getPendingRecords() {
|
|
13383
13878
|
const $xeTable = this;
|
|
13384
|
-
const reactData = $xeTable;
|
|
13385
13879
|
const internalData = $xeTable;
|
|
13386
13880
|
const {
|
|
13881
|
+
fullAllDataRowIdData,
|
|
13387
13882
|
pendingRowMaps
|
|
13388
|
-
} = reactData;
|
|
13389
|
-
const {
|
|
13390
|
-
fullAllDataRowIdData
|
|
13391
13883
|
} = internalData;
|
|
13392
13884
|
const insertRecords = [];
|
|
13393
13885
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(pendingRowMaps, (row, rowid) => {
|
|
@@ -13398,8 +13890,12 @@ const Methods = {
|
|
|
13398
13890
|
return insertRecords;
|
|
13399
13891
|
},
|
|
13400
13892
|
clearPendingRow() {
|
|
13401
|
-
|
|
13402
|
-
|
|
13893
|
+
const $xeTable = this;
|
|
13894
|
+
const reactData = $xeTable;
|
|
13895
|
+
const internalData = $xeTable;
|
|
13896
|
+
internalData.pendingRowMaps = {};
|
|
13897
|
+
reactData.pendingRowFlag++;
|
|
13898
|
+
return $xeTable.$nextTick();
|
|
13403
13899
|
},
|
|
13404
13900
|
sort(sortConfs, sortOrder) {
|
|
13405
13901
|
const $xeTable = this;
|
|
@@ -13580,9 +14076,11 @@ const Methods = {
|
|
|
13580
14076
|
* @param {Event} evnt 事件
|
|
13581
14077
|
*/
|
|
13582
14078
|
closeFilter() {
|
|
14079
|
+
const $xeTable = this;
|
|
14080
|
+
const reactData = $xeTable;
|
|
13583
14081
|
const {
|
|
13584
14082
|
filterStore
|
|
13585
|
-
} =
|
|
14083
|
+
} = reactData;
|
|
13586
14084
|
const {
|
|
13587
14085
|
column,
|
|
13588
14086
|
visible
|
|
@@ -13594,15 +14092,15 @@ const Methods = {
|
|
|
13594
14092
|
visible: false
|
|
13595
14093
|
});
|
|
13596
14094
|
if (visible) {
|
|
13597
|
-
|
|
14095
|
+
$xeTable.dispatchEvent('filter-visible', {
|
|
13598
14096
|
column,
|
|
13599
14097
|
field: column.field,
|
|
13600
14098
|
property: column.field,
|
|
13601
|
-
filterList:
|
|
14099
|
+
filterList: () => $xeTable.getCheckedFilters(),
|
|
13602
14100
|
visible: false
|
|
13603
14101
|
}, null);
|
|
13604
14102
|
}
|
|
13605
|
-
return
|
|
14103
|
+
return $xeTable.$nextTick();
|
|
13606
14104
|
},
|
|
13607
14105
|
/**
|
|
13608
14106
|
* 判断指定列是否为筛选状态,如果为空则判断所有列
|
|
@@ -13635,11 +14133,9 @@ const Methods = {
|
|
|
13635
14133
|
const $xeTable = this;
|
|
13636
14134
|
const reactData = $xeTable;
|
|
13637
14135
|
const internalData = $xeTable;
|
|
13638
|
-
const rExpandLazyLoadedMaps = {
|
|
13639
|
-
...reactData.rowExpandLazyLoadedMaps
|
|
13640
|
-
};
|
|
13641
14136
|
const {
|
|
13642
|
-
fullAllDataRowIdData
|
|
14137
|
+
fullAllDataRowIdData,
|
|
14138
|
+
rowExpandLazyLoadedMaps
|
|
13643
14139
|
} = internalData;
|
|
13644
14140
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
13645
14141
|
const {
|
|
@@ -13649,9 +14145,9 @@ const Methods = {
|
|
|
13649
14145
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
13650
14146
|
if (lazy && rowRest) {
|
|
13651
14147
|
rowRest.expandLoaded = false;
|
|
13652
|
-
delete
|
|
14148
|
+
delete rowExpandLazyLoadedMaps[rowid];
|
|
13653
14149
|
}
|
|
13654
|
-
reactData.
|
|
14150
|
+
reactData.rowExpandedFlag++;
|
|
13655
14151
|
return $xeTable.$nextTick();
|
|
13656
14152
|
},
|
|
13657
14153
|
/**
|
|
@@ -13659,18 +14155,20 @@ const Methods = {
|
|
|
13659
14155
|
* @param {Row} row 行对象
|
|
13660
14156
|
*/
|
|
13661
14157
|
reloadRowExpand(row) {
|
|
14158
|
+
const $xeTable = this;
|
|
14159
|
+
const internalData = $xeTable;
|
|
13662
14160
|
const {
|
|
13663
|
-
expandOpts,
|
|
13664
14161
|
rowExpandLazyLoadedMaps
|
|
13665
|
-
} =
|
|
14162
|
+
} = internalData;
|
|
14163
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
13666
14164
|
const {
|
|
13667
14165
|
lazy
|
|
13668
14166
|
} = expandOpts;
|
|
13669
14167
|
const rowid = getRowid(this, row);
|
|
13670
14168
|
if (lazy && !rowExpandLazyLoadedMaps[rowid]) {
|
|
13671
|
-
|
|
14169
|
+
$xeTable.clearRowExpandLoaded(row).then(() => handleAsyncRowExpand($xeTable, row));
|
|
13672
14170
|
}
|
|
13673
|
-
return
|
|
14171
|
+
return $xeTable.$nextTick();
|
|
13674
14172
|
},
|
|
13675
14173
|
reloadExpandContent(row) {
|
|
13676
14174
|
if (true) {
|
|
@@ -13683,11 +14181,16 @@ const Methods = {
|
|
|
13683
14181
|
* 展开行事件
|
|
13684
14182
|
*/
|
|
13685
14183
|
triggerRowExpandEvent(evnt, params) {
|
|
14184
|
+
const $xeTable = this;
|
|
14185
|
+
const reactData = $xeTable;
|
|
14186
|
+
const internalData = $xeTable;
|
|
13686
14187
|
const {
|
|
13687
|
-
expandOpts,
|
|
13688
|
-
rowExpandLazyLoadedMaps,
|
|
13689
14188
|
expandColumn: column
|
|
13690
|
-
} =
|
|
14189
|
+
} = reactData;
|
|
14190
|
+
const {
|
|
14191
|
+
rowExpandLazyLoadedMaps
|
|
14192
|
+
} = internalData;
|
|
14193
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
13691
14194
|
const {
|
|
13692
14195
|
row
|
|
13693
14196
|
} = params;
|
|
@@ -13699,20 +14202,20 @@ const Methods = {
|
|
|
13699
14202
|
return;
|
|
13700
14203
|
}
|
|
13701
14204
|
evnt.stopPropagation();
|
|
13702
|
-
const rowid = getRowid(
|
|
14205
|
+
const rowid = getRowid($xeTable, row);
|
|
13703
14206
|
if (!lazy || !rowExpandLazyLoadedMaps[rowid]) {
|
|
13704
|
-
const expanded =
|
|
13705
|
-
const columnIndex =
|
|
13706
|
-
const $columnIndex =
|
|
13707
|
-
|
|
13708
|
-
|
|
14207
|
+
const expanded = !$xeTable.isRowExpandByRow(row);
|
|
14208
|
+
const columnIndex = $xeTable.getColumnIndex(column);
|
|
14209
|
+
const $columnIndex = $xeTable.getVMColumnIndex(column);
|
|
14210
|
+
$xeTable.setRowExpand(row, expanded);
|
|
14211
|
+
$xeTable.dispatchEvent('toggle-row-expand', {
|
|
13709
14212
|
expanded,
|
|
13710
14213
|
column,
|
|
13711
14214
|
columnIndex,
|
|
13712
14215
|
$columnIndex,
|
|
13713
14216
|
row,
|
|
13714
|
-
rowIndex:
|
|
13715
|
-
$rowIndex:
|
|
14217
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
14218
|
+
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
13716
14219
|
}, evnt);
|
|
13717
14220
|
}
|
|
13718
14221
|
},
|
|
@@ -13770,61 +14273,6 @@ const Methods = {
|
|
|
13770
14273
|
}
|
|
13771
14274
|
return this.setRowExpand(expandedRows, expanded);
|
|
13772
14275
|
},
|
|
13773
|
-
handleAsyncRowExpand(row) {
|
|
13774
|
-
const $xeTable = this;
|
|
13775
|
-
const reactData = $xeTable;
|
|
13776
|
-
const internalData = $xeTable;
|
|
13777
|
-
return new Promise(resolve => {
|
|
13778
|
-
const {
|
|
13779
|
-
expandOpts
|
|
13780
|
-
} = this;
|
|
13781
|
-
const {
|
|
13782
|
-
loadMethod
|
|
13783
|
-
} = expandOpts;
|
|
13784
|
-
if (loadMethod) {
|
|
13785
|
-
const {
|
|
13786
|
-
fullAllDataRowIdData
|
|
13787
|
-
} = internalData;
|
|
13788
|
-
const rExpandLazyLoadedMaps = {
|
|
13789
|
-
...reactData.rowExpandLazyLoadedMaps
|
|
13790
|
-
};
|
|
13791
|
-
const rowid = getRowid($xeTable, row);
|
|
13792
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
13793
|
-
rExpandLazyLoadedMaps[rowid] = row;
|
|
13794
|
-
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
|
|
13795
|
-
loadMethod({
|
|
13796
|
-
$table: $xeTable,
|
|
13797
|
-
row,
|
|
13798
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
13799
|
-
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
13800
|
-
}).then(() => {
|
|
13801
|
-
const rExpandedMaps = {
|
|
13802
|
-
...reactData.rowExpandedMaps
|
|
13803
|
-
};
|
|
13804
|
-
if (rowRest) {
|
|
13805
|
-
rowRest.expandLoaded = true;
|
|
13806
|
-
}
|
|
13807
|
-
rExpandedMaps[rowid] = row;
|
|
13808
|
-
reactData.rowExpandedMaps = rExpandedMaps;
|
|
13809
|
-
}).catch(() => {
|
|
13810
|
-
if (rowRest) {
|
|
13811
|
-
rowRest.expandLoaded = false;
|
|
13812
|
-
}
|
|
13813
|
-
}).finally(() => {
|
|
13814
|
-
const rExpandLazyLoadedMaps = {
|
|
13815
|
-
...reactData.rowExpandLazyLoadedMaps
|
|
13816
|
-
};
|
|
13817
|
-
if (rExpandLazyLoadedMaps[rowid]) {
|
|
13818
|
-
delete rExpandLazyLoadedMaps[rowid];
|
|
13819
|
-
}
|
|
13820
|
-
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
|
|
13821
|
-
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas()).then(() => resolve());
|
|
13822
|
-
});
|
|
13823
|
-
} else {
|
|
13824
|
-
resolve();
|
|
13825
|
-
}
|
|
13826
|
-
});
|
|
13827
|
-
},
|
|
13828
14276
|
/**
|
|
13829
14277
|
* 设置展开行,二个参数设置这一行展开与否
|
|
13830
14278
|
* 支持单行
|
|
@@ -13834,16 +14282,20 @@ const Methods = {
|
|
|
13834
14282
|
*/
|
|
13835
14283
|
setRowExpand(rows, expanded) {
|
|
13836
14284
|
const $xeTable = this;
|
|
14285
|
+
const reactData = $xeTable;
|
|
14286
|
+
const internalData = $xeTable;
|
|
13837
14287
|
const {
|
|
13838
|
-
rowExpandedMaps,
|
|
13839
|
-
fullAllDataRowIdData,
|
|
13840
|
-
rowExpandLazyLoadedMaps,
|
|
13841
|
-
expandOpts,
|
|
13842
14288
|
expandColumn
|
|
13843
|
-
} =
|
|
13844
|
-
let
|
|
13845
|
-
|
|
13846
|
-
|
|
14289
|
+
} = reactData;
|
|
14290
|
+
let {
|
|
14291
|
+
fullAllDataRowIdData,
|
|
14292
|
+
rowExpandedMaps,
|
|
14293
|
+
rowExpandLazyLoadedMaps
|
|
14294
|
+
} = internalData;
|
|
14295
|
+
const {
|
|
14296
|
+
handleGetRowId
|
|
14297
|
+
} = createHandleGetRowId($xeTable);
|
|
14298
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
13847
14299
|
const {
|
|
13848
14300
|
reserve,
|
|
13849
14301
|
lazy,
|
|
@@ -13859,10 +14311,12 @@ const Methods = {
|
|
|
13859
14311
|
}
|
|
13860
14312
|
if (accordion) {
|
|
13861
14313
|
// 只能同时展开一个
|
|
13862
|
-
|
|
14314
|
+
rowExpandedMaps = {};
|
|
14315
|
+
internalData.rowExpandedMaps = rowExpandedMaps;
|
|
13863
14316
|
rows = rows.slice(rows.length - 1, rows.length);
|
|
13864
14317
|
}
|
|
13865
14318
|
const validRows = toggleMethod ? rows.filter(row => toggleMethod({
|
|
14319
|
+
$table: $xeTable,
|
|
13866
14320
|
expanded,
|
|
13867
14321
|
column: expandColumn,
|
|
13868
14322
|
columnIndex,
|
|
@@ -13873,22 +14327,22 @@ const Methods = {
|
|
|
13873
14327
|
})) : rows;
|
|
13874
14328
|
if (expanded) {
|
|
13875
14329
|
validRows.forEach(row => {
|
|
13876
|
-
const rowid =
|
|
13877
|
-
if (!
|
|
14330
|
+
const rowid = handleGetRowId(row);
|
|
14331
|
+
if (!rowExpandedMaps[rowid]) {
|
|
13878
14332
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
13879
14333
|
const isLoad = lazy && !rowRest.expandLoaded && !rowExpandLazyLoadedMaps[rowid];
|
|
13880
14334
|
if (isLoad) {
|
|
13881
|
-
lazyRests.push(
|
|
14335
|
+
lazyRests.push(handleAsyncRowExpand($xeTable, row));
|
|
13882
14336
|
} else {
|
|
13883
|
-
|
|
14337
|
+
rowExpandedMaps[rowid] = row;
|
|
13884
14338
|
}
|
|
13885
14339
|
}
|
|
13886
14340
|
});
|
|
13887
14341
|
} else {
|
|
13888
14342
|
validRows.forEach(item => {
|
|
13889
|
-
const rowid =
|
|
13890
|
-
if (
|
|
13891
|
-
delete
|
|
14343
|
+
const rowid = handleGetRowId(item);
|
|
14344
|
+
if (rowExpandedMaps[rowid]) {
|
|
14345
|
+
delete rowExpandedMaps[rowid];
|
|
13892
14346
|
}
|
|
13893
14347
|
});
|
|
13894
14348
|
}
|
|
@@ -13896,7 +14350,7 @@ const Methods = {
|
|
|
13896
14350
|
validRows.forEach(row => handleRowExpandReserve($xeTable, row, expanded));
|
|
13897
14351
|
}
|
|
13898
14352
|
}
|
|
13899
|
-
|
|
14353
|
+
reactData.rowExpandedFlag++;
|
|
13900
14354
|
return Promise.all(lazyRests).then(() => $xeTable.$nextTick()).then(() => $xeTable.recalculate(true)).then(() => {
|
|
13901
14355
|
updateRowOffsetTop($xeTable);
|
|
13902
14356
|
updateRowExpandStyle($xeTable);
|
|
@@ -13909,11 +14363,17 @@ const Methods = {
|
|
|
13909
14363
|
* @param {Row} row 行对象
|
|
13910
14364
|
*/
|
|
13911
14365
|
isRowExpandByRow(row) {
|
|
14366
|
+
const $xeTable = this;
|
|
14367
|
+
const reactData = $xeTable;
|
|
14368
|
+
const internalData = $xeTable;
|
|
14369
|
+
const {
|
|
14370
|
+
rowExpandedFlag
|
|
14371
|
+
} = reactData;
|
|
13912
14372
|
const {
|
|
13913
14373
|
rowExpandedMaps
|
|
13914
|
-
} =
|
|
14374
|
+
} = internalData;
|
|
13915
14375
|
const rowid = getRowid(this, row);
|
|
13916
|
-
return !!rowExpandedMaps[rowid];
|
|
14376
|
+
return !!rowExpandedFlag && !!rowExpandedMaps[rowid];
|
|
13917
14377
|
},
|
|
13918
14378
|
isExpandByRow(row) {
|
|
13919
14379
|
if (true) {
|
|
@@ -13937,7 +14397,8 @@ const Methods = {
|
|
|
13937
14397
|
reserve
|
|
13938
14398
|
} = expandOpts;
|
|
13939
14399
|
const expList = $xeTable.getRowExpandRecords();
|
|
13940
|
-
|
|
14400
|
+
internalData.rowExpandedMaps = {};
|
|
14401
|
+
reactData.rowExpandedFlag++;
|
|
13941
14402
|
if (reserve) {
|
|
13942
14403
|
tableFullData.forEach(row => handleRowExpandReserve($xeTable, row, false));
|
|
13943
14404
|
}
|
|
@@ -13957,8 +14418,10 @@ const Methods = {
|
|
|
13957
14418
|
return this.$nextTick();
|
|
13958
14419
|
},
|
|
13959
14420
|
getRowExpandRecords() {
|
|
14421
|
+
const $xeTable = this;
|
|
14422
|
+
const internalData = $xeTable;
|
|
13960
14423
|
const rest = [];
|
|
13961
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(
|
|
14424
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.rowExpandedMaps, item => {
|
|
13962
14425
|
if (item) {
|
|
13963
14426
|
rest.push(item);
|
|
13964
14427
|
}
|
|
@@ -13966,8 +14429,10 @@ const Methods = {
|
|
|
13966
14429
|
return rest;
|
|
13967
14430
|
},
|
|
13968
14431
|
getTreeExpandRecords() {
|
|
14432
|
+
const $xeTable = this;
|
|
14433
|
+
const internalData = $xeTable;
|
|
13969
14434
|
const rest = [];
|
|
13970
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(
|
|
14435
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.treeExpandedMaps, item => {
|
|
13971
14436
|
if (item) {
|
|
13972
14437
|
rest.push(item);
|
|
13973
14438
|
}
|
|
@@ -14003,17 +14468,14 @@ const Methods = {
|
|
|
14003
14468
|
const reactData = $xeTable;
|
|
14004
14469
|
const internalData = $xeTable;
|
|
14005
14470
|
const {
|
|
14006
|
-
fullAllDataRowIdData
|
|
14471
|
+
fullAllDataRowIdData,
|
|
14472
|
+
treeExpandedMaps
|
|
14007
14473
|
} = internalData;
|
|
14008
14474
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
14009
14475
|
const {
|
|
14010
14476
|
transform
|
|
14011
14477
|
} = treeOpts;
|
|
14012
|
-
let tExpandedMaps = {};
|
|
14013
14478
|
if (rows) {
|
|
14014
|
-
tExpandedMaps = {
|
|
14015
|
-
...reactData.treeExpandedMaps
|
|
14016
|
-
};
|
|
14017
14479
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
14018
14480
|
rows = [rows];
|
|
14019
14481
|
}
|
|
@@ -14022,8 +14484,8 @@ const Methods = {
|
|
|
14022
14484
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
14023
14485
|
if (rowRest) {
|
|
14024
14486
|
rowRest.treeLoaded = false;
|
|
14025
|
-
if (
|
|
14026
|
-
delete
|
|
14487
|
+
if (treeExpandedMaps[rowid]) {
|
|
14488
|
+
delete treeExpandedMaps[rowid];
|
|
14027
14489
|
}
|
|
14028
14490
|
}
|
|
14029
14491
|
});
|
|
@@ -14032,7 +14494,8 @@ const Methods = {
|
|
|
14032
14494
|
rowRest.treeLoaded = false;
|
|
14033
14495
|
});
|
|
14034
14496
|
}
|
|
14035
|
-
|
|
14497
|
+
internalData.treeExpandedMaps = {};
|
|
14498
|
+
reactData.treeExpandedFlag++;
|
|
14036
14499
|
if (transform) {
|
|
14037
14500
|
handleVirtualTreeToList($xeTable);
|
|
14038
14501
|
return $xeTable.handleTableData();
|
|
@@ -14045,45 +14508,49 @@ const Methods = {
|
|
|
14045
14508
|
*/
|
|
14046
14509
|
reloadTreeExpand(row) {
|
|
14047
14510
|
const $xeTable = this;
|
|
14511
|
+
const internalData = $xeTable;
|
|
14048
14512
|
const {
|
|
14049
|
-
treeOpts,
|
|
14050
14513
|
treeExpandLazyLoadedMaps
|
|
14051
|
-
} =
|
|
14514
|
+
} = internalData;
|
|
14515
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
14052
14516
|
const {
|
|
14053
14517
|
transform,
|
|
14054
14518
|
lazy
|
|
14055
14519
|
} = treeOpts;
|
|
14056
14520
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
14057
|
-
const rowid = getRowid(
|
|
14521
|
+
const rowid = getRowid($xeTable, row);
|
|
14058
14522
|
if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
|
|
14059
|
-
return
|
|
14060
|
-
return
|
|
14523
|
+
return $xeTable.clearTreeExpandLoaded(row).then(() => {
|
|
14524
|
+
return handleAsyncTreeExpandChilds($xeTable, row);
|
|
14061
14525
|
}).then(() => {
|
|
14062
14526
|
if (transform) {
|
|
14063
14527
|
handleVirtualTreeToList($xeTable);
|
|
14064
|
-
return
|
|
14528
|
+
return $xeTable.handleTableData();
|
|
14065
14529
|
}
|
|
14066
14530
|
}).then(() => {
|
|
14067
|
-
return
|
|
14531
|
+
return $xeTable.recalculate();
|
|
14068
14532
|
});
|
|
14069
14533
|
}
|
|
14070
|
-
return
|
|
14534
|
+
return $xeTable.$nextTick();
|
|
14071
14535
|
},
|
|
14072
14536
|
reloadTreeChilds(row) {
|
|
14537
|
+
const $xeTable = this;
|
|
14073
14538
|
if (true) {
|
|
14074
14539
|
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
|
|
14075
14540
|
}
|
|
14076
14541
|
// 即将废弃
|
|
14077
|
-
return
|
|
14542
|
+
return $xeTable.reloadTreeExpand(row);
|
|
14078
14543
|
},
|
|
14079
14544
|
/**
|
|
14080
14545
|
* 展开树节点事件
|
|
14081
14546
|
*/
|
|
14082
14547
|
triggerTreeExpandEvent(evnt, params) {
|
|
14548
|
+
const $xeTable = this;
|
|
14549
|
+
const internalData = $xeTable;
|
|
14083
14550
|
const {
|
|
14084
|
-
treeOpts,
|
|
14085
14551
|
treeExpandLazyLoadedMaps
|
|
14086
|
-
} =
|
|
14552
|
+
} = internalData;
|
|
14553
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
14087
14554
|
const {
|
|
14088
14555
|
row,
|
|
14089
14556
|
column
|
|
@@ -14098,11 +14565,11 @@ const Methods = {
|
|
|
14098
14565
|
evnt.stopPropagation();
|
|
14099
14566
|
const rowid = getRowid(this, row);
|
|
14100
14567
|
if (!lazy || !treeExpandLazyLoadedMaps[rowid]) {
|
|
14101
|
-
const expanded =
|
|
14102
|
-
const columnIndex =
|
|
14103
|
-
const $columnIndex =
|
|
14104
|
-
|
|
14105
|
-
|
|
14568
|
+
const expanded = !$xeTable.isTreeExpandByRow(row);
|
|
14569
|
+
const columnIndex = $xeTable.getColumnIndex(column);
|
|
14570
|
+
const $columnIndex = $xeTable.getVMColumnIndex(column);
|
|
14571
|
+
$xeTable.setTreeExpand(row, expanded);
|
|
14572
|
+
$xeTable.dispatchEvent('toggle-tree-expand', {
|
|
14106
14573
|
expanded,
|
|
14107
14574
|
column,
|
|
14108
14575
|
columnIndex,
|
|
@@ -14117,112 +14584,6 @@ const Methods = {
|
|
|
14117
14584
|
toggleTreeExpand(row) {
|
|
14118
14585
|
return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
|
|
14119
14586
|
},
|
|
14120
|
-
/**
|
|
14121
|
-
* 处理默认展开树节点
|
|
14122
|
-
*/
|
|
14123
|
-
handleDefaultTreeExpand() {
|
|
14124
|
-
const {
|
|
14125
|
-
treeConfig,
|
|
14126
|
-
treeOpts,
|
|
14127
|
-
tableFullData
|
|
14128
|
-
} = this;
|
|
14129
|
-
if (treeConfig) {
|
|
14130
|
-
const {
|
|
14131
|
-
expandAll,
|
|
14132
|
-
expandRowKeys
|
|
14133
|
-
} = treeOpts;
|
|
14134
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
14135
|
-
if (expandAll) {
|
|
14136
|
-
this.setAllTreeExpand(true);
|
|
14137
|
-
} else if (expandRowKeys) {
|
|
14138
|
-
const defExpandeds = [];
|
|
14139
|
-
const rowkey = getRowkey(this);
|
|
14140
|
-
expandRowKeys.forEach(rowid => {
|
|
14141
|
-
const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullData, item => rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, rowkey), {
|
|
14142
|
-
children: childrenField
|
|
14143
|
-
});
|
|
14144
|
-
if (matchObj) {
|
|
14145
|
-
defExpandeds.push(matchObj.item);
|
|
14146
|
-
}
|
|
14147
|
-
});
|
|
14148
|
-
this.setTreeExpand(defExpandeds, true);
|
|
14149
|
-
}
|
|
14150
|
-
}
|
|
14151
|
-
},
|
|
14152
|
-
handleAsyncTreeExpandChilds(row) {
|
|
14153
|
-
const $xeTable = this;
|
|
14154
|
-
const {
|
|
14155
|
-
treeOpts,
|
|
14156
|
-
checkboxOpts
|
|
14157
|
-
} = this;
|
|
14158
|
-
const {
|
|
14159
|
-
transform,
|
|
14160
|
-
loadMethod
|
|
14161
|
-
} = treeOpts;
|
|
14162
|
-
const {
|
|
14163
|
-
checkStrictly
|
|
14164
|
-
} = checkboxOpts;
|
|
14165
|
-
return new Promise(resolve => {
|
|
14166
|
-
if (loadMethod) {
|
|
14167
|
-
const {
|
|
14168
|
-
treeExpandLazyLoadedMaps,
|
|
14169
|
-
fullAllDataRowIdData
|
|
14170
|
-
} = this;
|
|
14171
|
-
const rowid = getRowid($xeTable, row);
|
|
14172
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
14173
|
-
treeExpandLazyLoadedMaps[rowid] = row;
|
|
14174
|
-
Promise.resolve(loadMethod({
|
|
14175
|
-
$table: $xeTable,
|
|
14176
|
-
row
|
|
14177
|
-
})).then(childRecords => {
|
|
14178
|
-
if (rowRest) {
|
|
14179
|
-
rowRest.treeLoaded = true;
|
|
14180
|
-
}
|
|
14181
|
-
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
14182
|
-
delete treeExpandLazyLoadedMaps[rowid];
|
|
14183
|
-
}
|
|
14184
|
-
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(childRecords)) {
|
|
14185
|
-
childRecords = [];
|
|
14186
|
-
}
|
|
14187
|
-
if (childRecords) {
|
|
14188
|
-
return this.loadTreeChildren(row, childRecords).then(childRows => {
|
|
14189
|
-
const {
|
|
14190
|
-
treeExpandedMaps
|
|
14191
|
-
} = this;
|
|
14192
|
-
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
14193
|
-
treeExpandedMaps[rowid] = row;
|
|
14194
|
-
}
|
|
14195
|
-
// 如果当前节点已选中,则展开后子节点也被选中
|
|
14196
|
-
if (!checkStrictly && this.isCheckedByCheckboxRow(row)) {
|
|
14197
|
-
handleCheckedCheckboxRow($xeTable, childRows, true);
|
|
14198
|
-
}
|
|
14199
|
-
return this.$nextTick().then(() => {
|
|
14200
|
-
if (transform) {
|
|
14201
|
-
this.handleTableData();
|
|
14202
|
-
updateAfterDataIndex($xeTable);
|
|
14203
|
-
return this.$nextTick();
|
|
14204
|
-
}
|
|
14205
|
-
});
|
|
14206
|
-
});
|
|
14207
|
-
}
|
|
14208
|
-
}).catch(() => {
|
|
14209
|
-
const {
|
|
14210
|
-
treeExpandLazyLoadedMaps
|
|
14211
|
-
} = this;
|
|
14212
|
-
if (rowRest) {
|
|
14213
|
-
rowRest.treeLoaded = false;
|
|
14214
|
-
}
|
|
14215
|
-
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
14216
|
-
delete treeExpandLazyLoadedMaps[rowid];
|
|
14217
|
-
}
|
|
14218
|
-
}).finally(() => {
|
|
14219
|
-
this.$nextTick().then(() => this.recalculate()).then(() => resolve());
|
|
14220
|
-
});
|
|
14221
|
-
} else {
|
|
14222
|
-
resolve();
|
|
14223
|
-
}
|
|
14224
|
-
});
|
|
14225
|
-
},
|
|
14226
14587
|
/**
|
|
14227
14588
|
* 设置所有树节点的展开与否
|
|
14228
14589
|
* @param {Boolean} expanded 是否展开
|
|
@@ -14254,29 +14615,35 @@ const Methods = {
|
|
|
14254
14615
|
* @returns
|
|
14255
14616
|
*/
|
|
14256
14617
|
handleBaseTreeExpand(rows, expanded) {
|
|
14618
|
+
const $xeTable = this;
|
|
14619
|
+
const reactData = $xeTable;
|
|
14620
|
+
const internalData = $xeTable;
|
|
14621
|
+
const {
|
|
14622
|
+
treeNodeColumn
|
|
14623
|
+
} = reactData;
|
|
14257
14624
|
const {
|
|
14258
14625
|
fullAllDataRowIdData,
|
|
14259
14626
|
tableFullData,
|
|
14260
14627
|
treeExpandedMaps,
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
} = this;
|
|
14628
|
+
treeExpandLazyLoadedMaps
|
|
14629
|
+
} = internalData;
|
|
14630
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
14265
14631
|
const {
|
|
14266
14632
|
reserve,
|
|
14267
14633
|
lazy,
|
|
14268
14634
|
accordion,
|
|
14269
14635
|
toggleMethod
|
|
14270
14636
|
} = treeOpts;
|
|
14271
|
-
const treeTempExpandedMaps = {
|
|
14272
|
-
...treeExpandedMaps
|
|
14273
|
-
};
|
|
14274
14637
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
14275
14638
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
14276
14639
|
const result = [];
|
|
14277
|
-
const columnIndex =
|
|
14278
|
-
const $columnIndex =
|
|
14640
|
+
const columnIndex = $xeTable.getColumnIndex(treeNodeColumn);
|
|
14641
|
+
const $columnIndex = $xeTable.getVMColumnIndex(treeNodeColumn);
|
|
14642
|
+
const {
|
|
14643
|
+
handleGetRowId
|
|
14644
|
+
} = createHandleGetRowId($xeTable);
|
|
14279
14645
|
let validRows = toggleMethod ? rows.filter(row => toggleMethod({
|
|
14646
|
+
$table: $xeTable,
|
|
14280
14647
|
expanded,
|
|
14281
14648
|
column: treeNodeColumn,
|
|
14282
14649
|
columnIndex,
|
|
@@ -14291,26 +14658,26 @@ const Methods = {
|
|
|
14291
14658
|
});
|
|
14292
14659
|
if (matchObj) {
|
|
14293
14660
|
matchObj.items.forEach(item => {
|
|
14294
|
-
const rowid =
|
|
14295
|
-
if (
|
|
14296
|
-
delete
|
|
14661
|
+
const rowid = handleGetRowId(item);
|
|
14662
|
+
if (treeExpandedMaps[rowid]) {
|
|
14663
|
+
delete treeExpandedMaps[rowid];
|
|
14297
14664
|
}
|
|
14298
14665
|
});
|
|
14299
14666
|
}
|
|
14300
14667
|
}
|
|
14301
14668
|
if (expanded) {
|
|
14302
14669
|
validRows.forEach(row => {
|
|
14303
|
-
const rowid =
|
|
14304
|
-
if (!
|
|
14670
|
+
const rowid = handleGetRowId(row);
|
|
14671
|
+
if (!treeExpandedMaps[rowid]) {
|
|
14305
14672
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
14306
14673
|
if (rowRest) {
|
|
14307
14674
|
const isLoad = lazy && row[hasChildField] && !rowRest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
|
|
14308
14675
|
// 是否使用懒加载
|
|
14309
14676
|
if (isLoad) {
|
|
14310
|
-
result.push(
|
|
14677
|
+
result.push(handleAsyncTreeExpandChilds($xeTable, row));
|
|
14311
14678
|
} else {
|
|
14312
14679
|
if (row[childrenField] && row[childrenField].length) {
|
|
14313
|
-
|
|
14680
|
+
treeExpandedMaps[rowid] = row;
|
|
14314
14681
|
}
|
|
14315
14682
|
}
|
|
14316
14683
|
}
|
|
@@ -14318,18 +14685,18 @@ const Methods = {
|
|
|
14318
14685
|
});
|
|
14319
14686
|
} else {
|
|
14320
14687
|
validRows.forEach(item => {
|
|
14321
|
-
const rowid =
|
|
14322
|
-
if (
|
|
14323
|
-
delete
|
|
14688
|
+
const rowid = handleGetRowId(item);
|
|
14689
|
+
if (treeExpandedMaps[rowid]) {
|
|
14690
|
+
delete treeExpandedMaps[rowid];
|
|
14324
14691
|
}
|
|
14325
14692
|
});
|
|
14326
14693
|
}
|
|
14327
14694
|
if (reserve) {
|
|
14328
|
-
validRows.forEach(row =>
|
|
14695
|
+
validRows.forEach(row => handleTreeExpandReserve($xeTable, row, expanded));
|
|
14329
14696
|
}
|
|
14330
|
-
|
|
14697
|
+
reactData.treeExpandedFlag++;
|
|
14331
14698
|
return Promise.all(result).then(() => {
|
|
14332
|
-
return
|
|
14699
|
+
return $xeTable.recalculate();
|
|
14333
14700
|
});
|
|
14334
14701
|
},
|
|
14335
14702
|
/**
|
|
@@ -14386,40 +14753,49 @@ const Methods = {
|
|
|
14386
14753
|
* @param {Row} row 行对象
|
|
14387
14754
|
*/
|
|
14388
14755
|
isTreeExpandByRow(row) {
|
|
14756
|
+
const $xeTable = this;
|
|
14757
|
+
const reactData = $xeTable;
|
|
14758
|
+
const internalData = $xeTable;
|
|
14759
|
+
const {
|
|
14760
|
+
treeExpandedFlag
|
|
14761
|
+
} = reactData;
|
|
14389
14762
|
const {
|
|
14390
14763
|
treeExpandedMaps
|
|
14391
|
-
} =
|
|
14392
|
-
return !!treeExpandedMaps[getRowid(
|
|
14764
|
+
} = internalData;
|
|
14765
|
+
return !!treeExpandedFlag && !!treeExpandedMaps[getRowid($xeTable, row)];
|
|
14393
14766
|
},
|
|
14394
14767
|
/**
|
|
14395
14768
|
* 手动清空树形节点的展开状态,数据会恢复成未展开的状态
|
|
14396
14769
|
*/
|
|
14397
14770
|
clearTreeExpand() {
|
|
14398
14771
|
const $xeTable = this;
|
|
14772
|
+
const reactData = $xeTable;
|
|
14773
|
+
const internalData = $xeTable;
|
|
14399
14774
|
const {
|
|
14400
|
-
|
|
14401
|
-
|
|
14402
|
-
|
|
14775
|
+
tableFullTreeData
|
|
14776
|
+
} = internalData;
|
|
14777
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
14778
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
14403
14779
|
const {
|
|
14404
14780
|
transform,
|
|
14405
14781
|
reserve
|
|
14406
14782
|
} = treeOpts;
|
|
14407
|
-
const
|
|
14408
|
-
|
|
14409
|
-
|
|
14783
|
+
const expList = $xeTable.getTreeExpandRecords();
|
|
14784
|
+
internalData.treeExpandedMaps = {};
|
|
14785
|
+
reactData.treeExpandedFlag++;
|
|
14410
14786
|
if (reserve) {
|
|
14411
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(
|
|
14787
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, row => handleTreeExpandReserve($xeTable, row, false), {
|
|
14412
14788
|
children: childrenField
|
|
14413
14789
|
});
|
|
14414
14790
|
}
|
|
14415
|
-
return
|
|
14791
|
+
return $xeTable.handleTableData().then(() => {
|
|
14416
14792
|
if (transform) {
|
|
14417
14793
|
handleVirtualTreeToList($xeTable);
|
|
14418
|
-
return
|
|
14794
|
+
return $xeTable.handleTableData();
|
|
14419
14795
|
}
|
|
14420
14796
|
}).then(() => {
|
|
14421
14797
|
if (expList.length) {
|
|
14422
|
-
|
|
14798
|
+
$xeTable.recalculate();
|
|
14423
14799
|
}
|
|
14424
14800
|
});
|
|
14425
14801
|
},
|
|
@@ -14427,20 +14803,6 @@ const Methods = {
|
|
|
14427
14803
|
this.treeExpandedReserveRowMap = {};
|
|
14428
14804
|
return this.$nextTick();
|
|
14429
14805
|
},
|
|
14430
|
-
handleTreeExpandReserve(row, expanded) {
|
|
14431
|
-
const {
|
|
14432
|
-
treeExpandedReserveRowMap,
|
|
14433
|
-
treeOpts
|
|
14434
|
-
} = this;
|
|
14435
|
-
if (treeOpts.reserve) {
|
|
14436
|
-
const rowid = getRowid(this, row);
|
|
14437
|
-
if (expanded) {
|
|
14438
|
-
treeExpandedReserveRowMap[rowid] = row;
|
|
14439
|
-
} else if (treeExpandedReserveRowMap[rowid]) {
|
|
14440
|
-
delete treeExpandedReserveRowMap[rowid];
|
|
14441
|
-
}
|
|
14442
|
-
}
|
|
14443
|
-
},
|
|
14444
14806
|
/**
|
|
14445
14807
|
* 获取表格的滚动状态
|
|
14446
14808
|
*/
|
|
@@ -14807,11 +15169,12 @@ const Methods = {
|
|
|
14807
15169
|
} = tableProps;
|
|
14808
15170
|
const {
|
|
14809
15171
|
scrollXLoad,
|
|
14810
|
-
scrollYLoad
|
|
15172
|
+
scrollYLoad,
|
|
15173
|
+
expandColumn
|
|
14811
15174
|
} = reactData;
|
|
14812
15175
|
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
14813
15176
|
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
14814
|
-
if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
|
|
15177
|
+
if (!(scrollYLoad || leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
14815
15178
|
return;
|
|
14816
15179
|
}
|
|
14817
15180
|
const {
|
|
@@ -15103,15 +15466,15 @@ const Methods = {
|
|
|
15103
15466
|
const {
|
|
15104
15467
|
isAllOverflow,
|
|
15105
15468
|
scrollYLoad,
|
|
15106
|
-
expandColumn
|
|
15107
|
-
rowExpandedMaps
|
|
15469
|
+
expandColumn
|
|
15108
15470
|
} = reactData;
|
|
15109
15471
|
const {
|
|
15110
15472
|
scrollYStore,
|
|
15111
15473
|
elemStore,
|
|
15112
15474
|
isResizeCellHeight,
|
|
15113
15475
|
afterFullData,
|
|
15114
|
-
fullAllDataRowIdData
|
|
15476
|
+
fullAllDataRowIdData,
|
|
15477
|
+
rowExpandedMaps
|
|
15115
15478
|
} = internalData;
|
|
15116
15479
|
const {
|
|
15117
15480
|
startIndex
|
|
@@ -15468,7 +15831,7 @@ const Methods = {
|
|
|
15468
15831
|
if (this.footerSpanMethod) {
|
|
15469
15832
|
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
15470
15833
|
}
|
|
15471
|
-
setMerges(this, merges, this.mergeFooterList
|
|
15834
|
+
setMerges(this, merges, this.mergeFooterList);
|
|
15472
15835
|
return this.$nextTick().then(() => {
|
|
15473
15836
|
this.updateCellAreas();
|
|
15474
15837
|
return updateStyle($xeTable);
|
|
@@ -15634,7 +15997,7 @@ const isVMScrollProcess = $xeTable => {
|
|
|
15634
15997
|
} = tableReactData;
|
|
15635
15998
|
return !!(isDragResize || lastScrollTime && Date.now() < lastScrollTime + delayHover);
|
|
15636
15999
|
};
|
|
15637
|
-
function renderLine(h, _vm, params, cellHeight) {
|
|
16000
|
+
function renderLine(h, _vm, rowid, params, cellHeight) {
|
|
15638
16001
|
const $xeTable = _vm.$parent;
|
|
15639
16002
|
const tableProps = $xeTable;
|
|
15640
16003
|
const tableInternalData = $xeTable;
|
|
@@ -15659,7 +16022,6 @@ function renderLine(h, _vm, params, cellHeight) {
|
|
|
15659
16022
|
if (slots && slots.line) {
|
|
15660
16023
|
return $xeTable.callSlot(slots.line, params, h);
|
|
15661
16024
|
}
|
|
15662
|
-
const rowid = getRowid($xeTable, row);
|
|
15663
16025
|
const rest = fullAllDataRowIdData[rowid];
|
|
15664
16026
|
let rLevel = 0;
|
|
15665
16027
|
let prevRow = null;
|
|
@@ -15881,6 +16243,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15881
16243
|
tdOns.dblclick = evnt => {
|
|
15882
16244
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
15883
16245
|
};
|
|
16246
|
+
let isMergeCell = false;
|
|
15884
16247
|
// 合并行或列
|
|
15885
16248
|
if (mergeList.length) {
|
|
15886
16249
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
|
|
@@ -15893,9 +16256,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15893
16256
|
return null;
|
|
15894
16257
|
}
|
|
15895
16258
|
if (rowspan > 1) {
|
|
16259
|
+
isMergeCell = true;
|
|
15896
16260
|
tdAttrs.rowspan = rowspan;
|
|
15897
16261
|
}
|
|
15898
16262
|
if (colspan > 1) {
|
|
16263
|
+
isMergeCell = true;
|
|
15899
16264
|
tdAttrs.colspan = colspan;
|
|
15900
16265
|
}
|
|
15901
16266
|
}
|
|
@@ -15930,11 +16295,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15930
16295
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
15931
16296
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
15932
16297
|
let isVNPreEmptyStatus = false;
|
|
15933
|
-
if (!
|
|
15934
|
-
if (
|
|
15935
|
-
|
|
15936
|
-
|
|
15937
|
-
|
|
16298
|
+
if (!isMergeCell) {
|
|
16299
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
16300
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
16301
|
+
isVNPreEmptyStatus = true;
|
|
16302
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
16303
|
+
isVNPreEmptyStatus = true;
|
|
16304
|
+
}
|
|
15938
16305
|
}
|
|
15939
16306
|
}
|
|
15940
16307
|
const tcStyle = {};
|
|
@@ -15956,7 +16323,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15956
16323
|
}));
|
|
15957
16324
|
} else {
|
|
15958
16325
|
// 渲染单元格
|
|
15959
|
-
tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
|
|
16326
|
+
tdVNs.push(...renderLine(h, _vm, rowid, cellParams, cellHeight), h('div', {
|
|
15960
16327
|
key: 'tc',
|
|
15961
16328
|
class: ['vxe-cell', {
|
|
15962
16329
|
'c--title': showTitle,
|
|
@@ -16066,20 +16433,23 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16066
16433
|
} = tableProps;
|
|
16067
16434
|
const {
|
|
16068
16435
|
hasFixedColumn,
|
|
16069
|
-
|
|
16436
|
+
treeExpandedFlag,
|
|
16070
16437
|
isColLoading,
|
|
16071
16438
|
scrollXLoad,
|
|
16072
16439
|
scrollYLoad,
|
|
16073
16440
|
isAllOverflow,
|
|
16074
|
-
|
|
16441
|
+
rowExpandedFlag,
|
|
16075
16442
|
expandColumn,
|
|
16076
16443
|
selectRadioRow,
|
|
16077
|
-
|
|
16444
|
+
pendingRowFlag,
|
|
16078
16445
|
isDragColMove,
|
|
16079
16446
|
rowExpandHeightFlag
|
|
16080
16447
|
} = tableReactData;
|
|
16081
16448
|
const {
|
|
16082
|
-
fullAllDataRowIdData
|
|
16449
|
+
fullAllDataRowIdData,
|
|
16450
|
+
treeExpandedMaps,
|
|
16451
|
+
pendingRowMaps,
|
|
16452
|
+
rowExpandedMaps
|
|
16083
16453
|
} = tableInternalData;
|
|
16084
16454
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
16085
16455
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -16094,6 +16464,9 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16094
16464
|
} = treeOpts;
|
|
16095
16465
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
16096
16466
|
const rows = [];
|
|
16467
|
+
const {
|
|
16468
|
+
handleGetRowId
|
|
16469
|
+
} = createHandleGetRowId($xeTable);
|
|
16097
16470
|
tableData.forEach((row, $rowIndex) => {
|
|
16098
16471
|
const trOn = {};
|
|
16099
16472
|
let rowIndex = $rowIndex;
|
|
@@ -16117,7 +16490,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16117
16490
|
$xeTable.clearHoverRow();
|
|
16118
16491
|
};
|
|
16119
16492
|
}
|
|
16120
|
-
const rowid =
|
|
16493
|
+
const rowid = handleGetRowId(row);
|
|
16121
16494
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
16122
16495
|
let rowLevel = 0;
|
|
16123
16496
|
let seq = -1;
|
|
@@ -16144,7 +16517,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16144
16517
|
_rowIndex
|
|
16145
16518
|
};
|
|
16146
16519
|
// 行是否被展开
|
|
16147
|
-
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid];
|
|
16520
|
+
const isExpandRow = expandColumn && !!rowExpandedFlag && !!rowExpandedMaps[rowid];
|
|
16148
16521
|
// 树节点是否被展开
|
|
16149
16522
|
let isExpandTree = false;
|
|
16150
16523
|
let rowChildren = [];
|
|
@@ -16155,7 +16528,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16155
16528
|
}
|
|
16156
16529
|
if (treeConfig && !scrollYLoad && !transform) {
|
|
16157
16530
|
rowChildren = row[childrenField];
|
|
16158
|
-
isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid];
|
|
16531
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
16159
16532
|
}
|
|
16160
16533
|
// 拖拽行事件
|
|
16161
16534
|
if (rowOpts.drag && (!treeConfig || transform)) {
|
|
@@ -16171,7 +16544,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16171
16544
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
16172
16545
|
'row--radio': radioOpts.highlight && selectRadioRow === row,
|
|
16173
16546
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
16174
|
-
'row--pending': !!pendingRowMaps[rowid]
|
|
16547
|
+
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
16175
16548
|
}, rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''];
|
|
16176
16549
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
16177
16550
|
return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
@@ -16380,7 +16753,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16380
16753
|
isOptimizeMode = true;
|
|
16381
16754
|
}
|
|
16382
16755
|
}
|
|
16383
|
-
if (fixedType || !overflowX) {
|
|
16756
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
16384
16757
|
renderColumnList = visibleColumn;
|
|
16385
16758
|
}
|
|
16386
16759
|
if (fixedType) {
|
|
@@ -16867,6 +17240,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
16867
17240
|
} = tableProps;
|
|
16868
17241
|
const {
|
|
16869
17242
|
isGroup,
|
|
17243
|
+
isColLoading,
|
|
16870
17244
|
overflowX,
|
|
16871
17245
|
scrollXLoad,
|
|
16872
17246
|
scrollYLoad,
|
|
@@ -16891,7 +17265,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
16891
17265
|
isOptimizeMode = true;
|
|
16892
17266
|
}
|
|
16893
17267
|
}
|
|
16894
|
-
if (fixedType || !overflowX) {
|
|
17268
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
16895
17269
|
renderColumnList = visibleColumn;
|
|
16896
17270
|
}
|
|
16897
17271
|
if (fixedType) {
|
|
@@ -17150,6 +17524,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17150
17524
|
cell: evnt.currentTarget
|
|
17151
17525
|
}, cellParams), evnt);
|
|
17152
17526
|
};
|
|
17527
|
+
let isMergeCell = false;
|
|
17153
17528
|
// 合并行或列
|
|
17154
17529
|
if (mergeFooterList.length) {
|
|
17155
17530
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -17162,9 +17537,11 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17162
17537
|
return null;
|
|
17163
17538
|
}
|
|
17164
17539
|
if (rowspan > 1) {
|
|
17540
|
+
isMergeCell = true;
|
|
17165
17541
|
attrs.rowspan = rowspan;
|
|
17166
17542
|
}
|
|
17167
17543
|
if (colspan > 1) {
|
|
17544
|
+
isMergeCell = true;
|
|
17168
17545
|
attrs.colspan = colspan;
|
|
17169
17546
|
}
|
|
17170
17547
|
}
|
|
@@ -17187,8 +17564,10 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17187
17564
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
17188
17565
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
17189
17566
|
let isVNPreEmptyStatus = false;
|
|
17190
|
-
if (
|
|
17191
|
-
|
|
17567
|
+
if (!isMergeCell) {
|
|
17568
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
17569
|
+
isVNPreEmptyStatus = true;
|
|
17570
|
+
}
|
|
17192
17571
|
}
|
|
17193
17572
|
const tcStyle = {};
|
|
17194
17573
|
if (hasEllipsis) {
|
|
@@ -17367,6 +17746,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
|
|
|
17367
17746
|
} = tableInternalData;
|
|
17368
17747
|
const {
|
|
17369
17748
|
isGroup,
|
|
17749
|
+
isColLoading,
|
|
17370
17750
|
overflowX,
|
|
17371
17751
|
scrollXLoad,
|
|
17372
17752
|
scrollYLoad,
|
|
@@ -17382,7 +17762,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
|
|
|
17382
17762
|
isOptimizeMode = true;
|
|
17383
17763
|
}
|
|
17384
17764
|
}
|
|
17385
|
-
if (fixedType || !overflowX) {
|
|
17765
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
17386
17766
|
renderColumnList = visibleColumn;
|
|
17387
17767
|
}
|
|
17388
17768
|
if (fixedType) {
|
|
@@ -17649,6 +18029,8 @@ const {
|
|
|
17649
18029
|
resizeConfig: Object,
|
|
17650
18030
|
// 列配置信息
|
|
17651
18031
|
columnConfig: Object,
|
|
18032
|
+
// 当前列配置信息
|
|
18033
|
+
currentColumnConfig: Object,
|
|
17652
18034
|
// 单元格配置信息
|
|
17653
18035
|
cellConfig: Object,
|
|
17654
18036
|
// 表头单元格配置信息
|
|
@@ -17657,6 +18039,8 @@ const {
|
|
|
17657
18039
|
footerCellConfig: Object,
|
|
17658
18040
|
// 行配置信息
|
|
17659
18041
|
rowConfig: Object,
|
|
18042
|
+
// 当前行配置信息
|
|
18043
|
+
currentRowConfig: Object,
|
|
17660
18044
|
// 已废弃,被 rowDragConfig 替换
|
|
17661
18045
|
dragConfig: Object,
|
|
17662
18046
|
// 行拖拽排序配置项
|
|
@@ -18997,11 +19381,17 @@ const {
|
|
|
18997
19381
|
const rtFilter = compConf ? compConf.renderTableFilter || compConf.renderFilter : null;
|
|
18998
19382
|
if (filterSlot) {
|
|
18999
19383
|
return [h('div', {
|
|
19000
|
-
class: 'vxe-table--filter-template'
|
|
19384
|
+
class: 'vxe-table--filter-template',
|
|
19385
|
+
style: maxHeight ? {
|
|
19386
|
+
maxHeight: `${maxHeight}px`
|
|
19387
|
+
} : {}
|
|
19001
19388
|
}, $xeTable.callSlot(filterSlot, params, h))];
|
|
19002
19389
|
} else if (rtFilter) {
|
|
19003
19390
|
return [h('div', {
|
|
19004
|
-
class: 'vxe-table--filter-template'
|
|
19391
|
+
class: 'vxe-table--filter-template',
|
|
19392
|
+
style: maxHeight ? {
|
|
19393
|
+
maxHeight: `${maxHeight}px`
|
|
19394
|
+
} : {}
|
|
19005
19395
|
}, getSlotVNs(rtFilter.call($xeTable, h, filterRender, params)))];
|
|
19006
19396
|
}
|
|
19007
19397
|
const isAllChecked = multiple ? filterStore.isAllSelected : !filterStore.options.some(item => item._checked);
|
|
@@ -21413,13 +21803,14 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21413
21803
|
} = props;
|
|
21414
21804
|
const {
|
|
21415
21805
|
mergeList,
|
|
21416
|
-
editStore
|
|
21417
|
-
selectCheckboxMaps
|
|
21806
|
+
editStore
|
|
21418
21807
|
} = reactData;
|
|
21419
21808
|
const {
|
|
21420
21809
|
tableFullTreeData,
|
|
21810
|
+
selectCheckboxMaps,
|
|
21421
21811
|
afterFullData,
|
|
21422
|
-
tableFullData
|
|
21812
|
+
tableFullData,
|
|
21813
|
+
pendingRowMaps
|
|
21423
21814
|
} = internalData;
|
|
21424
21815
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
21425
21816
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -21430,9 +21821,9 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21430
21821
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
21431
21822
|
const {
|
|
21432
21823
|
actived,
|
|
21433
|
-
removeMaps
|
|
21434
|
-
insertMaps
|
|
21824
|
+
removeMaps
|
|
21435
21825
|
} = editStore;
|
|
21826
|
+
const insertDataRowMaps = Object.assign({}, editStore.insertMaps);
|
|
21436
21827
|
const {
|
|
21437
21828
|
checkField
|
|
21438
21829
|
} = checkboxOpts;
|
|
@@ -21451,16 +21842,13 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21451
21842
|
});
|
|
21452
21843
|
// 如果绑定了多选属性,则更新状态
|
|
21453
21844
|
if (!checkField) {
|
|
21454
|
-
const selectRowMaps = {
|
|
21455
|
-
...selectCheckboxMaps
|
|
21456
|
-
};
|
|
21457
21845
|
rows.forEach(row => {
|
|
21458
21846
|
const rowid = getRowid(this, row);
|
|
21459
|
-
if (
|
|
21460
|
-
delete
|
|
21847
|
+
if (selectCheckboxMaps[rowid]) {
|
|
21848
|
+
delete selectCheckboxMaps[rowid];
|
|
21461
21849
|
}
|
|
21462
21850
|
});
|
|
21463
|
-
|
|
21851
|
+
reactData.updateCheckboxFlag++;
|
|
21464
21852
|
}
|
|
21465
21853
|
// 从数据源中移除
|
|
21466
21854
|
if (tableFullData === rows) {
|
|
@@ -21524,10 +21912,15 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21524
21912
|
// 从新增中移除已删除的数据
|
|
21525
21913
|
rows.forEach(row => {
|
|
21526
21914
|
const rowid = getRowid($xeTable, row);
|
|
21527
|
-
if (
|
|
21528
|
-
delete
|
|
21915
|
+
if (insertDataRowMaps[rowid]) {
|
|
21916
|
+
delete insertDataRowMaps[rowid];
|
|
21917
|
+
}
|
|
21918
|
+
if (pendingRowMaps[rowid]) {
|
|
21919
|
+
delete pendingRowMaps[rowid];
|
|
21529
21920
|
}
|
|
21530
21921
|
});
|
|
21922
|
+
editStore.insertMaps = insertDataRowMaps;
|
|
21923
|
+
reactData.pendingRowFlag++;
|
|
21531
21924
|
$xeTable.updateFooter();
|
|
21532
21925
|
$xeTable.cacheRowMap(false);
|
|
21533
21926
|
$xeTable.handleTableData(treeConfig && transform);
|
|
@@ -24021,18 +24414,27 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24021
24414
|
methods: {
|
|
24022
24415
|
// 处理 Tab 键移动
|
|
24023
24416
|
moveTabSelected(args, isLeft, evnt) {
|
|
24417
|
+
const $xeTable = this;
|
|
24418
|
+
const props = $xeTable;
|
|
24419
|
+
const internalData = $xeTable;
|
|
24420
|
+
const {
|
|
24421
|
+
editConfig
|
|
24422
|
+
} = props;
|
|
24024
24423
|
const {
|
|
24025
24424
|
afterFullData,
|
|
24026
|
-
visibleColumn
|
|
24027
|
-
|
|
24028
|
-
|
|
24029
|
-
|
|
24425
|
+
visibleColumn
|
|
24426
|
+
} = internalData;
|
|
24427
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
24428
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
24429
|
+
const currentRowOpts = $xeTable.computeCurrentRowOpts;
|
|
24430
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
24431
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
24030
24432
|
let targetRow;
|
|
24031
24433
|
let targetRowIndex;
|
|
24032
24434
|
let targetColumnIndex;
|
|
24033
24435
|
const params = Object.assign({}, args);
|
|
24034
|
-
const _rowIndex =
|
|
24035
|
-
const _columnIndex =
|
|
24436
|
+
const _rowIndex = $xeTable.getVTRowIndex(params.row);
|
|
24437
|
+
const _columnIndex = $xeTable.getVTColumnIndex(params.column);
|
|
24036
24438
|
evnt.preventDefault();
|
|
24037
24439
|
if (isLeft) {
|
|
24038
24440
|
// 向左
|
|
@@ -24068,31 +24470,48 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24068
24470
|
}
|
|
24069
24471
|
params.columnIndex = targetColumnIndex;
|
|
24070
24472
|
params.column = targetColumn;
|
|
24071
|
-
params.cell =
|
|
24473
|
+
params.cell = $xeTable.getCellElement(params.row, params.column);
|
|
24474
|
+
if (rowOpts.isCurrent && currentRowOpts.isFollowSelected) {
|
|
24475
|
+
$xeTable.triggerCurrentRowEvent(evnt, params);
|
|
24476
|
+
}
|
|
24477
|
+
if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
|
|
24478
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
24479
|
+
}
|
|
24072
24480
|
if (editConfig) {
|
|
24073
24481
|
if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
|
|
24074
24482
|
if (editOpts.mode === 'row') {
|
|
24075
|
-
|
|
24483
|
+
$xeTable.handleEdit(params, evnt);
|
|
24076
24484
|
} else {
|
|
24077
|
-
|
|
24485
|
+
$xeTable.scrollToRow(params.row, params.column).then(() => {
|
|
24486
|
+
$xeTable.handleSelected(params, evnt);
|
|
24487
|
+
});
|
|
24078
24488
|
}
|
|
24079
24489
|
}
|
|
24080
24490
|
} else {
|
|
24081
|
-
|
|
24491
|
+
$xeTable.scrollToRow(params.row, params.column).then(() => {
|
|
24492
|
+
$xeTable.handleSelected(params, evnt);
|
|
24493
|
+
});
|
|
24082
24494
|
}
|
|
24083
24495
|
}
|
|
24084
24496
|
},
|
|
24085
24497
|
// 处理当前行方向键移动
|
|
24086
24498
|
moveCurrentRow(isUpArrow, isDwArrow, evnt) {
|
|
24499
|
+
const $xeTable = this;
|
|
24500
|
+
const props = $xeTable;
|
|
24501
|
+
const reactData = $xeTable;
|
|
24502
|
+
const internalData = $xeTable;
|
|
24503
|
+
const {
|
|
24504
|
+
treeConfig
|
|
24505
|
+
} = props;
|
|
24506
|
+
const {
|
|
24507
|
+
currentRow
|
|
24508
|
+
} = reactData;
|
|
24087
24509
|
const {
|
|
24088
|
-
currentRow,
|
|
24089
|
-
treeConfig,
|
|
24090
|
-
treeOpts,
|
|
24091
24510
|
afterFullData
|
|
24092
|
-
} =
|
|
24511
|
+
} = internalData;
|
|
24512
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
24093
24513
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
24094
24514
|
let targetRow;
|
|
24095
|
-
evnt.preventDefault();
|
|
24096
24515
|
if (currentRow) {
|
|
24097
24516
|
if (treeConfig) {
|
|
24098
24517
|
const {
|
|
@@ -24107,7 +24526,7 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24107
24526
|
targetRow = items[index + 1];
|
|
24108
24527
|
}
|
|
24109
24528
|
} else {
|
|
24110
|
-
const _rowIndex =
|
|
24529
|
+
const _rowIndex = $xeTable.getVTRowIndex(currentRow);
|
|
24111
24530
|
if (isUpArrow && _rowIndex > 0) {
|
|
24112
24531
|
targetRow = afterFullData[_rowIndex - 1];
|
|
24113
24532
|
} else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
|
|
@@ -24118,22 +24537,60 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24118
24537
|
targetRow = afterFullData[0];
|
|
24119
24538
|
}
|
|
24120
24539
|
if (targetRow) {
|
|
24540
|
+
evnt.preventDefault();
|
|
24121
24541
|
const params = {
|
|
24122
|
-
$table:
|
|
24123
|
-
row: targetRow
|
|
24542
|
+
$table: $xeTable,
|
|
24543
|
+
row: targetRow,
|
|
24544
|
+
rowIndex: $xeTable.getRowIndex(targetRow),
|
|
24545
|
+
$rowIndex: $xeTable.getVMRowIndex(targetRow)
|
|
24546
|
+
};
|
|
24547
|
+
$xeTable.scrollToRow(targetRow).then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
24548
|
+
}
|
|
24549
|
+
},
|
|
24550
|
+
// 处理当前列方向键移动
|
|
24551
|
+
moveCurrentColumn(isLeftArrow, isRightArrow, evnt) {
|
|
24552
|
+
const $xeTable = this;
|
|
24553
|
+
const reactData = $xeTable;
|
|
24554
|
+
const internalData = $xeTable;
|
|
24555
|
+
const {
|
|
24556
|
+
currentColumn
|
|
24557
|
+
} = reactData;
|
|
24558
|
+
const {
|
|
24559
|
+
visibleColumn
|
|
24560
|
+
} = internalData;
|
|
24561
|
+
let targetCol = null;
|
|
24562
|
+
if (currentColumn) {
|
|
24563
|
+
const _columnIndex = $xeTable.getVTColumnIndex(currentColumn);
|
|
24564
|
+
if (isLeftArrow && _columnIndex > 0) {
|
|
24565
|
+
targetCol = visibleColumn[_columnIndex - 1];
|
|
24566
|
+
} else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
24567
|
+
targetCol = visibleColumn[_columnIndex + 1];
|
|
24568
|
+
}
|
|
24569
|
+
} else {
|
|
24570
|
+
targetCol = visibleColumn[0];
|
|
24571
|
+
}
|
|
24572
|
+
if (targetCol) {
|
|
24573
|
+
evnt.preventDefault();
|
|
24574
|
+
const params = {
|
|
24575
|
+
$table: $xeTable,
|
|
24576
|
+
column: targetCol,
|
|
24577
|
+
columnIndex: $xeTable.getColumnIndex(targetCol),
|
|
24578
|
+
$columnIndex: $xeTable.getVMColumnIndex(targetCol)
|
|
24124
24579
|
};
|
|
24125
|
-
|
|
24580
|
+
$xeTable.scrollToColumn(targetCol).then(() => $xeTable.triggerCurrentColumnEvent(evnt, params));
|
|
24126
24581
|
}
|
|
24127
24582
|
},
|
|
24128
24583
|
// 处理可编辑方向键移动
|
|
24129
24584
|
moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
|
|
24585
|
+
const $xeTable = this;
|
|
24586
|
+
const internalData = $xeTable;
|
|
24130
24587
|
const {
|
|
24131
24588
|
afterFullData,
|
|
24132
24589
|
visibleColumn
|
|
24133
|
-
} =
|
|
24590
|
+
} = internalData;
|
|
24134
24591
|
const params = Object.assign({}, args);
|
|
24135
|
-
const _rowIndex =
|
|
24136
|
-
const _columnIndex =
|
|
24592
|
+
const _rowIndex = $xeTable.getVTRowIndex(params.row);
|
|
24593
|
+
const _columnIndex = $xeTable.getVTColumnIndex(params.column);
|
|
24137
24594
|
evnt.preventDefault();
|
|
24138
24595
|
if (isUpArrow && _rowIndex > 0) {
|
|
24139
24596
|
// 移动到上一行
|
|
@@ -24152,9 +24609,9 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
24152
24609
|
params.columnIndex = _columnIndex + 1;
|
|
24153
24610
|
params.column = visibleColumn[params.columnIndex];
|
|
24154
24611
|
}
|
|
24155
|
-
|
|
24156
|
-
params.cell =
|
|
24157
|
-
|
|
24612
|
+
$xeTable.scrollToRow(params.row, params.column).then(() => {
|
|
24613
|
+
params.cell = $xeTable.getCellElement(params.row, params.column);
|
|
24614
|
+
$xeTable.handleSelected(params, evnt);
|
|
24158
24615
|
});
|
|
24159
24616
|
},
|
|
24160
24617
|
handleCellMousedownEvent(evnt, params) {
|
|
@@ -24573,11 +25030,11 @@ function validErrorRuleValue(rule, val) {
|
|
|
24573
25030
|
treeConfig
|
|
24574
25031
|
} = props;
|
|
24575
25032
|
const {
|
|
24576
|
-
editStore
|
|
24577
|
-
pendingRowMaps
|
|
25033
|
+
editStore
|
|
24578
25034
|
} = reactData;
|
|
24579
25035
|
const {
|
|
24580
|
-
afterFullData
|
|
25036
|
+
afterFullData,
|
|
25037
|
+
pendingRowMaps
|
|
24581
25038
|
} = internalData;
|
|
24582
25039
|
const {
|
|
24583
25040
|
removeMaps
|
|
@@ -25524,6 +25981,9 @@ function renderRowExpandedVNs(h, $xeTable) {
|
|
|
25524
25981
|
ref: 'refRowExpandYSpaceElem'
|
|
25525
25982
|
})];
|
|
25526
25983
|
if (expandColumn) {
|
|
25984
|
+
const {
|
|
25985
|
+
handleGetRowId
|
|
25986
|
+
} = createHandleGetRowId($xeTable);
|
|
25527
25987
|
tableRowExpandedList.forEach(row => {
|
|
25528
25988
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
25529
25989
|
const {
|
|
@@ -25539,7 +25999,7 @@ function renderRowExpandedVNs(h, $xeTable) {
|
|
|
25539
25999
|
seqMode
|
|
25540
26000
|
} = treeOpts;
|
|
25541
26001
|
const cellStyle = {};
|
|
25542
|
-
const rowid =
|
|
26002
|
+
const rowid = handleGetRowId(row);
|
|
25543
26003
|
const rest = fullAllDataRowIdData[rowid];
|
|
25544
26004
|
let rowLevel = 0;
|
|
25545
26005
|
let seq = -1;
|
|
@@ -25763,8 +26223,6 @@ function renderBody(h, $xeTable) {
|
|
|
25763
26223
|
isAllSelected: false,
|
|
25764
26224
|
// 复选框属性,有选中且非全选状态
|
|
25765
26225
|
isIndeterminate: false,
|
|
25766
|
-
// 复选框属性,已选中的行集合
|
|
25767
|
-
selectCheckboxMaps: {},
|
|
25768
26226
|
// 当前行
|
|
25769
26227
|
currentRow: null,
|
|
25770
26228
|
// 单选框属性,选中列
|
|
@@ -25778,16 +26236,6 @@ function renderBody(h, $xeTable) {
|
|
|
25778
26236
|
hasFixedColumn: false,
|
|
25779
26237
|
// 树节点列信息
|
|
25780
26238
|
treeNodeColumn: null,
|
|
25781
|
-
// 已展开的行集合
|
|
25782
|
-
rowExpandedMaps: {},
|
|
25783
|
-
// 懒加载中的展开行的集合
|
|
25784
|
-
rowExpandLazyLoadedMaps: {},
|
|
25785
|
-
// 已展开树节点集合
|
|
25786
|
-
treeExpandedMaps: {},
|
|
25787
|
-
// 懒加载中的树节点的集合
|
|
25788
|
-
treeExpandLazyLoadedMaps: {},
|
|
25789
|
-
// 树节点不确定状态的集合
|
|
25790
|
-
treeIndeterminateMaps: {},
|
|
25791
26239
|
// 合并单元格的对象集
|
|
25792
26240
|
mergeList: [],
|
|
25793
26241
|
// 合并表尾数据的对象集
|
|
@@ -25804,8 +26252,6 @@ function renderBody(h, $xeTable) {
|
|
|
25804
26252
|
upDataFlag: 0,
|
|
25805
26253
|
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
25806
26254
|
reColumnFlag: 0,
|
|
25807
|
-
// 已标记的对象集
|
|
25808
|
-
pendingRowMaps: {},
|
|
25809
26255
|
// 自定义列相关的信息
|
|
25810
26256
|
customStore: {
|
|
25811
26257
|
btnEl: null,
|
|
@@ -25940,6 +26386,10 @@ function renderBody(h, $xeTable) {
|
|
|
25940
26386
|
isHeader: false,
|
|
25941
26387
|
isFooter: false
|
|
25942
26388
|
},
|
|
26389
|
+
rowExpandedFlag: 1,
|
|
26390
|
+
treeExpandedFlag: 1,
|
|
26391
|
+
updateCheckboxFlag: 1,
|
|
26392
|
+
pendingRowFlag: 1,
|
|
25943
26393
|
rowHeightStore: {
|
|
25944
26394
|
default: 48,
|
|
25945
26395
|
medium: 44,
|
|
@@ -26074,28 +26524,54 @@ function renderBody(h, $xeTable) {
|
|
|
26074
26524
|
return this.computeColumnOpts;
|
|
26075
26525
|
},
|
|
26076
26526
|
computeColumnOpts() {
|
|
26077
|
-
|
|
26527
|
+
const $xeTable = this;
|
|
26528
|
+
const props = $xeTable;
|
|
26529
|
+
return Object.assign({}, table_getConfig().table.columnConfig, props.columnConfig);
|
|
26530
|
+
},
|
|
26531
|
+
computeCurrentColumnOpts() {
|
|
26532
|
+
const $xeTable = this;
|
|
26533
|
+
const props = $xeTable;
|
|
26534
|
+
return Object.assign({}, table_getConfig().table.currentColumnConfig, props.currentColumnConfig);
|
|
26078
26535
|
},
|
|
26079
26536
|
computeCellOpts() {
|
|
26080
26537
|
const $xeTable = this;
|
|
26081
26538
|
const props = $xeTable;
|
|
26082
|
-
|
|
26539
|
+
const cellOpts = Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
|
|
26540
|
+
if (cellOpts.height) {
|
|
26541
|
+
cellOpts.height = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);
|
|
26542
|
+
}
|
|
26543
|
+
return cellOpts;
|
|
26083
26544
|
},
|
|
26084
26545
|
computeHeaderCellOpts() {
|
|
26085
26546
|
const $xeTable = this;
|
|
26086
26547
|
const props = $xeTable;
|
|
26087
|
-
|
|
26548
|
+
const headerCellOpts = Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
26549
|
+
if (headerCellOpts.height) {
|
|
26550
|
+
headerCellOpts.height = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(headerCellOpts.height);
|
|
26551
|
+
}
|
|
26552
|
+
return headerCellOpts;
|
|
26088
26553
|
},
|
|
26089
26554
|
computeFooterCellOpts() {
|
|
26090
26555
|
const $xeTable = this;
|
|
26091
26556
|
const props = $xeTable;
|
|
26092
|
-
|
|
26557
|
+
const footerCellOpts = Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
26558
|
+
if (footerCellOpts.height) {
|
|
26559
|
+
footerCellOpts.height = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(footerCellOpts.height);
|
|
26560
|
+
}
|
|
26561
|
+
return footerCellOpts;
|
|
26093
26562
|
},
|
|
26094
26563
|
rowOpts() {
|
|
26095
26564
|
return this.computeRowOpts;
|
|
26096
26565
|
},
|
|
26097
26566
|
computeRowOpts() {
|
|
26098
|
-
|
|
26567
|
+
const $xeTable = this;
|
|
26568
|
+
const props = $xeTable;
|
|
26569
|
+
return Object.assign({}, table_getConfig().table.rowConfig, props.rowConfig);
|
|
26570
|
+
},
|
|
26571
|
+
computeCurrentRowOpts() {
|
|
26572
|
+
const $xeTable = this;
|
|
26573
|
+
const props = $xeTable;
|
|
26574
|
+
return Object.assign({}, table_getConfig().table.currentRowConfig, props.currentRowConfig);
|
|
26099
26575
|
},
|
|
26100
26576
|
computeRowDragOpts() {
|
|
26101
26577
|
return Object.assign({}, table_getConfig().table.rowDragConfig, this.rowDragConfig);
|
|
@@ -26119,27 +26595,35 @@ function renderBody(h, $xeTable) {
|
|
|
26119
26595
|
return this.computeSeqOpts;
|
|
26120
26596
|
},
|
|
26121
26597
|
computeSeqOpts() {
|
|
26598
|
+
const $xeTable = this;
|
|
26599
|
+
const props = $xeTable;
|
|
26122
26600
|
return Object.assign({
|
|
26123
26601
|
startIndex: 0
|
|
26124
|
-
}, table_getConfig().table.seqConfig,
|
|
26602
|
+
}, table_getConfig().table.seqConfig, props.seqConfig);
|
|
26125
26603
|
},
|
|
26126
26604
|
radioOpts() {
|
|
26127
26605
|
return this.computeRadioOpts;
|
|
26128
26606
|
},
|
|
26129
26607
|
computeRadioOpts() {
|
|
26130
|
-
|
|
26608
|
+
const $xeTable = this;
|
|
26609
|
+
const props = $xeTable;
|
|
26610
|
+
return Object.assign({}, table_getConfig().table.radioConfig, props.radioConfig);
|
|
26131
26611
|
},
|
|
26132
26612
|
checkboxOpts() {
|
|
26133
26613
|
return this.computeCheckboxOpts;
|
|
26134
26614
|
},
|
|
26135
26615
|
computeCheckboxOpts() {
|
|
26136
|
-
|
|
26616
|
+
const $xeTable = this;
|
|
26617
|
+
const props = $xeTable;
|
|
26618
|
+
return Object.assign({}, table_getConfig().table.checkboxConfig, props.checkboxConfig);
|
|
26137
26619
|
},
|
|
26138
26620
|
tooltipOpts() {
|
|
26139
26621
|
return this.computeTooltipOpts;
|
|
26140
26622
|
},
|
|
26141
26623
|
computeTooltipOpts() {
|
|
26142
|
-
|
|
26624
|
+
const $xeTable = this;
|
|
26625
|
+
const props = $xeTable;
|
|
26626
|
+
return Object.assign({}, table_getConfig().tooltip, table_getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
26143
26627
|
},
|
|
26144
26628
|
tipConfig() {
|
|
26145
26629
|
return {
|
|
@@ -26363,16 +26847,23 @@ function renderBody(h, $xeTable) {
|
|
|
26363
26847
|
computeTableRowExpandedList() {
|
|
26364
26848
|
const $xeTable = this;
|
|
26365
26849
|
const reactData = $xeTable;
|
|
26850
|
+
const internalData = $xeTable;
|
|
26366
26851
|
const {
|
|
26367
|
-
|
|
26852
|
+
rowExpandedFlag,
|
|
26368
26853
|
tableData,
|
|
26369
26854
|
expandColumn
|
|
26370
26855
|
} = reactData;
|
|
26856
|
+
const {
|
|
26857
|
+
rowExpandedMaps
|
|
26858
|
+
} = internalData;
|
|
26859
|
+
const {
|
|
26860
|
+
handleGetRowId
|
|
26861
|
+
} = createHandleGetRowId($xeTable);
|
|
26371
26862
|
const expandList = [];
|
|
26372
|
-
if (expandColumn) {
|
|
26863
|
+
if (expandColumn && rowExpandedFlag) {
|
|
26373
26864
|
const rowKeys = {};
|
|
26374
26865
|
tableData.forEach(row => {
|
|
26375
|
-
rowKeys[
|
|
26866
|
+
rowKeys[handleGetRowId(row)] = true;
|
|
26376
26867
|
});
|
|
26377
26868
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps, (row, rowid) => {
|
|
26378
26869
|
if (rowKeys[rowid]) {
|
|
@@ -26642,13 +27133,15 @@ function renderBody(h, $xeTable) {
|
|
|
26642
27133
|
lastScrollTop: 0,
|
|
26643
27134
|
// 单选框属性,已选中保留的行
|
|
26644
27135
|
radioReserveRow: null,
|
|
26645
|
-
//
|
|
27136
|
+
// 复选框属性,已选中保留的行集合
|
|
26646
27137
|
checkboxReserveRowMap: {},
|
|
26647
|
-
//
|
|
27138
|
+
// 行数据,已展开保留的行集合
|
|
26648
27139
|
rowExpandedReserveRowMap: {},
|
|
26649
|
-
//
|
|
27140
|
+
// 树结构数据,已展开保留的行集合
|
|
26650
27141
|
treeExpandedReserveRowMap: {},
|
|
26651
|
-
//
|
|
27142
|
+
// 树结构数据,不确定状态的集合
|
|
27143
|
+
treeIndeterminateRowMaps: {},
|
|
27144
|
+
// 列表完整数据、条件处理后
|
|
26652
27145
|
tableFullData: [],
|
|
26653
27146
|
afterFullData: [],
|
|
26654
27147
|
// 列表条件处理后数据集合
|
|
@@ -26666,6 +27159,18 @@ function renderBody(h, $xeTable) {
|
|
|
26666
27159
|
fullColumnMap: new Map(),
|
|
26667
27160
|
fullColumnIdData: {},
|
|
26668
27161
|
fullColumnFieldData: {},
|
|
27162
|
+
// 已展开的行集合
|
|
27163
|
+
rowExpandedMaps: {},
|
|
27164
|
+
// 懒加载中的展开行的集合
|
|
27165
|
+
rowExpandLazyLoadedMaps: {},
|
|
27166
|
+
// 已展开树节点集合
|
|
27167
|
+
treeExpandedMaps: {},
|
|
27168
|
+
// 懒加载中的树节点的集合
|
|
27169
|
+
treeExpandLazyLoadedMaps: {},
|
|
27170
|
+
// 复选框属性,已选中的行集合
|
|
27171
|
+
selectCheckboxMaps: {},
|
|
27172
|
+
// 已标记的对象集
|
|
27173
|
+
pendingRowMaps: {},
|
|
26669
27174
|
swYSize: 0,
|
|
26670
27175
|
swYInterval: 0,
|
|
26671
27176
|
swYTotal: 0
|
|
@@ -28123,6 +28628,24 @@ function getFuncSlot($xeGrid, optSlots, slotKey) {
|
|
|
28123
28628
|
}
|
|
28124
28629
|
return null;
|
|
28125
28630
|
}
|
|
28631
|
+
const getConfigSlot = ($xeGrid, slotConfigs) => {
|
|
28632
|
+
const slots = $xeGrid.$scopedSlots;
|
|
28633
|
+
const slotConf = {};
|
|
28634
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectMap(slotConfigs, (slotFunc, slotKey) => {
|
|
28635
|
+
if (slotFunc) {
|
|
28636
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(slotFunc)) {
|
|
28637
|
+
if (slots[slotFunc]) {
|
|
28638
|
+
slotConf[slotKey] = slots[slotFunc];
|
|
28639
|
+
} else {
|
|
28640
|
+
errLog('vxe.error.notSlot', [slotFunc]);
|
|
28641
|
+
}
|
|
28642
|
+
} else {
|
|
28643
|
+
slotConf[slotKey] = slotFunc;
|
|
28644
|
+
}
|
|
28645
|
+
}
|
|
28646
|
+
});
|
|
28647
|
+
return slotConf;
|
|
28648
|
+
};
|
|
28126
28649
|
function getToolbarSlots(_vm) {
|
|
28127
28650
|
const {
|
|
28128
28651
|
$scopedSlots,
|
|
@@ -28152,26 +28675,6 @@ function getToolbarSlots(_vm) {
|
|
|
28152
28675
|
}
|
|
28153
28676
|
return slots;
|
|
28154
28677
|
}
|
|
28155
|
-
function getPagerSlots(_vm) {
|
|
28156
|
-
const {
|
|
28157
|
-
pagerOpts
|
|
28158
|
-
} = _vm;
|
|
28159
|
-
const pagerOptSlots = pagerOpts.slots;
|
|
28160
|
-
const slots = {};
|
|
28161
|
-
let leftSlot;
|
|
28162
|
-
let rightSlot;
|
|
28163
|
-
if (pagerOptSlots) {
|
|
28164
|
-
leftSlot = getFuncSlot(_vm, pagerOptSlots, 'left');
|
|
28165
|
-
rightSlot = getFuncSlot(_vm, pagerOptSlots, 'right');
|
|
28166
|
-
if (leftSlot) {
|
|
28167
|
-
slots.left = leftSlot;
|
|
28168
|
-
}
|
|
28169
|
-
if (rightSlot) {
|
|
28170
|
-
slots.right = rightSlot;
|
|
28171
|
-
}
|
|
28172
|
-
}
|
|
28173
|
-
return slots;
|
|
28174
|
-
}
|
|
28175
28678
|
function getTableOns(_vm) {
|
|
28176
28679
|
const {
|
|
28177
28680
|
$listeners,
|
|
@@ -28194,6 +28697,30 @@ function getTableOns(_vm) {
|
|
|
28194
28697
|
}
|
|
28195
28698
|
return ons;
|
|
28196
28699
|
}
|
|
28700
|
+
function pageChangeEvent($xeGrid, params) {
|
|
28701
|
+
const props = $xeGrid;
|
|
28702
|
+
const reactData = $xeGrid;
|
|
28703
|
+
const {
|
|
28704
|
+
proxyConfig
|
|
28705
|
+
} = props;
|
|
28706
|
+
const {
|
|
28707
|
+
tablePage
|
|
28708
|
+
} = reactData;
|
|
28709
|
+
const {
|
|
28710
|
+
$event,
|
|
28711
|
+
currentPage,
|
|
28712
|
+
pageSize
|
|
28713
|
+
} = params;
|
|
28714
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
28715
|
+
tablePage.currentPage = currentPage;
|
|
28716
|
+
tablePage.pageSize = pageSize;
|
|
28717
|
+
$xeGrid.dispatchEvent('page-change', params, $event);
|
|
28718
|
+
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
28719
|
+
$xeGrid.commitProxy('query').then(rest => {
|
|
28720
|
+
$xeGrid.dispatchEvent('proxy-query', rest, $event);
|
|
28721
|
+
});
|
|
28722
|
+
}
|
|
28723
|
+
}
|
|
28197
28724
|
/**
|
|
28198
28725
|
* 渲染表单
|
|
28199
28726
|
*/
|
|
@@ -28331,32 +28858,34 @@ function renderBottom(h, _vm) {
|
|
|
28331
28858
|
function renderPager(h, $xeGrid) {
|
|
28332
28859
|
const VxeUIPagerComponent = core_.VxeUI.getComponent('VxePager');
|
|
28333
28860
|
const props = $xeGrid;
|
|
28861
|
+
const slots = $xeGrid.$scopedSlots;
|
|
28862
|
+
const reactData = $xeGrid;
|
|
28334
28863
|
const {
|
|
28335
|
-
|
|
28336
|
-
|
|
28864
|
+
proxyConfig,
|
|
28865
|
+
pagerConfig
|
|
28337
28866
|
} = props;
|
|
28338
|
-
const
|
|
28339
|
-
|
|
28340
|
-
|
|
28341
|
-
|
|
28342
|
-
const pagerSlot = $scopedSlots.pager;
|
|
28343
|
-
const hasPager = !!(pagerSlot || isEnableConf(pagerConfig));
|
|
28344
|
-
if (hasPager) {
|
|
28867
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
28868
|
+
const pagerOpts = $xeGrid.computePagerOpts;
|
|
28869
|
+
const pagerSlot = slots.pager;
|
|
28870
|
+
if (pagerConfig && isEnableConf(pagerOpts) || slots.pager) {
|
|
28345
28871
|
return h('div', {
|
|
28346
|
-
key: 'pager',
|
|
28347
28872
|
ref: 'refPagerWrapper',
|
|
28873
|
+
key: 'pager',
|
|
28348
28874
|
class: 'vxe-grid--pager-wrapper'
|
|
28349
28875
|
}, pagerSlot ? pagerSlot.call($xeGrid, {
|
|
28350
28876
|
$grid: $xeGrid
|
|
28351
|
-
}
|
|
28877
|
+
}) : [VxeUIPagerComponent ? h(VxeUIPagerComponent, {
|
|
28878
|
+
ref: 'refPager',
|
|
28352
28879
|
props: {
|
|
28353
|
-
|
|
28354
|
-
...(proxyConfig ? tablePage : {})
|
|
28880
|
+
...pagerOpts,
|
|
28881
|
+
...(proxyConfig && isEnableConf(proxyOpts) ? reactData.tablePage : {})
|
|
28355
28882
|
},
|
|
28356
28883
|
on: {
|
|
28357
|
-
'page-change'
|
|
28884
|
+
'page-change'(params) {
|
|
28885
|
+
pageChangeEvent($xeGrid, params);
|
|
28886
|
+
}
|
|
28358
28887
|
},
|
|
28359
|
-
scopedSlots:
|
|
28888
|
+
scopedSlots: getConfigSlot($xeGrid, pagerOpts.slots)
|
|
28360
28889
|
}) : grid_renderEmptyElement($xeGrid)]);
|
|
28361
28890
|
}
|
|
28362
28891
|
return grid_renderEmptyElement($xeGrid);
|
|
@@ -28708,6 +29237,10 @@ Object.keys(table.methods).forEach(name => {
|
|
|
28708
29237
|
}
|
|
28709
29238
|
return [];
|
|
28710
29239
|
},
|
|
29240
|
+
getEl() {
|
|
29241
|
+
const $xeGrid = this;
|
|
29242
|
+
return $xeGrid.$refs.refElem;
|
|
29243
|
+
},
|
|
28711
29244
|
/**
|
|
28712
29245
|
* 获取需要排除的高度
|
|
28713
29246
|
*/
|
|
@@ -28718,20 +29251,25 @@ Object.keys(table.methods).forEach(name => {
|
|
|
28718
29251
|
isZMax
|
|
28719
29252
|
} = reactData;
|
|
28720
29253
|
const el = $xeGrid.$refs.refElem;
|
|
28721
|
-
|
|
28722
|
-
|
|
28723
|
-
|
|
28724
|
-
|
|
28725
|
-
|
|
28726
|
-
|
|
28727
|
-
|
|
29254
|
+
if (el) {
|
|
29255
|
+
const formWrapper = $xeGrid.$refs.refFormWrapper;
|
|
29256
|
+
const toolbarWrapper = $xeGrid.$refs.refToolbarWrapper;
|
|
29257
|
+
const topWrapper = $xeGrid.$refs.refTopWrapper;
|
|
29258
|
+
const bottomWrapper = $xeGrid.$refs.refBottomWrapper;
|
|
29259
|
+
const pagerWrapper = $xeGrid.$refs.refPagerWrapper;
|
|
29260
|
+
const parentEl = el.parentElement;
|
|
29261
|
+
const parentPaddingSize = isZMax ? 0 : parentEl ? getPaddingTopBottomSize(parentEl) : 0;
|
|
29262
|
+
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
|
|
29263
|
+
}
|
|
29264
|
+
return 0;
|
|
28728
29265
|
},
|
|
28729
29266
|
getParentHeight() {
|
|
28730
29267
|
const $xeGrid = this;
|
|
28731
29268
|
const reactData = $xeGrid;
|
|
28732
29269
|
const el = $xeGrid.$refs.refElem;
|
|
28733
29270
|
if (el) {
|
|
28734
|
-
|
|
29271
|
+
const parentEl = el.parentElement;
|
|
29272
|
+
return (reactData.isZMax ? getDomNode().visibleHeight : parentEl ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(parentEl).height) : 0) - $xeGrid.getExcludeHeight();
|
|
28735
29273
|
}
|
|
28736
29274
|
return 0;
|
|
28737
29275
|
},
|
|
@@ -28824,6 +29362,8 @@ Object.keys(table.methods).forEach(name => {
|
|
|
28824
29362
|
* @param {String/Object} code 字符串或对象
|
|
28825
29363
|
*/
|
|
28826
29364
|
commitProxy(proxyTarget, ...args) {
|
|
29365
|
+
const $xeGrid = this;
|
|
29366
|
+
const reactData = $xeGrid;
|
|
28827
29367
|
const {
|
|
28828
29368
|
$refs,
|
|
28829
29369
|
toolbar,
|
|
@@ -28906,6 +29446,9 @@ Object.keys(table.methods).forEach(name => {
|
|
|
28906
29446
|
if (ajaxMethods) {
|
|
28907
29447
|
const isInited = code === '_init';
|
|
28908
29448
|
const isReload = code === 'reload';
|
|
29449
|
+
if (!isInited && reactData.tableLoading) {
|
|
29450
|
+
return $xeGrid.$nextTick();
|
|
29451
|
+
}
|
|
28909
29452
|
let sortList = [];
|
|
28910
29453
|
let filterList = [];
|
|
28911
29454
|
let pageParams = {};
|
|
@@ -29381,30 +29924,6 @@ Object.keys(table.methods).forEach(name => {
|
|
|
29381
29924
|
}
|
|
29382
29925
|
}
|
|
29383
29926
|
},
|
|
29384
|
-
pageChangeEvent(params) {
|
|
29385
|
-
const {
|
|
29386
|
-
proxyConfig,
|
|
29387
|
-
tablePage
|
|
29388
|
-
} = this;
|
|
29389
|
-
const {
|
|
29390
|
-
currentPage,
|
|
29391
|
-
pageSize
|
|
29392
|
-
} = params;
|
|
29393
|
-
tablePage.currentPage = currentPage;
|
|
29394
|
-
tablePage.pageSize = pageSize;
|
|
29395
|
-
this.$emit('page-change', Object.assign({
|
|
29396
|
-
$grid: this
|
|
29397
|
-
}, params));
|
|
29398
|
-
if (proxyConfig) {
|
|
29399
|
-
this.commitProxy('query').then(rest => {
|
|
29400
|
-
this.$emit('proxy-query', {
|
|
29401
|
-
...rest,
|
|
29402
|
-
$grid: this,
|
|
29403
|
-
$event: params.$event
|
|
29404
|
-
});
|
|
29405
|
-
});
|
|
29406
|
-
}
|
|
29407
|
-
},
|
|
29408
29927
|
sortChangeEvent(params) {
|
|
29409
29928
|
const {
|
|
29410
29929
|
$table,
|
|
@@ -29454,9 +29973,14 @@ Object.keys(table.methods).forEach(name => {
|
|
|
29454
29973
|
}, params));
|
|
29455
29974
|
},
|
|
29456
29975
|
submitEvent(params) {
|
|
29976
|
+
const $xeGrid = this;
|
|
29977
|
+
const reactData = $xeGrid;
|
|
29457
29978
|
const {
|
|
29458
29979
|
proxyConfig
|
|
29459
29980
|
} = this;
|
|
29981
|
+
if (reactData.tableLoading) {
|
|
29982
|
+
return;
|
|
29983
|
+
}
|
|
29460
29984
|
if (proxyConfig) {
|
|
29461
29985
|
this.commitProxy('reload').then(rest => {
|
|
29462
29986
|
this.$emit('proxy-query', {
|
|
@@ -29613,7 +30137,8 @@ var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpac
|
|
|
29613
30137
|
const {
|
|
29614
30138
|
getConfig: render_getConfig,
|
|
29615
30139
|
renderer: render_renderer,
|
|
29616
|
-
getI18n: render_getI18n
|
|
30140
|
+
getI18n: render_getI18n,
|
|
30141
|
+
getComponent
|
|
29617
30142
|
} = core_.VxeUI;
|
|
29618
30143
|
const componentDefaultModelProp = 'value';
|
|
29619
30144
|
const defaultCompProps = {};
|
|
@@ -29651,7 +30176,7 @@ function getOldComponent({
|
|
|
29651
30176
|
function getDefaultComponent({
|
|
29652
30177
|
name
|
|
29653
30178
|
}) {
|
|
29654
|
-
return name;
|
|
30179
|
+
return getComponent(name) || name;
|
|
29655
30180
|
}
|
|
29656
30181
|
function handleConfirmFilter(params, checked, option) {
|
|
29657
30182
|
const {
|
|
@@ -30294,6 +30819,69 @@ function handleExportTreeSelectMethod(params) {
|
|
|
30294
30819
|
} = params;
|
|
30295
30820
|
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
|
|
30296
30821
|
}
|
|
30822
|
+
function handleNumberCell(h, renderOpts, params) {
|
|
30823
|
+
const {
|
|
30824
|
+
props = {},
|
|
30825
|
+
showNegativeStatus
|
|
30826
|
+
} = renderOpts;
|
|
30827
|
+
const {
|
|
30828
|
+
row,
|
|
30829
|
+
column
|
|
30830
|
+
} = params;
|
|
30831
|
+
const {
|
|
30832
|
+
type
|
|
30833
|
+
} = props;
|
|
30834
|
+
let cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
30835
|
+
let isNegative = false;
|
|
30836
|
+
if (!isEmptyValue(cellValue)) {
|
|
30837
|
+
const numberInputConfig = render_getConfig().numberInput || {};
|
|
30838
|
+
if (type === 'float') {
|
|
30839
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
30840
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
30841
|
+
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(cellValue, digits), digits);
|
|
30842
|
+
if (!autoFill) {
|
|
30843
|
+
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
30844
|
+
}
|
|
30845
|
+
if (showNegativeStatus) {
|
|
30846
|
+
if (cellValue < 0) {
|
|
30847
|
+
isNegative = true;
|
|
30848
|
+
}
|
|
30849
|
+
}
|
|
30850
|
+
} else if (type === 'amount') {
|
|
30851
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
30852
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
30853
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
30854
|
+
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
30855
|
+
if (showNegativeStatus) {
|
|
30856
|
+
if (cellValue < 0) {
|
|
30857
|
+
isNegative = true;
|
|
30858
|
+
}
|
|
30859
|
+
}
|
|
30860
|
+
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(cellValue, {
|
|
30861
|
+
digits
|
|
30862
|
+
});
|
|
30863
|
+
if (!autoFill) {
|
|
30864
|
+
const [iStr, dStr] = cellValue.split('.');
|
|
30865
|
+
if (dStr) {
|
|
30866
|
+
const dRest = dStr.replace(/0+$/, '');
|
|
30867
|
+
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
30868
|
+
}
|
|
30869
|
+
}
|
|
30870
|
+
if (showCurrency) {
|
|
30871
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
30872
|
+
}
|
|
30873
|
+
} else {
|
|
30874
|
+
if (showNegativeStatus) {
|
|
30875
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue) < 0) {
|
|
30876
|
+
isNegative = true;
|
|
30877
|
+
}
|
|
30878
|
+
}
|
|
30879
|
+
}
|
|
30880
|
+
}
|
|
30881
|
+
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative ? {
|
|
30882
|
+
class: 'is--negative'
|
|
30883
|
+
} : {});
|
|
30884
|
+
}
|
|
30297
30885
|
/**
|
|
30298
30886
|
* 表格 - 渲染器
|
|
30299
30887
|
*/
|
|
@@ -30365,72 +30953,22 @@ render_renderer.mixin({
|
|
|
30365
30953
|
renderTableFilter: defaultFilterRender,
|
|
30366
30954
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
30367
30955
|
},
|
|
30368
|
-
|
|
30369
|
-
|
|
30370
|
-
|
|
30371
|
-
|
|
30372
|
-
const {
|
|
30373
|
-
props = {},
|
|
30374
|
-
showNegativeStatus
|
|
30375
|
-
} = renderOpts;
|
|
30956
|
+
FormatNumberInput: {
|
|
30957
|
+
renderTableDefault: handleNumberCell,
|
|
30958
|
+
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
30959
|
+
tableExportMethod(params) {
|
|
30376
30960
|
const {
|
|
30377
30961
|
row,
|
|
30378
30962
|
column
|
|
30379
30963
|
} = params;
|
|
30380
|
-
const
|
|
30381
|
-
|
|
30382
|
-
|
|
30383
|
-
|
|
30384
|
-
|
|
30385
|
-
|
|
30386
|
-
|
|
30387
|
-
|
|
30388
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
30389
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
30390
|
-
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(cellValue, digits), digits);
|
|
30391
|
-
if (!autoFill) {
|
|
30392
|
-
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
30393
|
-
}
|
|
30394
|
-
if (showNegativeStatus) {
|
|
30395
|
-
if (cellValue < 0) {
|
|
30396
|
-
isNegative = true;
|
|
30397
|
-
}
|
|
30398
|
-
}
|
|
30399
|
-
} else if (type === 'amount') {
|
|
30400
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
30401
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
30402
|
-
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
30403
|
-
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
30404
|
-
if (showNegativeStatus) {
|
|
30405
|
-
if (cellValue < 0) {
|
|
30406
|
-
isNegative = true;
|
|
30407
|
-
}
|
|
30408
|
-
}
|
|
30409
|
-
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(cellValue, {
|
|
30410
|
-
digits
|
|
30411
|
-
});
|
|
30412
|
-
if (!autoFill) {
|
|
30413
|
-
const [iStr, dStr] = cellValue.split('.');
|
|
30414
|
-
if (dStr) {
|
|
30415
|
-
const dRest = dStr.replace(/0+$/, '');
|
|
30416
|
-
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
30417
|
-
}
|
|
30418
|
-
}
|
|
30419
|
-
if (showCurrency) {
|
|
30420
|
-
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
30421
|
-
}
|
|
30422
|
-
} else {
|
|
30423
|
-
if (showNegativeStatus) {
|
|
30424
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue) < 0) {
|
|
30425
|
-
isNegative = true;
|
|
30426
|
-
}
|
|
30427
|
-
}
|
|
30428
|
-
}
|
|
30429
|
-
}
|
|
30430
|
-
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative ? {
|
|
30431
|
-
class: 'is--negative'
|
|
30432
|
-
} : {});
|
|
30433
|
-
},
|
|
30964
|
+
const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
30965
|
+
return cellValue;
|
|
30966
|
+
}
|
|
30967
|
+
},
|
|
30968
|
+
VxeNumberInput: {
|
|
30969
|
+
tableAutoFocus: 'input',
|
|
30970
|
+
renderTableEdit: defaultEditRender,
|
|
30971
|
+
renderTableCell: handleNumberCell,
|
|
30434
30972
|
renderTableFooter(h, renderOpts, params) {
|
|
30435
30973
|
const {
|
|
30436
30974
|
props = {}
|
|
@@ -30567,11 +31105,22 @@ render_renderer.mixin({
|
|
|
30567
31105
|
tableFilterDefaultMethod: handleFilterMethod,
|
|
30568
31106
|
tableExportMethod: handleExportSelectMethod
|
|
30569
31107
|
},
|
|
31108
|
+
/**
|
|
31109
|
+
* 已废弃,被 FormatSelect 替换
|
|
31110
|
+
* @deprecated
|
|
31111
|
+
*/
|
|
30570
31112
|
formatOption: {
|
|
30571
31113
|
renderTableDefault(h, renderOpts, params) {
|
|
30572
31114
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
30573
31115
|
}
|
|
30574
31116
|
},
|
|
31117
|
+
FormatSelect: {
|
|
31118
|
+
renderTableDefault(h, renderOpts, params) {
|
|
31119
|
+
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
31120
|
+
},
|
|
31121
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
31122
|
+
tableExportMethod: handleExportSelectMethod
|
|
31123
|
+
},
|
|
30575
31124
|
VxeTreeSelect: {
|
|
30576
31125
|
tableAutoFocus: 'input',
|
|
30577
31126
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
@@ -30588,11 +31137,21 @@ render_renderer.mixin({
|
|
|
30588
31137
|
},
|
|
30589
31138
|
tableExportMethod: handleExportTreeSelectMethod
|
|
30590
31139
|
},
|
|
31140
|
+
/**
|
|
31141
|
+
* 已废弃,被 FormatTreeSelect 替换
|
|
31142
|
+
* @deprecated
|
|
31143
|
+
*/
|
|
30591
31144
|
formatTree: {
|
|
30592
31145
|
renderTableDefault(h, renderOpts, params) {
|
|
30593
31146
|
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
30594
31147
|
}
|
|
30595
31148
|
},
|
|
31149
|
+
FormatTreeSelect: {
|
|
31150
|
+
renderTableDefault(h, renderOpts, params) {
|
|
31151
|
+
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
31152
|
+
},
|
|
31153
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
31154
|
+
},
|
|
30596
31155
|
VxeColorPicker: {
|
|
30597
31156
|
tableAutoFocus: 'input',
|
|
30598
31157
|
renderTableEdit(h, renderOpts, params) {
|
|
@@ -30935,7 +31494,8 @@ const Toolbar = VxeToolbar;
|
|
|
30935
31494
|
treeNotImp: '树表格不支持导入',
|
|
30936
31495
|
treeCrossDrag: '只能拖拽第一层级',
|
|
30937
31496
|
treeDragChild: '父级不能拖拽到自己的子级中',
|
|
30938
|
-
reqPlugin: '扩展插件未安装 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
31497
|
+
reqPlugin: '扩展插件未安装 "{1}" https://vxeui.com/other{0}/#/{1}/install',
|
|
31498
|
+
errMaxRow: '超过支持的最大数据量 {0} 行,这可能会导致出现错误'
|
|
30939
31499
|
},
|
|
30940
31500
|
table: {
|
|
30941
31501
|
emptyText: '暂无数据',
|
|
@@ -31121,6 +31681,9 @@ const Toolbar = VxeToolbar;
|
|
|
31121
31681
|
fixedRight: '冻结在右侧',
|
|
31122
31682
|
cancelFixed: '取消冻结列'
|
|
31123
31683
|
},
|
|
31684
|
+
datePicker: {
|
|
31685
|
+
yearTitle: '{0} 年'
|
|
31686
|
+
},
|
|
31124
31687
|
input: {
|
|
31125
31688
|
date: {
|
|
31126
31689
|
m1: '01 月',
|
|
@@ -31451,6 +32014,7 @@ const Toolbar = VxeToolbar;
|
|
|
31451
32014
|
},
|
|
31452
32015
|
filterCombination: {
|
|
31453
32016
|
menus: {
|
|
32017
|
+
sort: '排序',
|
|
31454
32018
|
clearSort: '清除排序',
|
|
31455
32019
|
sortAsc: '升序',
|
|
31456
32020
|
sortDesc: '降序',
|
|
@@ -31555,6 +32119,7 @@ const Toolbar = VxeToolbar;
|
|
|
31555
32119
|
},
|
|
31556
32120
|
combination: {
|
|
31557
32121
|
menus: {
|
|
32122
|
+
sort: '排序',
|
|
31558
32123
|
clearSort: '清除排序',
|
|
31559
32124
|
sortAsc: '升序',
|
|
31560
32125
|
sortDesc: '降序',
|
|
@@ -31613,8 +32178,8 @@ core_.VxeUI.setTheme('light');
|
|
|
31613
32178
|
|
|
31614
32179
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
31615
32180
|
if (window.VXETable) {
|
|
31616
|
-
if (!window.
|
|
31617
|
-
window.
|
|
32181
|
+
if (!window.VXETable) {
|
|
32182
|
+
window.VXETable = components_namespaceObject;
|
|
31618
32183
|
}
|
|
31619
32184
|
}
|
|
31620
32185
|
window.Vue.use(components_namespaceObject);
|