vxe-table 4.12.0-beta.19 → 4.12.0-beta.20
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/locale/lang/ar-EG.js +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/id-ID.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +2 -1
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +2 -1
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/table/src/table.js +54 -42
- package/es/table/src/util.js +34 -6
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +57 -28
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +2 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +2 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -1
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +2 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -1
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +59 -43
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +36 -6
- 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/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/id-ID.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +2 -1
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +2 -1
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/src/table.ts +55 -42
- package/packages/table/src/util.ts +38 -6
- /package/es/{iconfont.1742341720101.ttf → iconfont.1742353689933.ttf} +0 -0
- /package/es/{iconfont.1742341720101.woff → iconfont.1742353689933.woff} +0 -0
- /package/es/{iconfont.1742341720101.woff2 → iconfont.1742353689933.woff2} +0 -0
- /package/lib/{iconfont.1742341720101.ttf → iconfont.1742353689933.ttf} +0 -0
- /package/lib/{iconfont.1742341720101.woff → iconfont.1742353689933.woff} +0 -0
- /package/lib/{iconfont.1742341720101.woff2 → iconfont.1742353689933.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -9,7 +9,7 @@ import TableHeaderComponent from './header';
|
|
|
9
9
|
import TableFooterComponent from './footer';
|
|
10
10
|
import tableProps from './props';
|
|
11
11
|
import tableEmits from './emits';
|
|
12
|
-
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth,
|
|
12
|
+
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId } from './util';
|
|
13
13
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
14
14
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
15
15
|
import TableCustomPanelComponent from '../module/custom/panel';
|
|
@@ -18,6 +18,7 @@ import TableImportPanelComponent from '../module/export/import-panel';
|
|
|
18
18
|
import TableExportPanelComponent from '../module/export/export-panel';
|
|
19
19
|
import TableMenuPanelComponent from '../module/menu/panel';
|
|
20
20
|
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI;
|
|
21
|
+
const supportMaxRow = 5e6;
|
|
21
22
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
22
23
|
const maxYHeight = 5e6;
|
|
23
24
|
const maxXWidth = 5e6;
|
|
@@ -2246,6 +2247,7 @@ export default defineComponent({
|
|
|
2246
2247
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2247
2248
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
2248
2249
|
const { checkField, reserve, checkMethod } = checkboxOpts;
|
|
2250
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
2249
2251
|
// indeterminateField 仅支持读取
|
|
2250
2252
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
2251
2253
|
const selectRowMaps = {};
|
|
@@ -2287,7 +2289,8 @@ export default defineComponent({
|
|
|
2287
2289
|
*/
|
|
2288
2290
|
XEUtils.eachTree(afterFullData, (row) => {
|
|
2289
2291
|
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
2290
|
-
|
|
2292
|
+
const rowid = handleGetRowId(row);
|
|
2293
|
+
selectRowMaps[rowid] = row;
|
|
2291
2294
|
}
|
|
2292
2295
|
}, { children: childrenField });
|
|
2293
2296
|
}
|
|
@@ -2298,7 +2301,7 @@ export default defineComponent({
|
|
|
2298
2301
|
*/
|
|
2299
2302
|
if (!isForce && checkMethod) {
|
|
2300
2303
|
XEUtils.eachTree(afterFullData, (row) => {
|
|
2301
|
-
const rowid =
|
|
2304
|
+
const rowid = handleGetRowId(row);
|
|
2302
2305
|
if (checkMethod({ row }) ? 0 : selectCheckboxMaps[rowid]) {
|
|
2303
2306
|
selectRowMaps[rowid] = row;
|
|
2304
2307
|
}
|
|
@@ -2315,7 +2318,7 @@ export default defineComponent({
|
|
|
2315
2318
|
*/
|
|
2316
2319
|
if (!isForce && checkMethod) {
|
|
2317
2320
|
afterFullData.forEach((row) => {
|
|
2318
|
-
const rowid =
|
|
2321
|
+
const rowid = handleGetRowId(row);
|
|
2319
2322
|
if (selectCheckboxMaps[rowid] || checkMethod({ row })) {
|
|
2320
2323
|
selectRowMaps[rowid] = row;
|
|
2321
2324
|
}
|
|
@@ -2323,7 +2326,8 @@ export default defineComponent({
|
|
|
2323
2326
|
}
|
|
2324
2327
|
else {
|
|
2325
2328
|
afterFullData.forEach(row => {
|
|
2326
|
-
|
|
2329
|
+
const rowid = handleGetRowId(row);
|
|
2330
|
+
selectRowMaps[rowid] = row;
|
|
2327
2331
|
});
|
|
2328
2332
|
}
|
|
2329
2333
|
}
|
|
@@ -2335,7 +2339,7 @@ export default defineComponent({
|
|
|
2335
2339
|
*/
|
|
2336
2340
|
if (!isForce && checkMethod) {
|
|
2337
2341
|
afterFullData.forEach((row) => {
|
|
2338
|
-
const rowid =
|
|
2342
|
+
const rowid = handleGetRowId(row);
|
|
2339
2343
|
if (checkMethod({ row }) ? 0 : selectCheckboxMaps[rowid]) {
|
|
2340
2344
|
selectRowMaps[rowid] = row;
|
|
2341
2345
|
}
|
|
@@ -2661,6 +2665,9 @@ export default defineComponent({
|
|
|
2661
2665
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2662
2666
|
let treeData = [];
|
|
2663
2667
|
let fullData = reactive(datas ? datas.slice(0) : []); // 转为响应式数据
|
|
2668
|
+
if (fullData.length > supportMaxRow) {
|
|
2669
|
+
errLog('vxe.error.errMaxRow', [supportMaxRow]);
|
|
2670
|
+
}
|
|
2664
2671
|
if (treeConfig) {
|
|
2665
2672
|
if (transform) {
|
|
2666
2673
|
// 树结构自动转换
|
|
@@ -3147,9 +3154,9 @@ export default defineComponent({
|
|
|
3147
3154
|
handleCheckedAllCheckboxRow(value);
|
|
3148
3155
|
if (evnt) {
|
|
3149
3156
|
dispatchEvent('checkbox-all', {
|
|
3150
|
-
records: $xeTable.getCheckboxRecords(),
|
|
3151
|
-
reserves: $xeTable.getCheckboxReserveRecords(),
|
|
3152
|
-
indeterminates: $xeTable.getCheckboxIndeterminateRecords(),
|
|
3157
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
3158
|
+
reserves: () => $xeTable.getCheckboxReserveRecords(),
|
|
3159
|
+
indeterminates: () => $xeTable.getCheckboxIndeterminateRecords(),
|
|
3153
3160
|
checked: value
|
|
3154
3161
|
}, evnt);
|
|
3155
3162
|
}
|
|
@@ -5205,7 +5212,13 @@ export default defineComponent({
|
|
|
5205
5212
|
visible: false
|
|
5206
5213
|
});
|
|
5207
5214
|
if (visible) {
|
|
5208
|
-
dispatchEvent('filter-visible', {
|
|
5215
|
+
dispatchEvent('filter-visible', {
|
|
5216
|
+
column,
|
|
5217
|
+
property: column.field,
|
|
5218
|
+
field: column.field,
|
|
5219
|
+
filterList: () => $xeTable.getCheckedFilters(),
|
|
5220
|
+
visible: false
|
|
5221
|
+
}, null);
|
|
5209
5222
|
}
|
|
5210
5223
|
return nextTick();
|
|
5211
5224
|
},
|
|
@@ -6867,12 +6880,10 @@ export default defineComponent({
|
|
|
6867
6880
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6868
6881
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
6869
6882
|
const { lazy } = treeOpts;
|
|
6870
|
-
const rowkey = getRowkey($xeTable);
|
|
6871
|
-
const isDeepKey = rowkey.indexOf('.') > -1;
|
|
6872
6883
|
const fullAllDataRowIdMaps = Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
|
|
6873
6884
|
const fullDataRowIdMaps = {};
|
|
6874
6885
|
const treeTempExpandedMaps = Object.assign({}, treeExpandedMaps);
|
|
6875
|
-
const
|
|
6886
|
+
const { handleUpdateRowId } = createHandleUpdateRowId($xeTable);
|
|
6876
6887
|
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
6877
6888
|
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
6878
6889
|
if (!rowRest) {
|
|
@@ -6893,7 +6904,7 @@ export default defineComponent({
|
|
|
6893
6904
|
};
|
|
6894
6905
|
if (treeConfig) {
|
|
6895
6906
|
XEUtils.eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
6896
|
-
const rowid =
|
|
6907
|
+
const rowid = handleUpdateRowId(row);
|
|
6897
6908
|
if (treeConfig && lazy) {
|
|
6898
6909
|
const treeExpRest = treeTempExpandedMaps[rowid];
|
|
6899
6910
|
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
@@ -6910,7 +6921,7 @@ export default defineComponent({
|
|
|
6910
6921
|
}
|
|
6911
6922
|
else {
|
|
6912
6923
|
tableFullData.forEach((row, index, items) => {
|
|
6913
|
-
handleRowCache(row, index, items, index, null,
|
|
6924
|
+
handleRowCache(row, index, items, index, null, handleUpdateRowId(row), 0, index + 1);
|
|
6914
6925
|
});
|
|
6915
6926
|
}
|
|
6916
6927
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
@@ -6920,17 +6931,12 @@ export default defineComponent({
|
|
|
6920
6931
|
cacheSourceMap(fullData) {
|
|
6921
6932
|
const { treeConfig } = props;
|
|
6922
6933
|
const treeOpts = computeTreeOpts.value;
|
|
6923
|
-
let { sourceDataRowIdData } = internalData;
|
|
6924
6934
|
const sourceData = XEUtils.clone(fullData, true);
|
|
6925
|
-
const
|
|
6926
|
-
|
|
6935
|
+
const { handleUpdateRowId } = createHandleUpdateRowId($xeTable);
|
|
6936
|
+
const sourceRowIdData = {};
|
|
6927
6937
|
const handleSourceRow = (row) => {
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
rowid = getRowUniqueId();
|
|
6931
|
-
XEUtils.set(row, rowkey, rowid);
|
|
6932
|
-
}
|
|
6933
|
-
sourceDataRowIdData[rowid] = row;
|
|
6938
|
+
const rowid = handleUpdateRowId(row);
|
|
6939
|
+
sourceRowIdData[rowid] = row;
|
|
6934
6940
|
};
|
|
6935
6941
|
// 源数据缓存
|
|
6936
6942
|
if (treeConfig) {
|
|
@@ -6940,6 +6946,7 @@ export default defineComponent({
|
|
|
6940
6946
|
else {
|
|
6941
6947
|
sourceData.forEach(handleSourceRow);
|
|
6942
6948
|
}
|
|
6949
|
+
internalData.sourceDataRowIdData = sourceRowIdData;
|
|
6943
6950
|
internalData.tableSourceData = sourceData;
|
|
6944
6951
|
},
|
|
6945
6952
|
/**
|
|
@@ -7432,10 +7439,11 @@ export default defineComponent({
|
|
|
7432
7439
|
}
|
|
7433
7440
|
// 树结构
|
|
7434
7441
|
if (treeConfig) {
|
|
7442
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
7435
7443
|
const childRowMaps = {};
|
|
7436
7444
|
const childRowList = [];
|
|
7437
7445
|
XEUtils.eachTree(afterTreeFullData, (row) => {
|
|
7438
|
-
const rowid =
|
|
7446
|
+
const rowid = handleGetRowId(row);
|
|
7439
7447
|
const childList = row[transform ? mapChildrenField : childrenField];
|
|
7440
7448
|
if (childList && childList.length && !childRowMaps[rowid]) {
|
|
7441
7449
|
childRowMaps[rowid] = 1;
|
|
@@ -7451,7 +7459,7 @@ export default defineComponent({
|
|
|
7451
7459
|
let vLen = 0; // 有效行
|
|
7452
7460
|
childList.forEach(checkMethod
|
|
7453
7461
|
? (item) => {
|
|
7454
|
-
const childRowid =
|
|
7462
|
+
const childRowid = handleGetRowId(item);
|
|
7455
7463
|
const isSelect = checkField ? XEUtils.get(item, checkField) : selectRowMaps[childRowid];
|
|
7456
7464
|
if (checkMethod({ row: item })) {
|
|
7457
7465
|
if (isSelect) {
|
|
@@ -7472,7 +7480,7 @@ export default defineComponent({
|
|
|
7472
7480
|
}
|
|
7473
7481
|
}
|
|
7474
7482
|
: item => {
|
|
7475
|
-
const childRowid =
|
|
7483
|
+
const childRowid = handleGetRowId(item);
|
|
7476
7484
|
const isSelect = checkField ? XEUtils.get(item, checkField) : selectRowMaps[childRowid];
|
|
7477
7485
|
if (isSelect) {
|
|
7478
7486
|
sLen++;
|
|
@@ -7521,13 +7529,14 @@ export default defineComponent({
|
|
|
7521
7529
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
7522
7530
|
const { checkField, checkMethod, showReserveStatus } = checkboxOpts;
|
|
7523
7531
|
const { afterFullData, afterTreeFullData, checkboxReserveRowMap } = internalData;
|
|
7532
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
7524
7533
|
let sLen = 0; // 已选
|
|
7525
7534
|
let hLen = 0; // 半选
|
|
7526
7535
|
let vLen = 0; // 有效行
|
|
7527
7536
|
const rootList = (treeConfig ? afterTreeFullData : afterFullData);
|
|
7528
7537
|
rootList.forEach(checkMethod
|
|
7529
7538
|
? row => {
|
|
7530
|
-
const childRowid =
|
|
7539
|
+
const childRowid = handleGetRowId(row);
|
|
7531
7540
|
const selected = checkField ? XEUtils.get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
7532
7541
|
if (checkMethod({ row })) {
|
|
7533
7542
|
if (selected) {
|
|
@@ -7548,7 +7557,7 @@ export default defineComponent({
|
|
|
7548
7557
|
}
|
|
7549
7558
|
}
|
|
7550
7559
|
: row => {
|
|
7551
|
-
const childRowid =
|
|
7560
|
+
const childRowid = handleGetRowId(row);
|
|
7552
7561
|
const selected = checkField ? XEUtils.get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
7553
7562
|
if (selected) {
|
|
7554
7563
|
sLen++;
|
|
@@ -7584,6 +7593,7 @@ export default defineComponent({
|
|
|
7584
7593
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
7585
7594
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
7586
7595
|
const { checkField, checkStrictly, checkMethod } = checkboxOpts;
|
|
7596
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
7587
7597
|
// indeterminateField 仅支持读取
|
|
7588
7598
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
7589
7599
|
if (checkField) {
|
|
@@ -7618,7 +7628,7 @@ export default defineComponent({
|
|
|
7618
7628
|
if (treeConfig && !checkStrictly) {
|
|
7619
7629
|
// 更新子节点状态
|
|
7620
7630
|
XEUtils.eachTree(rows, (row) => {
|
|
7621
|
-
const rowid =
|
|
7631
|
+
const rowid = handleGetRowId(row);
|
|
7622
7632
|
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
7623
7633
|
if (checked) {
|
|
7624
7634
|
selectRowMaps[rowid] = row;
|
|
@@ -7636,7 +7646,7 @@ export default defineComponent({
|
|
|
7636
7646
|
}
|
|
7637
7647
|
// 列表
|
|
7638
7648
|
rows.forEach(row => {
|
|
7639
|
-
const rowid =
|
|
7649
|
+
const rowid = handleGetRowId(row);
|
|
7640
7650
|
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
7641
7651
|
if (checked) {
|
|
7642
7652
|
if (!selectRowMaps[rowid]) {
|
|
@@ -7945,36 +7955,38 @@ export default defineComponent({
|
|
|
7945
7955
|
}
|
|
7946
7956
|
},
|
|
7947
7957
|
triggerCheckRowEvent(evnt, params, checked) {
|
|
7948
|
-
const checkboxOpts = computeCheckboxOpts.value;
|
|
7949
7958
|
const { row } = params;
|
|
7950
7959
|
const { afterFullData } = internalData;
|
|
7960
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
7951
7961
|
const { checkMethod, trigger } = checkboxOpts;
|
|
7952
7962
|
if (trigger === 'manual') {
|
|
7953
7963
|
return;
|
|
7954
7964
|
}
|
|
7955
7965
|
evnt.stopPropagation();
|
|
7956
7966
|
if (checkboxOpts.isShiftKey && evnt.shiftKey && !props.treeConfig) {
|
|
7957
|
-
const checkboxRecords =
|
|
7967
|
+
const checkboxRecords = $xeTable.getCheckboxRecords();
|
|
7958
7968
|
if (checkboxRecords.length) {
|
|
7959
7969
|
const firstRow = checkboxRecords[0];
|
|
7960
|
-
const _rowIndex =
|
|
7961
|
-
const _firstRowIndex =
|
|
7970
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
7971
|
+
const _firstRowIndex = $xeTable.getVTRowIndex(firstRow);
|
|
7962
7972
|
if (_rowIndex !== _firstRowIndex) {
|
|
7963
|
-
|
|
7973
|
+
$xeTable.setAllCheckboxRow(false);
|
|
7964
7974
|
const rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1);
|
|
7965
|
-
|
|
7975
|
+
nextTick(() => {
|
|
7976
|
+
handleCheckedCheckboxRow(rangeRows, true, false);
|
|
7977
|
+
});
|
|
7966
7978
|
dispatchEvent('checkbox-range-select', Object.assign({ rangeRecords: rangeRows }, params), evnt);
|
|
7967
7979
|
return;
|
|
7968
7980
|
}
|
|
7969
7981
|
}
|
|
7970
7982
|
}
|
|
7971
7983
|
if (!checkMethod || checkMethod({ row })) {
|
|
7972
|
-
|
|
7973
|
-
|
|
7984
|
+
$xeTable.handleBatchSelectRows([row], checked);
|
|
7985
|
+
$xeTable.checkSelectionStatus();
|
|
7974
7986
|
dispatchEvent('checkbox-change', Object.assign({
|
|
7975
|
-
records:
|
|
7976
|
-
reserves:
|
|
7977
|
-
indeterminates:
|
|
7987
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
7988
|
+
reserves: () => $xeTable.getCheckboxReserveRecords(),
|
|
7989
|
+
indeterminates: () => $xeTable.getCheckboxIndeterminateRecords(),
|
|
7978
7990
|
checked
|
|
7979
7991
|
}, params), evnt);
|
|
7980
7992
|
}
|
package/es/table/src/util.js
CHANGED
|
@@ -99,23 +99,51 @@ export function getRowid($xeTable, row) {
|
|
|
99
99
|
const rowid = XEUtils.get(row, getRowkey($xeTable));
|
|
100
100
|
return encodeRowid(rowid);
|
|
101
101
|
}
|
|
102
|
+
export function createHandleUpdateRowId($xeTable) {
|
|
103
|
+
const rowKey = getRowkey($xeTable);
|
|
104
|
+
const isDeepKey = rowKey.indexOf('.') > -1;
|
|
105
|
+
const updateRId = isDeepKey ? updateDeepRowKey : updateFastRowKey;
|
|
106
|
+
return {
|
|
107
|
+
rowKey,
|
|
108
|
+
handleUpdateRowId(row) {
|
|
109
|
+
return updateRId(row, rowKey);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export function createHandleGetRowId($xeTable) {
|
|
114
|
+
const rowKey = getRowkey($xeTable);
|
|
115
|
+
const isDeepKey = rowKey.indexOf('.') > -1;
|
|
116
|
+
const getRId = isDeepKey ? getDeepRowIdByKey : getFastRowIdByKey;
|
|
117
|
+
return {
|
|
118
|
+
rowKey,
|
|
119
|
+
handleGetRowId(row) {
|
|
120
|
+
return getRId(row, rowKey);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
102
124
|
// 编码行主键
|
|
103
125
|
export function encodeRowid(rowVal) {
|
|
104
126
|
return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
|
|
105
127
|
}
|
|
106
|
-
|
|
107
|
-
|
|
128
|
+
function getDeepRowIdByKey(row, rowKey) {
|
|
129
|
+
return XEUtils.get(row, rowKey);
|
|
130
|
+
}
|
|
131
|
+
export function updateDeepRowKey(row, rowKey) {
|
|
132
|
+
let rowid = getDeepRowIdByKey(row, rowKey);
|
|
108
133
|
if (eqEmptyValue(rowid)) {
|
|
109
134
|
rowid = getRowUniqueId();
|
|
110
|
-
XEUtils.set(row,
|
|
135
|
+
XEUtils.set(row, rowKey, rowid);
|
|
111
136
|
}
|
|
112
137
|
return rowid;
|
|
113
138
|
}
|
|
114
|
-
|
|
115
|
-
|
|
139
|
+
function getFastRowIdByKey(row, rowKey) {
|
|
140
|
+
return row[rowKey];
|
|
141
|
+
}
|
|
142
|
+
export function updateFastRowKey(row, rowKey) {
|
|
143
|
+
let rowid = getFastRowIdByKey(row, rowKey);
|
|
116
144
|
if (eqEmptyValue(rowid)) {
|
|
117
145
|
rowid = getRowUniqueId();
|
|
118
|
-
row[
|
|
146
|
+
row[rowKey] = rowid;
|
|
119
147
|
}
|
|
120
148
|
return rowid;
|
|
121
149
|
}
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED