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
|
@@ -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'
|
|
@@ -23,6 +23,7 @@ import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, Ta
|
|
|
23
23
|
|
|
24
24
|
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
|
|
25
25
|
|
|
26
|
+
const supportMaxRow = 5e6
|
|
26
27
|
const customStorageKey = 'VXE_CUSTOM_STORE'
|
|
27
28
|
const maxYHeight = 5e6
|
|
28
29
|
const maxXWidth = 5e6
|
|
@@ -2377,9 +2378,11 @@ export default defineComponent({
|
|
|
2377
2378
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
2378
2379
|
const checkboxOpts = computeCheckboxOpts.value
|
|
2379
2380
|
const { checkField, reserve, checkMethod } = checkboxOpts
|
|
2381
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
2380
2382
|
// indeterminateField 仅支持读取
|
|
2381
2383
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField
|
|
2382
2384
|
const selectRowMaps: Record<string, any> = {}
|
|
2385
|
+
|
|
2383
2386
|
/**
|
|
2384
2387
|
* 绑定属性方式(高性能,有污染)
|
|
2385
2388
|
* 必须在行数据存在对应的属性,否则将不响应
|
|
@@ -2416,7 +2419,8 @@ export default defineComponent({
|
|
|
2416
2419
|
*/
|
|
2417
2420
|
XEUtils.eachTree(afterFullData, (row) => {
|
|
2418
2421
|
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
2419
|
-
|
|
2422
|
+
const rowid = handleGetRowId(row)
|
|
2423
|
+
selectRowMaps[rowid] = row
|
|
2420
2424
|
}
|
|
2421
2425
|
}, { children: childrenField })
|
|
2422
2426
|
} else {
|
|
@@ -2426,7 +2430,7 @@ export default defineComponent({
|
|
|
2426
2430
|
*/
|
|
2427
2431
|
if (!isForce && checkMethod) {
|
|
2428
2432
|
XEUtils.eachTree(afterFullData, (row) => {
|
|
2429
|
-
const rowid =
|
|
2433
|
+
const rowid = handleGetRowId(row)
|
|
2430
2434
|
if (checkMethod({ row }) ? 0 : selectCheckboxMaps[rowid]) {
|
|
2431
2435
|
selectRowMaps[rowid] = row
|
|
2432
2436
|
}
|
|
@@ -2442,14 +2446,15 @@ export default defineComponent({
|
|
|
2442
2446
|
*/
|
|
2443
2447
|
if (!isForce && checkMethod) {
|
|
2444
2448
|
afterFullData.forEach((row) => {
|
|
2445
|
-
const rowid =
|
|
2449
|
+
const rowid = handleGetRowId(row)
|
|
2446
2450
|
if (selectCheckboxMaps[rowid] || checkMethod({ row })) {
|
|
2447
2451
|
selectRowMaps[rowid] = row
|
|
2448
2452
|
}
|
|
2449
2453
|
})
|
|
2450
2454
|
} else {
|
|
2451
2455
|
afterFullData.forEach(row => {
|
|
2452
|
-
|
|
2456
|
+
const rowid = handleGetRowId(row)
|
|
2457
|
+
selectRowMaps[rowid] = row
|
|
2453
2458
|
})
|
|
2454
2459
|
}
|
|
2455
2460
|
} else {
|
|
@@ -2460,7 +2465,7 @@ export default defineComponent({
|
|
|
2460
2465
|
*/
|
|
2461
2466
|
if (!isForce && checkMethod) {
|
|
2462
2467
|
afterFullData.forEach((row) => {
|
|
2463
|
-
const rowid =
|
|
2468
|
+
const rowid = handleGetRowId(row)
|
|
2464
2469
|
if (checkMethod({ row }) ? 0 : selectCheckboxMaps[rowid]) {
|
|
2465
2470
|
selectRowMaps[rowid] = row
|
|
2466
2471
|
}
|
|
@@ -2792,6 +2797,9 @@ export default defineComponent({
|
|
|
2792
2797
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
2793
2798
|
let treeData = []
|
|
2794
2799
|
let fullData = reactive(datas ? datas.slice(0) : []) // 转为响应式数据
|
|
2800
|
+
if (fullData.length > supportMaxRow) {
|
|
2801
|
+
errLog('vxe.error.errMaxRow', [supportMaxRow])
|
|
2802
|
+
}
|
|
2795
2803
|
if (treeConfig) {
|
|
2796
2804
|
if (transform) {
|
|
2797
2805
|
// 树结构自动转换
|
|
@@ -3286,9 +3294,9 @@ export default defineComponent({
|
|
|
3286
3294
|
handleCheckedAllCheckboxRow(value)
|
|
3287
3295
|
if (evnt) {
|
|
3288
3296
|
dispatchEvent('checkbox-all', {
|
|
3289
|
-
records: $xeTable.getCheckboxRecords(),
|
|
3290
|
-
reserves: $xeTable.getCheckboxReserveRecords(),
|
|
3291
|
-
indeterminates: $xeTable.getCheckboxIndeterminateRecords(),
|
|
3297
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
3298
|
+
reserves: () => $xeTable.getCheckboxReserveRecords(),
|
|
3299
|
+
indeterminates: () => $xeTable.getCheckboxIndeterminateRecords(),
|
|
3292
3300
|
checked: value
|
|
3293
3301
|
}, evnt)
|
|
3294
3302
|
}
|
|
@@ -5339,7 +5347,13 @@ export default defineComponent({
|
|
|
5339
5347
|
visible: false
|
|
5340
5348
|
})
|
|
5341
5349
|
if (visible) {
|
|
5342
|
-
dispatchEvent('filter-visible', {
|
|
5350
|
+
dispatchEvent('filter-visible', {
|
|
5351
|
+
column,
|
|
5352
|
+
property: column.field,
|
|
5353
|
+
field: column.field,
|
|
5354
|
+
filterList: () => $xeTable.getCheckedFilters(),
|
|
5355
|
+
visible: false
|
|
5356
|
+
}, null)
|
|
5343
5357
|
}
|
|
5344
5358
|
return nextTick()
|
|
5345
5359
|
},
|
|
@@ -6983,13 +6997,11 @@ export default defineComponent({
|
|
|
6983
6997
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
6984
6998
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
6985
6999
|
const { lazy } = treeOpts
|
|
6986
|
-
const rowkey = getRowkey($xeTable)
|
|
6987
|
-
const isDeepKey = rowkey.indexOf('.') > -1
|
|
6988
7000
|
const fullAllDataRowIdMaps: Record<string, VxeTableDefines.RowCacheItem> = { ...fullAllDataRowIdData } // 存在已删除数据
|
|
6989
7001
|
const fullDataRowIdMaps: Record<string, VxeTableDefines.RowCacheItem> = {}
|
|
6990
7002
|
const treeTempExpandedMaps = { ...treeExpandedMaps }
|
|
6991
7003
|
|
|
6992
|
-
const
|
|
7004
|
+
const { handleUpdateRowId } = createHandleUpdateRowId($xeTable)
|
|
6993
7005
|
const handleRowCache = (row: any, index: number, items: any, currIndex: number, parentRow: any, rowid: string, level: number, seq: string | number) => {
|
|
6994
7006
|
let rowRest = fullAllDataRowIdMaps[rowid]
|
|
6995
7007
|
if (!rowRest) {
|
|
@@ -7013,7 +7025,7 @@ export default defineComponent({
|
|
|
7013
7025
|
|
|
7014
7026
|
if (treeConfig) {
|
|
7015
7027
|
XEUtils.eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
7016
|
-
const rowid =
|
|
7028
|
+
const rowid = handleUpdateRowId(row)
|
|
7017
7029
|
if (treeConfig && lazy) {
|
|
7018
7030
|
const treeExpRest = treeTempExpandedMaps[rowid]
|
|
7019
7031
|
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
@@ -7029,7 +7041,7 @@ export default defineComponent({
|
|
|
7029
7041
|
}, { children: childrenField })
|
|
7030
7042
|
} else {
|
|
7031
7043
|
tableFullData.forEach((row, index, items) => {
|
|
7032
|
-
handleRowCache(row, index, items, index, null,
|
|
7044
|
+
handleRowCache(row, index, items, index, null, handleUpdateRowId(row), 0, index + 1)
|
|
7033
7045
|
})
|
|
7034
7046
|
}
|
|
7035
7047
|
|
|
@@ -7040,17 +7052,12 @@ export default defineComponent({
|
|
|
7040
7052
|
cacheSourceMap (fullData) {
|
|
7041
7053
|
const { treeConfig } = props
|
|
7042
7054
|
const treeOpts = computeTreeOpts.value
|
|
7043
|
-
let { sourceDataRowIdData } = internalData
|
|
7044
7055
|
const sourceData = XEUtils.clone(fullData, true)
|
|
7045
|
-
const
|
|
7046
|
-
|
|
7056
|
+
const { handleUpdateRowId } = createHandleUpdateRowId($xeTable)
|
|
7057
|
+
const sourceRowIdData: Record<string, any> = {}
|
|
7047
7058
|
const handleSourceRow = (row: any) => {
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
rowid = getRowUniqueId()
|
|
7051
|
-
XEUtils.set(row, rowkey, rowid)
|
|
7052
|
-
}
|
|
7053
|
-
sourceDataRowIdData[rowid] = row
|
|
7059
|
+
const rowid = handleUpdateRowId(row)
|
|
7060
|
+
sourceRowIdData[rowid] = row
|
|
7054
7061
|
}
|
|
7055
7062
|
// 源数据缓存
|
|
7056
7063
|
if (treeConfig) {
|
|
@@ -7059,6 +7066,7 @@ export default defineComponent({
|
|
|
7059
7066
|
} else {
|
|
7060
7067
|
sourceData.forEach(handleSourceRow)
|
|
7061
7068
|
}
|
|
7069
|
+
internalData.sourceDataRowIdData = sourceRowIdData
|
|
7062
7070
|
internalData.tableSourceData = sourceData
|
|
7063
7071
|
},
|
|
7064
7072
|
/**
|
|
@@ -7545,10 +7553,11 @@ export default defineComponent({
|
|
|
7545
7553
|
}
|
|
7546
7554
|
// 树结构
|
|
7547
7555
|
if (treeConfig) {
|
|
7556
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
7548
7557
|
const childRowMaps: Record<string, number> = {}
|
|
7549
7558
|
const childRowList: any[][] = []
|
|
7550
7559
|
XEUtils.eachTree(afterTreeFullData, (row) => {
|
|
7551
|
-
const rowid =
|
|
7560
|
+
const rowid = handleGetRowId(row)
|
|
7552
7561
|
const childList = row[transform ? mapChildrenField : childrenField]
|
|
7553
7562
|
if (childList && childList.length && !childRowMaps[rowid]) {
|
|
7554
7563
|
childRowMaps[rowid] = 1
|
|
@@ -7565,7 +7574,7 @@ export default defineComponent({
|
|
|
7565
7574
|
childList.forEach(
|
|
7566
7575
|
checkMethod
|
|
7567
7576
|
? (item) => {
|
|
7568
|
-
const childRowid =
|
|
7577
|
+
const childRowid = handleGetRowId(item)
|
|
7569
7578
|
const isSelect = checkField ? XEUtils.get(item, checkField) : selectRowMaps[childRowid]
|
|
7570
7579
|
if (checkMethod({ row: item })) {
|
|
7571
7580
|
if (isSelect) {
|
|
@@ -7583,7 +7592,7 @@ export default defineComponent({
|
|
|
7583
7592
|
}
|
|
7584
7593
|
}
|
|
7585
7594
|
: item => {
|
|
7586
|
-
const childRowid =
|
|
7595
|
+
const childRowid = handleGetRowId(item)
|
|
7587
7596
|
const isSelect = checkField ? XEUtils.get(item, checkField) : selectRowMaps[childRowid]
|
|
7588
7597
|
if (isSelect) {
|
|
7589
7598
|
sLen++
|
|
@@ -7630,6 +7639,7 @@ export default defineComponent({
|
|
|
7630
7639
|
const checkboxOpts = computeCheckboxOpts.value
|
|
7631
7640
|
const { checkField, checkMethod, showReserveStatus } = checkboxOpts
|
|
7632
7641
|
const { afterFullData, afterTreeFullData, checkboxReserveRowMap } = internalData
|
|
7642
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
7633
7643
|
|
|
7634
7644
|
let sLen = 0 // 已选
|
|
7635
7645
|
let hLen = 0 // 半选
|
|
@@ -7638,7 +7648,7 @@ export default defineComponent({
|
|
|
7638
7648
|
const rootList = (treeConfig ? afterTreeFullData : afterFullData)
|
|
7639
7649
|
rootList.forEach(checkMethod
|
|
7640
7650
|
? row => {
|
|
7641
|
-
const childRowid =
|
|
7651
|
+
const childRowid = handleGetRowId(row)
|
|
7642
7652
|
const selected = checkField ? XEUtils.get(row, checkField) : selectCheckboxMaps[childRowid]
|
|
7643
7653
|
if (checkMethod({ row })) {
|
|
7644
7654
|
if (selected) {
|
|
@@ -7656,7 +7666,7 @@ export default defineComponent({
|
|
|
7656
7666
|
}
|
|
7657
7667
|
}
|
|
7658
7668
|
: row => {
|
|
7659
|
-
const childRowid =
|
|
7669
|
+
const childRowid = handleGetRowId(row)
|
|
7660
7670
|
const selected = checkField ? XEUtils.get(row, checkField) : selectCheckboxMaps[childRowid]
|
|
7661
7671
|
if (selected) {
|
|
7662
7672
|
sLen++
|
|
@@ -7694,6 +7704,7 @@ export default defineComponent({
|
|
|
7694
7704
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
7695
7705
|
const checkboxOpts = computeCheckboxOpts.value
|
|
7696
7706
|
const { checkField, checkStrictly, checkMethod } = checkboxOpts
|
|
7707
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
7697
7708
|
// indeterminateField 仅支持读取
|
|
7698
7709
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField
|
|
7699
7710
|
if (checkField) {
|
|
@@ -7728,7 +7739,7 @@ export default defineComponent({
|
|
|
7728
7739
|
if (treeConfig && !checkStrictly) {
|
|
7729
7740
|
// 更新子节点状态
|
|
7730
7741
|
XEUtils.eachTree(rows, (row) => {
|
|
7731
|
-
const rowid =
|
|
7742
|
+
const rowid = handleGetRowId(row)
|
|
7732
7743
|
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
7733
7744
|
if (checked) {
|
|
7734
7745
|
selectRowMaps[rowid] = row
|
|
@@ -7746,7 +7757,7 @@ export default defineComponent({
|
|
|
7746
7757
|
|
|
7747
7758
|
// 列表
|
|
7748
7759
|
rows.forEach(row => {
|
|
7749
|
-
const rowid =
|
|
7760
|
+
const rowid = handleGetRowId(row)
|
|
7750
7761
|
if (isForce || (!checkMethod || checkMethod({ row }))) {
|
|
7751
7762
|
if (checked) {
|
|
7752
7763
|
if (!selectRowMaps[rowid]) {
|
|
@@ -8047,36 +8058,38 @@ export default defineComponent({
|
|
|
8047
8058
|
}
|
|
8048
8059
|
},
|
|
8049
8060
|
triggerCheckRowEvent (evnt: MouseEvent, params, checked) {
|
|
8050
|
-
const checkboxOpts = computeCheckboxOpts.value
|
|
8051
8061
|
const { row } = params
|
|
8052
8062
|
const { afterFullData } = internalData
|
|
8063
|
+
const checkboxOpts = computeCheckboxOpts.value
|
|
8053
8064
|
const { checkMethod, trigger } = checkboxOpts
|
|
8054
8065
|
if (trigger === 'manual') {
|
|
8055
8066
|
return
|
|
8056
8067
|
}
|
|
8057
8068
|
evnt.stopPropagation()
|
|
8058
8069
|
if (checkboxOpts.isShiftKey && evnt.shiftKey && !props.treeConfig) {
|
|
8059
|
-
const checkboxRecords =
|
|
8070
|
+
const checkboxRecords = $xeTable.getCheckboxRecords()
|
|
8060
8071
|
if (checkboxRecords.length) {
|
|
8061
8072
|
const firstRow = checkboxRecords[0]
|
|
8062
|
-
const _rowIndex =
|
|
8063
|
-
const _firstRowIndex =
|
|
8073
|
+
const _rowIndex = $xeTable.getVTRowIndex(row)
|
|
8074
|
+
const _firstRowIndex = $xeTable.getVTRowIndex(firstRow)
|
|
8064
8075
|
if (_rowIndex !== _firstRowIndex) {
|
|
8065
|
-
|
|
8076
|
+
$xeTable.setAllCheckboxRow(false)
|
|
8066
8077
|
const rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1)
|
|
8067
|
-
|
|
8078
|
+
nextTick(() => {
|
|
8079
|
+
handleCheckedCheckboxRow(rangeRows, true, false)
|
|
8080
|
+
})
|
|
8068
8081
|
dispatchEvent('checkbox-range-select', Object.assign({ rangeRecords: rangeRows }, params), evnt)
|
|
8069
8082
|
return
|
|
8070
8083
|
}
|
|
8071
8084
|
}
|
|
8072
8085
|
}
|
|
8073
8086
|
if (!checkMethod || checkMethod({ row })) {
|
|
8074
|
-
|
|
8075
|
-
|
|
8087
|
+
$xeTable.handleBatchSelectRows([row], checked)
|
|
8088
|
+
$xeTable.checkSelectionStatus()
|
|
8076
8089
|
dispatchEvent('checkbox-change', Object.assign({
|
|
8077
|
-
records:
|
|
8078
|
-
reserves:
|
|
8079
|
-
indeterminates:
|
|
8090
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
8091
|
+
reserves: () => $xeTable.getCheckboxReserveRecords(),
|
|
8092
|
+
indeterminates: () => $xeTable.getCheckboxIndeterminateRecords(),
|
|
8080
8093
|
checked
|
|
8081
8094
|
}, params), evnt)
|
|
8082
8095
|
}
|
|
@@ -112,25 +112,57 @@ export function getRowid ($xeTable: VxeTableConstructor, row: any) {
|
|
|
112
112
|
return encodeRowid(rowid)
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
export function createHandleUpdateRowId ($xeTable: VxeTableConstructor) {
|
|
116
|
+
const rowKey = getRowkey($xeTable)
|
|
117
|
+
const isDeepKey = rowKey.indexOf('.') > -1
|
|
118
|
+
const updateRId = isDeepKey ? updateDeepRowKey : updateFastRowKey
|
|
119
|
+
return {
|
|
120
|
+
rowKey,
|
|
121
|
+
handleUpdateRowId (row: any) {
|
|
122
|
+
return updateRId(row, rowKey)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function createHandleGetRowId ($xeTable: VxeTableConstructor) {
|
|
128
|
+
const rowKey = getRowkey($xeTable)
|
|
129
|
+
const isDeepKey = rowKey.indexOf('.') > -1
|
|
130
|
+
const getRId = isDeepKey ? getDeepRowIdByKey : getFastRowIdByKey
|
|
131
|
+
return {
|
|
132
|
+
rowKey,
|
|
133
|
+
handleGetRowId (row: any) {
|
|
134
|
+
return getRId(row, rowKey)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
115
139
|
// 编码行主键
|
|
116
140
|
export function encodeRowid (rowVal: string) {
|
|
117
141
|
return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal)
|
|
118
142
|
}
|
|
119
143
|
|
|
120
|
-
|
|
121
|
-
|
|
144
|
+
function getDeepRowIdByKey (row: any, rowKey: string) {
|
|
145
|
+
return XEUtils.get(row, rowKey)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function updateDeepRowKey (row: any, rowKey: string) {
|
|
149
|
+
let rowid = getDeepRowIdByKey(row, rowKey)
|
|
122
150
|
if (eqEmptyValue(rowid)) {
|
|
123
151
|
rowid = getRowUniqueId()
|
|
124
|
-
XEUtils.set(row,
|
|
152
|
+
XEUtils.set(row, rowKey, rowid)
|
|
125
153
|
}
|
|
126
154
|
return rowid
|
|
127
155
|
}
|
|
128
156
|
|
|
129
|
-
|
|
130
|
-
|
|
157
|
+
function getFastRowIdByKey (row: any, rowKey: string) {
|
|
158
|
+
return row[rowKey]
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function updateFastRowKey (row: any, rowKey: string) {
|
|
162
|
+
let rowid = getFastRowIdByKey(row, rowKey)
|
|
131
163
|
if (eqEmptyValue(rowid)) {
|
|
132
164
|
rowid = getRowUniqueId()
|
|
133
|
-
row[
|
|
165
|
+
row[rowKey] = rowid
|
|
134
166
|
}
|
|
135
167
|
return rowid
|
|
136
168
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|