vxe-table 3.12.13 → 3.12.15
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +36 -21
- package/es/table/module/export/mixin.js +3 -2
- package/es/table/module/validator/mixin.js +18 -1
- package/es/table/render/index.js +104 -43
- package/es/table/src/body.js +1 -0
- package/es/table/src/header.js +4 -2
- package/es/table/src/methods.js +158 -116
- package/es/table/src/table.js +44 -7
- package/es/table/style.css +33 -2
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +33 -2
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +434 -248
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +42 -21
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +3 -2
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +26 -4
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +109 -41
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +1 -0
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/header.js +4 -2
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +207 -169
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +40 -7
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +33 -2
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +33 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +42 -21
- package/packages/table/module/export/mixin.ts +3 -2
- package/packages/table/module/validator/mixin.ts +20 -2
- package/packages/table/render/index.ts +120 -51
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/header.ts +4 -2
- package/packages/table/src/methods.ts +169 -114
- package/packages/table/src/table.ts +47 -7
- package/styles/components/table.scss +31 -2
- /package/es/{iconfont.1739152166680.ttf → iconfont.1739257460253.ttf} +0 -0
- /package/es/{iconfont.1739152166680.woff → iconfont.1739257460253.woff} +0 -0
- /package/es/{iconfont.1739152166680.woff2 → iconfont.1739257460253.woff2} +0 -0
- /package/lib/{iconfont.1739152166680.ttf → iconfont.1739257460253.ttf} +0 -0
- /package/lib/{iconfont.1739152166680.woff → iconfont.1739257460253.woff} +0 -0
- /package/lib/{iconfont.1739152166680.woff2 → iconfont.1739257460253.woff2} +0 -0
package/lib/table/src/methods.js
CHANGED
|
@@ -1263,7 +1263,7 @@ const calcCellHeight = $xeTable => {
|
|
|
1263
1263
|
reactData.calcCellHeightFlag++;
|
|
1264
1264
|
}
|
|
1265
1265
|
};
|
|
1266
|
-
function getOrderField(
|
|
1266
|
+
function getOrderField($xeTable, column) {
|
|
1267
1267
|
const {
|
|
1268
1268
|
sortBy,
|
|
1269
1269
|
sortType
|
|
@@ -1276,7 +1276,7 @@ function getOrderField(_vm, column) {
|
|
|
1276
1276
|
column
|
|
1277
1277
|
}) : _xeUtils.default.get(row, sortBy);
|
|
1278
1278
|
} else {
|
|
1279
|
-
cellValue =
|
|
1279
|
+
cellValue = $xeTable.getCellLabel(row, column);
|
|
1280
1280
|
}
|
|
1281
1281
|
if (!sortType || sortType === 'auto') {
|
|
1282
1282
|
return isNaN(cellValue) ? cellValue : _xeUtils.default.toNumber(cellValue);
|
|
@@ -3336,15 +3336,26 @@ const Methods = {
|
|
|
3336
3336
|
*/
|
|
3337
3337
|
updateAfterFullData() {
|
|
3338
3338
|
const $xeTable = this;
|
|
3339
|
+
const props = $xeTable;
|
|
3340
|
+
const internalData = $xeTable;
|
|
3341
|
+
const {
|
|
3342
|
+
treeConfig
|
|
3343
|
+
} = props;
|
|
3339
3344
|
const {
|
|
3340
3345
|
tableFullColumn,
|
|
3341
3346
|
tableFullData,
|
|
3342
|
-
filterOpts,
|
|
3343
|
-
sortOpts,
|
|
3344
|
-
treeConfig,
|
|
3345
|
-
treeOpts,
|
|
3346
3347
|
tableFullTreeData
|
|
3347
|
-
} =
|
|
3348
|
+
} = internalData;
|
|
3349
|
+
const filterOpts = $xeTable.computeFilterOpts;
|
|
3350
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
3351
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
3352
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
3353
|
+
const {
|
|
3354
|
+
transform,
|
|
3355
|
+
rowField,
|
|
3356
|
+
parentField,
|
|
3357
|
+
mapChildrenField
|
|
3358
|
+
} = treeOpts;
|
|
3348
3359
|
const {
|
|
3349
3360
|
remote: allRemoteFilter,
|
|
3350
3361
|
filterMethod: allFilterMethod
|
|
@@ -3355,63 +3366,61 @@ const Methods = {
|
|
|
3355
3366
|
multiple: sortMultiple,
|
|
3356
3367
|
chronological
|
|
3357
3368
|
} = sortOpts;
|
|
3358
|
-
const {
|
|
3359
|
-
transform
|
|
3360
|
-
} = treeOpts;
|
|
3361
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
3362
3369
|
let tableData = [];
|
|
3363
3370
|
let tableTree = [];
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3371
|
+
// 处理数据
|
|
3372
|
+
if (!allRemoteFilter || !allRemoteSort) {
|
|
3373
|
+
const filterColumns = [];
|
|
3374
|
+
let orderColumns = [];
|
|
3375
|
+
tableFullColumn.forEach(column => {
|
|
3376
|
+
const {
|
|
3377
|
+
field,
|
|
3378
|
+
sortable,
|
|
3379
|
+
order,
|
|
3380
|
+
filters
|
|
3381
|
+
} = column;
|
|
3382
|
+
if (!allRemoteFilter && filters && filters.length) {
|
|
3383
|
+
const valueList = [];
|
|
3384
|
+
const itemList = [];
|
|
3385
|
+
filters.forEach(item => {
|
|
3386
|
+
if (item.checked) {
|
|
3387
|
+
itemList.push(item);
|
|
3388
|
+
valueList.push(item.value);
|
|
3389
|
+
}
|
|
3390
|
+
});
|
|
3391
|
+
if (itemList.length) {
|
|
3392
|
+
filterColumns.push({
|
|
3393
|
+
column,
|
|
3394
|
+
valueList,
|
|
3395
|
+
itemList
|
|
3396
|
+
});
|
|
3380
3397
|
}
|
|
3381
|
-
}
|
|
3382
|
-
if (
|
|
3383
|
-
|
|
3398
|
+
}
|
|
3399
|
+
if (!allRemoteSort && sortable && order) {
|
|
3400
|
+
orderColumns.push({
|
|
3384
3401
|
column,
|
|
3385
|
-
|
|
3386
|
-
|
|
3402
|
+
field,
|
|
3403
|
+
property: field,
|
|
3404
|
+
order: order,
|
|
3405
|
+
sortTime: column.sortTime
|
|
3387
3406
|
});
|
|
3388
3407
|
}
|
|
3389
|
-
}
|
|
3390
|
-
if (
|
|
3391
|
-
orderColumns.
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
}
|
|
3403
|
-
if (filterColumns.length) {
|
|
3404
|
-
const handleFilter = row => {
|
|
3405
|
-
return filterColumns.every(({
|
|
3406
|
-
column,
|
|
3407
|
-
valueList,
|
|
3408
|
-
itemList
|
|
3409
|
-
}) => {
|
|
3410
|
-
if (valueList.length && !allRemoteFilter) {
|
|
3408
|
+
});
|
|
3409
|
+
if (sortMultiple && chronological && orderColumns.length > 1) {
|
|
3410
|
+
orderColumns = _xeUtils.default.orderBy(orderColumns, 'sortTime');
|
|
3411
|
+
}
|
|
3412
|
+
// 处理筛选
|
|
3413
|
+
// 支持单列、多列、组合筛选
|
|
3414
|
+
if (!allRemoteFilter && filterColumns.length) {
|
|
3415
|
+
const handleFilter = row => {
|
|
3416
|
+
return filterColumns.every(({
|
|
3417
|
+
column,
|
|
3418
|
+
valueList,
|
|
3419
|
+
itemList
|
|
3420
|
+
}) => {
|
|
3411
3421
|
const {
|
|
3412
3422
|
filterMethod,
|
|
3413
|
-
filterRender
|
|
3414
|
-
field
|
|
3423
|
+
filterRender
|
|
3415
3424
|
} = column;
|
|
3416
3425
|
const compConf = (0, _utils.isEnableConf)(filterRender) ? renderer.get(filterRender.name) : null;
|
|
3417
3426
|
const compFilterMethod = compConf ? compConf.tableFilterMethod || compConf.filterMethod : null;
|
|
@@ -3424,7 +3433,7 @@ const Methods = {
|
|
|
3424
3433
|
cellValue,
|
|
3425
3434
|
row,
|
|
3426
3435
|
column,
|
|
3427
|
-
$table:
|
|
3436
|
+
$table: $xeTable
|
|
3428
3437
|
}));
|
|
3429
3438
|
} else if (compFilterMethod) {
|
|
3430
3439
|
return itemList.some(item => compFilterMethod({
|
|
@@ -3433,7 +3442,7 @@ const Methods = {
|
|
|
3433
3442
|
cellValue,
|
|
3434
3443
|
row,
|
|
3435
3444
|
column,
|
|
3436
|
-
$table:
|
|
3445
|
+
$table: $xeTable
|
|
3437
3446
|
}));
|
|
3438
3447
|
} else if (allFilterMethod) {
|
|
3439
3448
|
return allFilterMethod({
|
|
@@ -3450,96 +3459,119 @@ const Methods = {
|
|
|
3450
3459
|
cellValue,
|
|
3451
3460
|
row,
|
|
3452
3461
|
column,
|
|
3453
|
-
$table:
|
|
3462
|
+
$table: $xeTable
|
|
3454
3463
|
}));
|
|
3455
3464
|
}
|
|
3456
|
-
return valueList.indexOf(_xeUtils.default.get(row, field)) > -1;
|
|
3457
|
-
}
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
children: treeOpts.mapChildrenField,
|
|
3467
|
-
mapChildren: childrenField
|
|
3468
|
-
});
|
|
3469
|
-
tableData = tableTree;
|
|
3470
|
-
} else {
|
|
3471
|
-
tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
|
|
3472
|
-
tableTree = tableData;
|
|
3473
|
-
}
|
|
3474
|
-
} else {
|
|
3475
|
-
if (treeConfig && transform) {
|
|
3476
|
-
// 还原虚拟树
|
|
3477
|
-
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true, {
|
|
3478
|
-
original: true,
|
|
3479
|
-
isEvery: true,
|
|
3480
|
-
children: treeOpts.mapChildrenField,
|
|
3481
|
-
mapChildren: childrenField
|
|
3482
|
-
});
|
|
3483
|
-
tableData = tableTree;
|
|
3484
|
-
} else {
|
|
3485
|
-
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
|
|
3486
|
-
tableTree = tableData;
|
|
3487
|
-
}
|
|
3488
|
-
}
|
|
3489
|
-
const firstOrderColumn = orderColumns[0];
|
|
3490
|
-
if (!allRemoteSort && firstOrderColumn) {
|
|
3491
|
-
if (treeConfig && transform) {
|
|
3492
|
-
// 虚拟树和列表一样,只能排序根级节点
|
|
3493
|
-
if (allSortMethod) {
|
|
3494
|
-
const sortRests = allSortMethod({
|
|
3495
|
-
data: tableTree,
|
|
3496
|
-
sortList: orderColumns,
|
|
3497
|
-
$table: this
|
|
3465
|
+
return valueList.indexOf(_xeUtils.default.get(row, column.field)) > -1;
|
|
3466
|
+
});
|
|
3467
|
+
};
|
|
3468
|
+
if (treeConfig && transform) {
|
|
3469
|
+
// 筛选虚拟树
|
|
3470
|
+
tableTree = _xeUtils.default.searchTree(tableFullTreeData, handleFilter, {
|
|
3471
|
+
original: true,
|
|
3472
|
+
isEvery: true,
|
|
3473
|
+
children: mapChildrenField,
|
|
3474
|
+
mapChildren: childrenField
|
|
3498
3475
|
});
|
|
3499
|
-
|
|
3476
|
+
tableData = tableTree;
|
|
3500
3477
|
} else {
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
order
|
|
3504
|
-
}) => [getOrderField(this, column), order]));
|
|
3478
|
+
tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
|
|
3479
|
+
tableTree = tableData;
|
|
3505
3480
|
}
|
|
3506
|
-
tableData = tableTree;
|
|
3507
3481
|
} else {
|
|
3508
|
-
if (
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
sortList: orderColumns,
|
|
3516
|
-
$table: this
|
|
3482
|
+
if (treeConfig && transform) {
|
|
3483
|
+
// 还原虚拟树
|
|
3484
|
+
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true, {
|
|
3485
|
+
original: true,
|
|
3486
|
+
isEvery: true,
|
|
3487
|
+
children: mapChildrenField,
|
|
3488
|
+
mapChildren: childrenField
|
|
3517
3489
|
});
|
|
3518
|
-
tableData =
|
|
3490
|
+
tableData = tableTree;
|
|
3519
3491
|
} else {
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3492
|
+
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
|
|
3493
|
+
tableTree = tableData;
|
|
3494
|
+
}
|
|
3495
|
+
}
|
|
3496
|
+
// 处理排序(不能用于树形结构)
|
|
3497
|
+
// 支持单列、多列、组合排序
|
|
3498
|
+
if (!allRemoteSort && orderColumns.length) {
|
|
3499
|
+
if (treeConfig && transform) {
|
|
3500
|
+
// 虚拟树和列表一样,只能排序根级节点
|
|
3501
|
+
if (allSortMethod) {
|
|
3502
|
+
const sortRests = allSortMethod({
|
|
3503
|
+
data: tableTree,
|
|
3504
|
+
sortList: orderColumns,
|
|
3505
|
+
$table: $xeTable
|
|
3506
|
+
});
|
|
3507
|
+
tableTree = _xeUtils.default.isArray(sortRests) ? sortRests : tableTree;
|
|
3508
|
+
} else {
|
|
3509
|
+
const treeList = _xeUtils.default.toTreeArray(tableTree, {
|
|
3510
|
+
children: mapChildrenField
|
|
3511
|
+
});
|
|
3512
|
+
tableTree = _xeUtils.default.toArrayTree(_xeUtils.default.orderBy(treeList, orderColumns.map(({
|
|
3523
3513
|
column,
|
|
3524
3514
|
order
|
|
3525
|
-
}) => [getOrderField(
|
|
3515
|
+
}) => [getOrderField($xeTable, column), order])), {
|
|
3516
|
+
key: rowField,
|
|
3517
|
+
parentKey: parentField,
|
|
3518
|
+
children: childrenField,
|
|
3519
|
+
mapChildren: mapChildrenField
|
|
3520
|
+
});
|
|
3521
|
+
}
|
|
3522
|
+
tableData = tableTree;
|
|
3523
|
+
} else {
|
|
3524
|
+
if (allSortMethod) {
|
|
3525
|
+
const sortRests = allSortMethod({
|
|
3526
|
+
data: tableData,
|
|
3527
|
+
sortList: orderColumns,
|
|
3528
|
+
$table: $xeTable
|
|
3529
|
+
});
|
|
3530
|
+
tableData = _xeUtils.default.isArray(sortRests) ? sortRests : tableData;
|
|
3526
3531
|
} else {
|
|
3527
|
-
// 兼容
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3532
|
+
// 兼容 v4
|
|
3533
|
+
if (sortMultiple) {
|
|
3534
|
+
tableData = _xeUtils.default.orderBy(tableData, orderColumns.map(({
|
|
3535
|
+
column,
|
|
3536
|
+
order
|
|
3537
|
+
}) => [getOrderField(this, column), order]));
|
|
3538
|
+
} else {
|
|
3539
|
+
const firstOrderColumn = orderColumns[0];
|
|
3540
|
+
let sortByConfs;
|
|
3541
|
+
// 已废弃,兼容 v2,在 v4 中废弃, sortBy 不能为数组
|
|
3542
|
+
if (_xeUtils.default.isArray(firstOrderColumn.sortBy)) {
|
|
3543
|
+
sortByConfs = firstOrderColumn.sortBy.map(item => [item, firstOrderColumn.order]);
|
|
3544
|
+
}
|
|
3545
|
+
tableData = _xeUtils.default.orderBy(tableData, sortByConfs || [firstOrderColumn].map(({
|
|
3546
|
+
column,
|
|
3547
|
+
order
|
|
3548
|
+
}) => [getOrderField(this, column), order]));
|
|
3531
3549
|
}
|
|
3532
|
-
tableData = _xeUtils.default.orderBy(tableData,
|
|
3550
|
+
tableData = _xeUtils.default.orderBy(tableData, orderColumns.map(({
|
|
3533
3551
|
column,
|
|
3534
3552
|
order
|
|
3535
|
-
}) => [getOrderField(
|
|
3553
|
+
}) => [getOrderField($xeTable, column), order]));
|
|
3536
3554
|
}
|
|
3555
|
+
tableTree = tableData;
|
|
3537
3556
|
}
|
|
3557
|
+
}
|
|
3558
|
+
} else {
|
|
3559
|
+
if (treeConfig && transform) {
|
|
3560
|
+
// 还原虚拟树
|
|
3561
|
+
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true, {
|
|
3562
|
+
original: true,
|
|
3563
|
+
isEvery: true,
|
|
3564
|
+
children: treeOpts.mapChildrenField,
|
|
3565
|
+
mapChildren: childrenField
|
|
3566
|
+
});
|
|
3567
|
+
tableData = tableTree;
|
|
3568
|
+
} else {
|
|
3569
|
+
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
|
|
3538
3570
|
tableTree = tableData;
|
|
3539
3571
|
}
|
|
3540
3572
|
}
|
|
3541
|
-
|
|
3542
|
-
|
|
3573
|
+
internalData.afterFullData = tableData;
|
|
3574
|
+
internalData.afterTreeFullData = tableTree;
|
|
3543
3575
|
updateAfterDataIndex($xeTable);
|
|
3544
3576
|
},
|
|
3545
3577
|
/**
|
|
@@ -7079,10 +7111,9 @@ const Methods = {
|
|
|
7079
7111
|
} = sortOpts;
|
|
7080
7112
|
const {
|
|
7081
7113
|
field,
|
|
7082
|
-
sortable
|
|
7083
|
-
remoteSort
|
|
7114
|
+
sortable
|
|
7084
7115
|
} = column;
|
|
7085
|
-
if (sortable || remoteSort) {
|
|
7116
|
+
if (sortable || column.remoteSort) {
|
|
7086
7117
|
if (!order || column.order === order) {
|
|
7087
7118
|
if (allowClear) {
|
|
7088
7119
|
$xeTable.clearSort(multiple ? column : null);
|
|
@@ -7096,6 +7127,44 @@ const Methods = {
|
|
|
7096
7127
|
$xeTable.handleColumnSortEvent(evnt, column);
|
|
7097
7128
|
}
|
|
7098
7129
|
},
|
|
7130
|
+
handleCellRuleUpdateStatus(type, cellParams, cellValue) {
|
|
7131
|
+
const $xeTable = this;
|
|
7132
|
+
const reactData = $xeTable;
|
|
7133
|
+
const {
|
|
7134
|
+
validStore
|
|
7135
|
+
} = reactData;
|
|
7136
|
+
const {
|
|
7137
|
+
row,
|
|
7138
|
+
column
|
|
7139
|
+
} = cellParams;
|
|
7140
|
+
if ($xeTable.hasCellRules) {
|
|
7141
|
+
if ($xeTable.hasCellRules(type, row, column)) {
|
|
7142
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
7143
|
+
if (cell) {
|
|
7144
|
+
const customVal = !_xeUtils.default.isUndefined(cellValue);
|
|
7145
|
+
return $xeTable.validCellRules(type, row, column, cellValue).then(() => {
|
|
7146
|
+
if (customVal && validStore.visible) {
|
|
7147
|
+
(0, _util.setCellValue)(row, column, cellValue);
|
|
7148
|
+
}
|
|
7149
|
+
$xeTable.clearValidate(row, column);
|
|
7150
|
+
}).catch(({
|
|
7151
|
+
rule
|
|
7152
|
+
}) => {
|
|
7153
|
+
if (customVal) {
|
|
7154
|
+
(0, _util.setCellValue)(row, column, cellValue);
|
|
7155
|
+
}
|
|
7156
|
+
$xeTable.showValidTooltip({
|
|
7157
|
+
rule,
|
|
7158
|
+
row,
|
|
7159
|
+
column,
|
|
7160
|
+
cell
|
|
7161
|
+
});
|
|
7162
|
+
});
|
|
7163
|
+
}
|
|
7164
|
+
}
|
|
7165
|
+
}
|
|
7166
|
+
return $xeTable.$nextTick();
|
|
7167
|
+
},
|
|
7099
7168
|
/**
|
|
7100
7169
|
* 表头单元格按下事件
|
|
7101
7170
|
*/
|
|
@@ -9805,45 +9874,14 @@ const Methods = {
|
|
|
9805
9874
|
* 如果单元格配置了校验规则,则会进行校验
|
|
9806
9875
|
*/
|
|
9807
9876
|
updateStatus(slotParams, cellValue) {
|
|
9808
|
-
const
|
|
9877
|
+
const $xeTable = this;
|
|
9878
|
+
const props = $xeTable;
|
|
9809
9879
|
return this.$nextTick().then(() => {
|
|
9810
9880
|
const {
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
const refTableBody = $refs.refTableBody;
|
|
9816
|
-
if (slotParams && refTableBody && editRules) {
|
|
9817
|
-
const {
|
|
9818
|
-
row,
|
|
9819
|
-
column
|
|
9820
|
-
} = slotParams;
|
|
9821
|
-
const type = 'change';
|
|
9822
|
-
if (this.hasCellRules) {
|
|
9823
|
-
if (this.hasCellRules(type, row, column)) {
|
|
9824
|
-
const cell = this.getCellElement(row, column);
|
|
9825
|
-
if (cell) {
|
|
9826
|
-
return this.validCellRules(type, row, column, cellValue).then(() => {
|
|
9827
|
-
if (customVal && validStore.visible) {
|
|
9828
|
-
(0, _util.setCellValue)(row, column, cellValue);
|
|
9829
|
-
}
|
|
9830
|
-
this.clearValidate(row, column);
|
|
9831
|
-
}).catch(({
|
|
9832
|
-
rule
|
|
9833
|
-
}) => {
|
|
9834
|
-
if (customVal) {
|
|
9835
|
-
(0, _util.setCellValue)(row, column, cellValue);
|
|
9836
|
-
}
|
|
9837
|
-
this.showValidTooltip({
|
|
9838
|
-
rule,
|
|
9839
|
-
row,
|
|
9840
|
-
column,
|
|
9841
|
-
cell
|
|
9842
|
-
});
|
|
9843
|
-
});
|
|
9844
|
-
}
|
|
9845
|
-
}
|
|
9846
|
-
}
|
|
9881
|
+
editRules
|
|
9882
|
+
} = props;
|
|
9883
|
+
if (slotParams && editRules) {
|
|
9884
|
+
return $xeTable.handleCellRuleUpdateStatus('change', slotParams, cellValue);
|
|
9847
9885
|
}
|
|
9848
9886
|
});
|
|
9849
9887
|
},
|