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/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.12.
|
|
2223
|
+
const version = "3.12.15";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2842,7 +2842,7 @@ function isNodeElement(elem) {
|
|
|
2842
2842
|
const {
|
|
2843
2843
|
log: log_log
|
|
2844
2844
|
} = core_.VxeUI;
|
|
2845
|
-
const log_version = `table v${"3.12.
|
|
2845
|
+
const log_version = `table v${"3.12.15"}`;
|
|
2846
2846
|
const warnLog = log_log.create('warn', log_version);
|
|
2847
2847
|
const errLog = log_log.create('error', log_version);
|
|
2848
2848
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -6320,7 +6320,7 @@ const calcCellHeight = $xeTable => {
|
|
|
6320
6320
|
reactData.calcCellHeightFlag++;
|
|
6321
6321
|
}
|
|
6322
6322
|
};
|
|
6323
|
-
function getOrderField(
|
|
6323
|
+
function getOrderField($xeTable, column) {
|
|
6324
6324
|
const {
|
|
6325
6325
|
sortBy,
|
|
6326
6326
|
sortType
|
|
@@ -6333,7 +6333,7 @@ function getOrderField(_vm, column) {
|
|
|
6333
6333
|
column
|
|
6334
6334
|
}) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, sortBy);
|
|
6335
6335
|
} else {
|
|
6336
|
-
cellValue =
|
|
6336
|
+
cellValue = $xeTable.getCellLabel(row, column);
|
|
6337
6337
|
}
|
|
6338
6338
|
if (!sortType || sortType === 'auto') {
|
|
6339
6339
|
return isNaN(cellValue) ? cellValue : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
@@ -8395,15 +8395,26 @@ const Methods = {
|
|
|
8395
8395
|
*/
|
|
8396
8396
|
updateAfterFullData() {
|
|
8397
8397
|
const $xeTable = this;
|
|
8398
|
+
const props = $xeTable;
|
|
8399
|
+
const internalData = $xeTable;
|
|
8400
|
+
const {
|
|
8401
|
+
treeConfig
|
|
8402
|
+
} = props;
|
|
8398
8403
|
const {
|
|
8399
8404
|
tableFullColumn,
|
|
8400
8405
|
tableFullData,
|
|
8401
|
-
filterOpts,
|
|
8402
|
-
sortOpts,
|
|
8403
|
-
treeConfig,
|
|
8404
|
-
treeOpts,
|
|
8405
8406
|
tableFullTreeData
|
|
8406
|
-
} =
|
|
8407
|
+
} = internalData;
|
|
8408
|
+
const filterOpts = $xeTable.computeFilterOpts;
|
|
8409
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
8410
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8411
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8412
|
+
const {
|
|
8413
|
+
transform,
|
|
8414
|
+
rowField,
|
|
8415
|
+
parentField,
|
|
8416
|
+
mapChildrenField
|
|
8417
|
+
} = treeOpts;
|
|
8407
8418
|
const {
|
|
8408
8419
|
remote: allRemoteFilter,
|
|
8409
8420
|
filterMethod: allFilterMethod
|
|
@@ -8414,63 +8425,61 @@ const Methods = {
|
|
|
8414
8425
|
multiple: sortMultiple,
|
|
8415
8426
|
chronological
|
|
8416
8427
|
} = sortOpts;
|
|
8417
|
-
const {
|
|
8418
|
-
transform
|
|
8419
|
-
} = treeOpts;
|
|
8420
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8421
8428
|
let tableData = [];
|
|
8422
8429
|
let tableTree = [];
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8430
|
+
// 处理数据
|
|
8431
|
+
if (!allRemoteFilter || !allRemoteSort) {
|
|
8432
|
+
const filterColumns = [];
|
|
8433
|
+
let orderColumns = [];
|
|
8434
|
+
tableFullColumn.forEach(column => {
|
|
8435
|
+
const {
|
|
8436
|
+
field,
|
|
8437
|
+
sortable,
|
|
8438
|
+
order,
|
|
8439
|
+
filters
|
|
8440
|
+
} = column;
|
|
8441
|
+
if (!allRemoteFilter && filters && filters.length) {
|
|
8442
|
+
const valueList = [];
|
|
8443
|
+
const itemList = [];
|
|
8444
|
+
filters.forEach(item => {
|
|
8445
|
+
if (item.checked) {
|
|
8446
|
+
itemList.push(item);
|
|
8447
|
+
valueList.push(item.value);
|
|
8448
|
+
}
|
|
8449
|
+
});
|
|
8450
|
+
if (itemList.length) {
|
|
8451
|
+
filterColumns.push({
|
|
8452
|
+
column,
|
|
8453
|
+
valueList,
|
|
8454
|
+
itemList
|
|
8455
|
+
});
|
|
8439
8456
|
}
|
|
8440
|
-
}
|
|
8441
|
-
if (
|
|
8442
|
-
|
|
8457
|
+
}
|
|
8458
|
+
if (!allRemoteSort && sortable && order) {
|
|
8459
|
+
orderColumns.push({
|
|
8443
8460
|
column,
|
|
8444
|
-
|
|
8445
|
-
|
|
8461
|
+
field,
|
|
8462
|
+
property: field,
|
|
8463
|
+
order: order,
|
|
8464
|
+
sortTime: column.sortTime
|
|
8446
8465
|
});
|
|
8447
8466
|
}
|
|
8448
|
-
}
|
|
8449
|
-
if (
|
|
8450
|
-
orderColumns.
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
}
|
|
8462
|
-
if (filterColumns.length) {
|
|
8463
|
-
const handleFilter = row => {
|
|
8464
|
-
return filterColumns.every(({
|
|
8465
|
-
column,
|
|
8466
|
-
valueList,
|
|
8467
|
-
itemList
|
|
8468
|
-
}) => {
|
|
8469
|
-
if (valueList.length && !allRemoteFilter) {
|
|
8467
|
+
});
|
|
8468
|
+
if (sortMultiple && chronological && orderColumns.length > 1) {
|
|
8469
|
+
orderColumns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(orderColumns, 'sortTime');
|
|
8470
|
+
}
|
|
8471
|
+
// 处理筛选
|
|
8472
|
+
// 支持单列、多列、组合筛选
|
|
8473
|
+
if (!allRemoteFilter && filterColumns.length) {
|
|
8474
|
+
const handleFilter = row => {
|
|
8475
|
+
return filterColumns.every(({
|
|
8476
|
+
column,
|
|
8477
|
+
valueList,
|
|
8478
|
+
itemList
|
|
8479
|
+
}) => {
|
|
8470
8480
|
const {
|
|
8471
8481
|
filterMethod,
|
|
8472
|
-
filterRender
|
|
8473
|
-
field
|
|
8482
|
+
filterRender
|
|
8474
8483
|
} = column;
|
|
8475
8484
|
const compConf = isEnableConf(filterRender) ? methods_renderer.get(filterRender.name) : null;
|
|
8476
8485
|
const compFilterMethod = compConf ? compConf.tableFilterMethod || compConf.filterMethod : null;
|
|
@@ -8483,7 +8492,7 @@ const Methods = {
|
|
|
8483
8492
|
cellValue,
|
|
8484
8493
|
row,
|
|
8485
8494
|
column,
|
|
8486
|
-
$table:
|
|
8495
|
+
$table: $xeTable
|
|
8487
8496
|
}));
|
|
8488
8497
|
} else if (compFilterMethod) {
|
|
8489
8498
|
return itemList.some(item => compFilterMethod({
|
|
@@ -8492,7 +8501,7 @@ const Methods = {
|
|
|
8492
8501
|
cellValue,
|
|
8493
8502
|
row,
|
|
8494
8503
|
column,
|
|
8495
|
-
$table:
|
|
8504
|
+
$table: $xeTable
|
|
8496
8505
|
}));
|
|
8497
8506
|
} else if (allFilterMethod) {
|
|
8498
8507
|
return allFilterMethod({
|
|
@@ -8509,96 +8518,119 @@ const Methods = {
|
|
|
8509
8518
|
cellValue,
|
|
8510
8519
|
row,
|
|
8511
8520
|
column,
|
|
8512
|
-
$table:
|
|
8521
|
+
$table: $xeTable
|
|
8513
8522
|
}));
|
|
8514
8523
|
}
|
|
8515
|
-
return valueList.indexOf(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, field)) > -1;
|
|
8516
|
-
}
|
|
8517
|
-
return true;
|
|
8518
|
-
});
|
|
8519
|
-
};
|
|
8520
|
-
if (treeConfig && transform) {
|
|
8521
|
-
// 筛选虚拟树
|
|
8522
|
-
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, handleFilter, {
|
|
8523
|
-
original: true,
|
|
8524
|
-
isEvery: true,
|
|
8525
|
-
children: treeOpts.mapChildrenField,
|
|
8526
|
-
mapChildren: childrenField
|
|
8527
|
-
});
|
|
8528
|
-
tableData = tableTree;
|
|
8529
|
-
} else {
|
|
8530
|
-
tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
|
|
8531
|
-
tableTree = tableData;
|
|
8532
|
-
}
|
|
8533
|
-
} else {
|
|
8534
|
-
if (treeConfig && transform) {
|
|
8535
|
-
// 还原虚拟树
|
|
8536
|
-
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
|
|
8537
|
-
original: true,
|
|
8538
|
-
isEvery: true,
|
|
8539
|
-
children: treeOpts.mapChildrenField,
|
|
8540
|
-
mapChildren: childrenField
|
|
8541
|
-
});
|
|
8542
|
-
tableData = tableTree;
|
|
8543
|
-
} else {
|
|
8544
|
-
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
|
|
8545
|
-
tableTree = tableData;
|
|
8546
|
-
}
|
|
8547
|
-
}
|
|
8548
|
-
const firstOrderColumn = orderColumns[0];
|
|
8549
|
-
if (!allRemoteSort && firstOrderColumn) {
|
|
8550
|
-
if (treeConfig && transform) {
|
|
8551
|
-
// 虚拟树和列表一样,只能排序根级节点
|
|
8552
|
-
if (allSortMethod) {
|
|
8553
|
-
const sortRests = allSortMethod({
|
|
8554
|
-
data: tableTree,
|
|
8555
|
-
sortList: orderColumns,
|
|
8556
|
-
$table: this
|
|
8524
|
+
return valueList.indexOf(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field)) > -1;
|
|
8557
8525
|
});
|
|
8558
|
-
|
|
8526
|
+
};
|
|
8527
|
+
if (treeConfig && transform) {
|
|
8528
|
+
// 筛选虚拟树
|
|
8529
|
+
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, handleFilter, {
|
|
8530
|
+
original: true,
|
|
8531
|
+
isEvery: true,
|
|
8532
|
+
children: mapChildrenField,
|
|
8533
|
+
mapChildren: childrenField
|
|
8534
|
+
});
|
|
8535
|
+
tableData = tableTree;
|
|
8559
8536
|
} else {
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
order
|
|
8563
|
-
}) => [getOrderField(this, column), order]));
|
|
8537
|
+
tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
|
|
8538
|
+
tableTree = tableData;
|
|
8564
8539
|
}
|
|
8565
|
-
tableData = tableTree;
|
|
8566
8540
|
} else {
|
|
8567
|
-
if (
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
sortList: orderColumns,
|
|
8575
|
-
$table: this
|
|
8541
|
+
if (treeConfig && transform) {
|
|
8542
|
+
// 还原虚拟树
|
|
8543
|
+
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
|
|
8544
|
+
original: true,
|
|
8545
|
+
isEvery: true,
|
|
8546
|
+
children: mapChildrenField,
|
|
8547
|
+
mapChildren: childrenField
|
|
8576
8548
|
});
|
|
8577
|
-
tableData =
|
|
8549
|
+
tableData = tableTree;
|
|
8578
8550
|
} else {
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8551
|
+
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
|
|
8552
|
+
tableTree = tableData;
|
|
8553
|
+
}
|
|
8554
|
+
}
|
|
8555
|
+
// 处理排序(不能用于树形结构)
|
|
8556
|
+
// 支持单列、多列、组合排序
|
|
8557
|
+
if (!allRemoteSort && orderColumns.length) {
|
|
8558
|
+
if (treeConfig && transform) {
|
|
8559
|
+
// 虚拟树和列表一样,只能排序根级节点
|
|
8560
|
+
if (allSortMethod) {
|
|
8561
|
+
const sortRests = allSortMethod({
|
|
8562
|
+
data: tableTree,
|
|
8563
|
+
sortList: orderColumns,
|
|
8564
|
+
$table: $xeTable
|
|
8565
|
+
});
|
|
8566
|
+
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests) ? sortRests : tableTree;
|
|
8567
|
+
} else {
|
|
8568
|
+
const treeList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree, {
|
|
8569
|
+
children: mapChildrenField
|
|
8570
|
+
});
|
|
8571
|
+
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(treeList, orderColumns.map(({
|
|
8582
8572
|
column,
|
|
8583
8573
|
order
|
|
8584
|
-
}) => [getOrderField(
|
|
8574
|
+
}) => [getOrderField($xeTable, column), order])), {
|
|
8575
|
+
key: rowField,
|
|
8576
|
+
parentKey: parentField,
|
|
8577
|
+
children: childrenField,
|
|
8578
|
+
mapChildren: mapChildrenField
|
|
8579
|
+
});
|
|
8580
|
+
}
|
|
8581
|
+
tableData = tableTree;
|
|
8582
|
+
} else {
|
|
8583
|
+
if (allSortMethod) {
|
|
8584
|
+
const sortRests = allSortMethod({
|
|
8585
|
+
data: tableData,
|
|
8586
|
+
sortList: orderColumns,
|
|
8587
|
+
$table: $xeTable
|
|
8588
|
+
});
|
|
8589
|
+
tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests) ? sortRests : tableData;
|
|
8585
8590
|
} else {
|
|
8586
|
-
// 兼容
|
|
8587
|
-
|
|
8588
|
-
|
|
8589
|
-
|
|
8591
|
+
// 兼容 v4
|
|
8592
|
+
if (sortMultiple) {
|
|
8593
|
+
tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData, orderColumns.map(({
|
|
8594
|
+
column,
|
|
8595
|
+
order
|
|
8596
|
+
}) => [getOrderField(this, column), order]));
|
|
8597
|
+
} else {
|
|
8598
|
+
const firstOrderColumn = orderColumns[0];
|
|
8599
|
+
let sortByConfs;
|
|
8600
|
+
// 已废弃,兼容 v2,在 v4 中废弃, sortBy 不能为数组
|
|
8601
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(firstOrderColumn.sortBy)) {
|
|
8602
|
+
sortByConfs = firstOrderColumn.sortBy.map(item => [item, firstOrderColumn.order]);
|
|
8603
|
+
}
|
|
8604
|
+
tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData, sortByConfs || [firstOrderColumn].map(({
|
|
8605
|
+
column,
|
|
8606
|
+
order
|
|
8607
|
+
}) => [getOrderField(this, column), order]));
|
|
8590
8608
|
}
|
|
8591
|
-
tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData,
|
|
8609
|
+
tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData, orderColumns.map(({
|
|
8592
8610
|
column,
|
|
8593
8611
|
order
|
|
8594
|
-
}) => [getOrderField(
|
|
8612
|
+
}) => [getOrderField($xeTable, column), order]));
|
|
8595
8613
|
}
|
|
8614
|
+
tableTree = tableData;
|
|
8596
8615
|
}
|
|
8616
|
+
}
|
|
8617
|
+
} else {
|
|
8618
|
+
if (treeConfig && transform) {
|
|
8619
|
+
// 还原虚拟树
|
|
8620
|
+
tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
|
|
8621
|
+
original: true,
|
|
8622
|
+
isEvery: true,
|
|
8623
|
+
children: treeOpts.mapChildrenField,
|
|
8624
|
+
mapChildren: childrenField
|
|
8625
|
+
});
|
|
8626
|
+
tableData = tableTree;
|
|
8627
|
+
} else {
|
|
8628
|
+
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
|
|
8597
8629
|
tableTree = tableData;
|
|
8598
8630
|
}
|
|
8599
8631
|
}
|
|
8600
|
-
|
|
8601
|
-
|
|
8632
|
+
internalData.afterFullData = tableData;
|
|
8633
|
+
internalData.afterTreeFullData = tableTree;
|
|
8602
8634
|
updateAfterDataIndex($xeTable);
|
|
8603
8635
|
},
|
|
8604
8636
|
/**
|
|
@@ -12145,10 +12177,9 @@ const Methods = {
|
|
|
12145
12177
|
} = sortOpts;
|
|
12146
12178
|
const {
|
|
12147
12179
|
field,
|
|
12148
|
-
sortable
|
|
12149
|
-
remoteSort
|
|
12180
|
+
sortable
|
|
12150
12181
|
} = column;
|
|
12151
|
-
if (sortable || remoteSort) {
|
|
12182
|
+
if (sortable || column.remoteSort) {
|
|
12152
12183
|
if (!order || column.order === order) {
|
|
12153
12184
|
if (allowClear) {
|
|
12154
12185
|
$xeTable.clearSort(multiple ? column : null);
|
|
@@ -12162,6 +12193,44 @@ const Methods = {
|
|
|
12162
12193
|
$xeTable.handleColumnSortEvent(evnt, column);
|
|
12163
12194
|
}
|
|
12164
12195
|
},
|
|
12196
|
+
handleCellRuleUpdateStatus(type, cellParams, cellValue) {
|
|
12197
|
+
const $xeTable = this;
|
|
12198
|
+
const reactData = $xeTable;
|
|
12199
|
+
const {
|
|
12200
|
+
validStore
|
|
12201
|
+
} = reactData;
|
|
12202
|
+
const {
|
|
12203
|
+
row,
|
|
12204
|
+
column
|
|
12205
|
+
} = cellParams;
|
|
12206
|
+
if ($xeTable.hasCellRules) {
|
|
12207
|
+
if ($xeTable.hasCellRules(type, row, column)) {
|
|
12208
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
12209
|
+
if (cell) {
|
|
12210
|
+
const customVal = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(cellValue);
|
|
12211
|
+
return $xeTable.validCellRules(type, row, column, cellValue).then(() => {
|
|
12212
|
+
if (customVal && validStore.visible) {
|
|
12213
|
+
setCellValue(row, column, cellValue);
|
|
12214
|
+
}
|
|
12215
|
+
$xeTable.clearValidate(row, column);
|
|
12216
|
+
}).catch(({
|
|
12217
|
+
rule
|
|
12218
|
+
}) => {
|
|
12219
|
+
if (customVal) {
|
|
12220
|
+
setCellValue(row, column, cellValue);
|
|
12221
|
+
}
|
|
12222
|
+
$xeTable.showValidTooltip({
|
|
12223
|
+
rule,
|
|
12224
|
+
row,
|
|
12225
|
+
column,
|
|
12226
|
+
cell
|
|
12227
|
+
});
|
|
12228
|
+
});
|
|
12229
|
+
}
|
|
12230
|
+
}
|
|
12231
|
+
}
|
|
12232
|
+
return $xeTable.$nextTick();
|
|
12233
|
+
},
|
|
12165
12234
|
/**
|
|
12166
12235
|
* 表头单元格按下事件
|
|
12167
12236
|
*/
|
|
@@ -14884,45 +14953,14 @@ const Methods = {
|
|
|
14884
14953
|
* 如果单元格配置了校验规则,则会进行校验
|
|
14885
14954
|
*/
|
|
14886
14955
|
updateStatus(slotParams, cellValue) {
|
|
14887
|
-
const
|
|
14956
|
+
const $xeTable = this;
|
|
14957
|
+
const props = $xeTable;
|
|
14888
14958
|
return this.$nextTick().then(() => {
|
|
14889
14959
|
const {
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
const refTableBody = $refs.refTableBody;
|
|
14895
|
-
if (slotParams && refTableBody && editRules) {
|
|
14896
|
-
const {
|
|
14897
|
-
row,
|
|
14898
|
-
column
|
|
14899
|
-
} = slotParams;
|
|
14900
|
-
const type = 'change';
|
|
14901
|
-
if (this.hasCellRules) {
|
|
14902
|
-
if (this.hasCellRules(type, row, column)) {
|
|
14903
|
-
const cell = this.getCellElement(row, column);
|
|
14904
|
-
if (cell) {
|
|
14905
|
-
return this.validCellRules(type, row, column, cellValue).then(() => {
|
|
14906
|
-
if (customVal && validStore.visible) {
|
|
14907
|
-
setCellValue(row, column, cellValue);
|
|
14908
|
-
}
|
|
14909
|
-
this.clearValidate(row, column);
|
|
14910
|
-
}).catch(({
|
|
14911
|
-
rule
|
|
14912
|
-
}) => {
|
|
14913
|
-
if (customVal) {
|
|
14914
|
-
setCellValue(row, column, cellValue);
|
|
14915
|
-
}
|
|
14916
|
-
this.showValidTooltip({
|
|
14917
|
-
rule,
|
|
14918
|
-
row,
|
|
14919
|
-
column,
|
|
14920
|
-
cell
|
|
14921
|
-
});
|
|
14922
|
-
});
|
|
14923
|
-
}
|
|
14924
|
-
}
|
|
14925
|
-
}
|
|
14960
|
+
editRules
|
|
14961
|
+
} = props;
|
|
14962
|
+
if (slotParams && editRules) {
|
|
14963
|
+
return $xeTable.handleCellRuleUpdateStatus('change', slotParams, cellValue);
|
|
14926
14964
|
}
|
|
14927
14965
|
});
|
|
14928
14966
|
},
|
|
@@ -15544,6 +15582,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15544
15582
|
'fixed--width': !isAutoCellWidth,
|
|
15545
15583
|
'fixed--hidden': fixedHiddenColumn,
|
|
15546
15584
|
'is--padding': isCellPadding,
|
|
15585
|
+
'is--progress': fixedHiddenColumn && isAllOverflow || isVNPreEmptyStatus,
|
|
15547
15586
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
15548
15587
|
'is--drag-disabled': isDisabledDrag,
|
|
15549
15588
|
'col--dirty': isDirty,
|
|
@@ -16167,8 +16206,10 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
16167
16206
|
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
16168
16207
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
16169
16208
|
let isVNPreEmptyStatus = false;
|
|
16170
|
-
if (
|
|
16171
|
-
|
|
16209
|
+
if (!isGroup) {
|
|
16210
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
16211
|
+
isVNPreEmptyStatus = true;
|
|
16212
|
+
}
|
|
16172
16213
|
}
|
|
16173
16214
|
const tcStyle = {};
|
|
16174
16215
|
if (hasEllipsis) {
|
|
@@ -20222,6 +20263,15 @@ const {
|
|
|
20222
20263
|
renderer: edit_mixin_renderer,
|
|
20223
20264
|
getI18n: mixin_getI18n
|
|
20224
20265
|
} = core_.VxeUI;
|
|
20266
|
+
function removeCellSelectedClass($xeTable) {
|
|
20267
|
+
const el = $xeTable.$refs.refElem;
|
|
20268
|
+
if (el) {
|
|
20269
|
+
const cell = el.querySelector('.col--selected');
|
|
20270
|
+
if (cell) {
|
|
20271
|
+
removeClass(cell, 'col--selected');
|
|
20272
|
+
}
|
|
20273
|
+
}
|
|
20274
|
+
}
|
|
20225
20275
|
function insertTreeRow(_vm, newRecords, isAppend) {
|
|
20226
20276
|
const {
|
|
20227
20277
|
tableFullTreeData,
|
|
@@ -20643,7 +20693,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
20643
20693
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
20644
20694
|
const {
|
|
20645
20695
|
actived,
|
|
20646
|
-
|
|
20696
|
+
removeMaps,
|
|
20647
20697
|
insertMaps
|
|
20648
20698
|
} = editStore;
|
|
20649
20699
|
const {
|
|
@@ -20658,7 +20708,8 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
20658
20708
|
// 如果是新增,则保存记录
|
|
20659
20709
|
rows.forEach(row => {
|
|
20660
20710
|
if (!$xeTable.isInsertByRow(row)) {
|
|
20661
|
-
|
|
20711
|
+
const rowid = getRowid($xeTable, row);
|
|
20712
|
+
removeMaps[rowid] = row;
|
|
20662
20713
|
}
|
|
20663
20714
|
});
|
|
20664
20715
|
// 如果绑定了多选属性,则更新状态
|
|
@@ -20835,7 +20886,19 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
20835
20886
|
* 获取已删除的数据
|
|
20836
20887
|
*/
|
|
20837
20888
|
_getRemoveRecords() {
|
|
20838
|
-
|
|
20889
|
+
const $xeTable = this;
|
|
20890
|
+
const reactData = $xeTable;
|
|
20891
|
+
const {
|
|
20892
|
+
editStore
|
|
20893
|
+
} = reactData;
|
|
20894
|
+
const {
|
|
20895
|
+
removeMaps
|
|
20896
|
+
} = editStore;
|
|
20897
|
+
const removeRecords = [];
|
|
20898
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(removeMaps, row => {
|
|
20899
|
+
removeRecords.push(row);
|
|
20900
|
+
});
|
|
20901
|
+
return removeRecords;
|
|
20839
20902
|
},
|
|
20840
20903
|
/**
|
|
20841
20904
|
* 获取更新数据
|
|
@@ -21079,11 +21142,6 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
21079
21142
|
}
|
|
21080
21143
|
focused.row = null;
|
|
21081
21144
|
focused.column = null;
|
|
21082
|
-
$xeTable.$nextTick(() => {
|
|
21083
|
-
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
|
|
21084
|
-
return $xeTable.handleRecalculateCellAreas();
|
|
21085
|
-
}
|
|
21086
|
-
});
|
|
21087
21145
|
if (validOpts.autoClear) {
|
|
21088
21146
|
if (validOpts.msgMode !== 'full' || mixin_getConfig().cellVaildMode === 'obsolete') {
|
|
21089
21147
|
if ($xeTable.clearValidate) {
|
|
@@ -21091,7 +21149,11 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
21091
21149
|
}
|
|
21092
21150
|
}
|
|
21093
21151
|
}
|
|
21094
|
-
return $xeTable.$nextTick()
|
|
21152
|
+
return $xeTable.$nextTick().then(() => {
|
|
21153
|
+
if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
|
|
21154
|
+
return $xeTable.handleRecalculateCellAreas();
|
|
21155
|
+
}
|
|
21156
|
+
});
|
|
21095
21157
|
},
|
|
21096
21158
|
_getActiveRecord() {
|
|
21097
21159
|
if (true) {
|
|
@@ -21303,7 +21365,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
21303
21365
|
selected.row = row;
|
|
21304
21366
|
selected.column = column;
|
|
21305
21367
|
if (isMouseSelected) {
|
|
21306
|
-
this.
|
|
21368
|
+
this.addCellSelectedClass();
|
|
21307
21369
|
}
|
|
21308
21370
|
this.focus();
|
|
21309
21371
|
if (evnt) {
|
|
@@ -21332,13 +21394,14 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
21332
21394
|
* 清除所选中源状态
|
|
21333
21395
|
*/
|
|
21334
21396
|
_clearSelected() {
|
|
21397
|
+
const $xeTable = this;
|
|
21335
21398
|
const {
|
|
21336
21399
|
selected
|
|
21337
21400
|
} = this.editStore;
|
|
21338
21401
|
selected.row = null;
|
|
21339
21402
|
selected.column = null;
|
|
21340
21403
|
this.reColTitleSdCls();
|
|
21341
|
-
|
|
21404
|
+
removeCellSelectedClass($xeTable);
|
|
21342
21405
|
return this.$nextTick();
|
|
21343
21406
|
},
|
|
21344
21407
|
reColTitleSdCls() {
|
|
@@ -21347,23 +21410,22 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
21347
21410
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(headerElem.querySelectorAll('.col--title-selected'), elem => removeClass(elem, 'col--title-selected'));
|
|
21348
21411
|
}
|
|
21349
21412
|
},
|
|
21350
|
-
|
|
21351
|
-
const
|
|
21352
|
-
|
|
21353
|
-
|
|
21354
|
-
|
|
21355
|
-
|
|
21356
|
-
addColSdCls() {
|
|
21413
|
+
addCellSelectedClass() {
|
|
21414
|
+
const $xeTable = this;
|
|
21415
|
+
const reactData = $xeTable;
|
|
21416
|
+
const {
|
|
21417
|
+
editStore
|
|
21418
|
+
} = reactData;
|
|
21357
21419
|
const {
|
|
21358
21420
|
selected
|
|
21359
|
-
} =
|
|
21421
|
+
} = editStore;
|
|
21360
21422
|
const {
|
|
21361
21423
|
row,
|
|
21362
21424
|
column
|
|
21363
21425
|
} = selected;
|
|
21364
|
-
|
|
21426
|
+
removeCellSelectedClass($xeTable);
|
|
21365
21427
|
if (row && column) {
|
|
21366
|
-
const cell =
|
|
21428
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
21367
21429
|
if (cell) {
|
|
21368
21430
|
addClass(cell, 'col--selected');
|
|
21369
21431
|
}
|
|
@@ -21402,6 +21464,7 @@ function createHtmlPage(opts, content) {
|
|
|
21402
21464
|
|
|
21403
21465
|
|
|
21404
21466
|
|
|
21467
|
+
|
|
21405
21468
|
const {
|
|
21406
21469
|
getI18n: export_mixin_getI18n,
|
|
21407
21470
|
renderer: export_mixin_renderer
|
|
@@ -21534,7 +21597,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
|
|
|
21534
21597
|
cellValue = htmlCellElem.innerText.trim();
|
|
21535
21598
|
} else {
|
|
21536
21599
|
const cell = $xeTable.getCellElement(row, column);
|
|
21537
|
-
if (cell) {
|
|
21600
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
21538
21601
|
cellValue = cell.innerText.trim();
|
|
21539
21602
|
}
|
|
21540
21603
|
}
|
|
@@ -21604,7 +21667,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
|
|
|
21604
21667
|
cellValue = htmlCellElem.innerText.trim();
|
|
21605
21668
|
} else {
|
|
21606
21669
|
const cell = $xeTable.getCellElement(row, column);
|
|
21607
|
-
if (cell) {
|
|
21670
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
21608
21671
|
cellValue = cell.innerText.trim();
|
|
21609
21672
|
}
|
|
21610
21673
|
}
|
|
@@ -23921,13 +23984,26 @@ function validErrorRuleValue(rule, val) {
|
|
|
23921
23984
|
* 返回 Promise 对象,或者使用回调方式
|
|
23922
23985
|
*/
|
|
23923
23986
|
beginValidate(rows, cols, cb, isFull) {
|
|
23987
|
+
const $xeTable = this;
|
|
23988
|
+
const props = $xeTable;
|
|
23989
|
+
const reactData = $xeTable;
|
|
23990
|
+
const internalData = $xeTable;
|
|
23924
23991
|
const validRest = {};
|
|
23925
23992
|
const {
|
|
23926
23993
|
editRules,
|
|
23927
|
-
|
|
23928
|
-
|
|
23929
|
-
|
|
23930
|
-
|
|
23994
|
+
treeConfig
|
|
23995
|
+
} = props;
|
|
23996
|
+
const {
|
|
23997
|
+
editStore,
|
|
23998
|
+
pendingRowMaps
|
|
23999
|
+
} = reactData;
|
|
24000
|
+
const {
|
|
24001
|
+
afterFullData
|
|
24002
|
+
} = internalData;
|
|
24003
|
+
const {
|
|
24004
|
+
removeMaps
|
|
24005
|
+
} = editStore;
|
|
24006
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
23931
24007
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
23932
24008
|
let validList;
|
|
23933
24009
|
if (rows === true) {
|
|
@@ -23950,6 +24026,15 @@ function validErrorRuleValue(rule, val) {
|
|
|
23950
24026
|
if (editRules) {
|
|
23951
24027
|
const columns = cols && cols.length ? cols : this.getColumns();
|
|
23952
24028
|
const handleVaild = row => {
|
|
24029
|
+
const rowid = getRowid($xeTable, row);
|
|
24030
|
+
// 是否删除
|
|
24031
|
+
if (removeMaps[rowid]) {
|
|
24032
|
+
return;
|
|
24033
|
+
}
|
|
24034
|
+
// 是否标记删除
|
|
24035
|
+
if (pendingRowMaps[rowid]) {
|
|
24036
|
+
return;
|
|
24037
|
+
}
|
|
23953
24038
|
if (isFull || !this.validRuleErr) {
|
|
23954
24039
|
const colVailds = [];
|
|
23955
24040
|
columns.forEach(column => {
|
|
@@ -25130,7 +25215,6 @@ function renderBody(h, $xeTable) {
|
|
|
25130
25215
|
column: null
|
|
25131
25216
|
},
|
|
25132
25217
|
insertMaps: {},
|
|
25133
|
-
removeList: [],
|
|
25134
25218
|
removeMaps: {}
|
|
25135
25219
|
},
|
|
25136
25220
|
// 存放 tooltip 相关信息
|
|
@@ -25188,6 +25272,12 @@ function renderBody(h, $xeTable) {
|
|
|
25188
25272
|
isHeader: false,
|
|
25189
25273
|
isFooter: false
|
|
25190
25274
|
},
|
|
25275
|
+
rowHeightStore: {
|
|
25276
|
+
default: 48,
|
|
25277
|
+
medium: 44,
|
|
25278
|
+
small: 40,
|
|
25279
|
+
mini: 36
|
|
25280
|
+
},
|
|
25191
25281
|
scrollVMLoading: false,
|
|
25192
25282
|
calcCellHeightFlag: 0,
|
|
25193
25283
|
resizeHeightFlag: 0,
|
|
@@ -25295,12 +25385,9 @@ function renderBody(h, $xeTable) {
|
|
|
25295
25385
|
return this.computeRowHeightMaps;
|
|
25296
25386
|
},
|
|
25297
25387
|
computeRowHeightMaps() {
|
|
25298
|
-
|
|
25299
|
-
|
|
25300
|
-
|
|
25301
|
-
small: 40,
|
|
25302
|
-
mini: 36
|
|
25303
|
-
};
|
|
25388
|
+
const $xeTable = this;
|
|
25389
|
+
const reactData = $xeTable;
|
|
25390
|
+
return reactData.rowHeightStore;
|
|
25304
25391
|
},
|
|
25305
25392
|
computeDefaultRowHeight() {
|
|
25306
25393
|
const $xeTable = this;
|
|
@@ -26075,9 +26162,29 @@ function renderBody(h, $xeTable) {
|
|
|
26075
26162
|
mounted() {
|
|
26076
26163
|
const $xeTable = this;
|
|
26077
26164
|
const props = $xeTable;
|
|
26165
|
+
const reactData = $xeTable;
|
|
26166
|
+
const {
|
|
26167
|
+
rowHeightStore
|
|
26168
|
+
} = reactData;
|
|
26169
|
+
const varEl = $xeTable.$refs.refVarElem;
|
|
26078
26170
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
26079
26171
|
const rowOpts = $xeTable.computeRowOpts;
|
|
26080
26172
|
const customOpts = $xeTable.computeCustomOpts;
|
|
26173
|
+
if (varEl) {
|
|
26174
|
+
const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
|
|
26175
|
+
if (defEl) {
|
|
26176
|
+
rowHeightStore.default = defEl.clientHeight;
|
|
26177
|
+
}
|
|
26178
|
+
if (mediumEl) {
|
|
26179
|
+
rowHeightStore.medium = mediumEl.clientHeight;
|
|
26180
|
+
}
|
|
26181
|
+
if (smallEl) {
|
|
26182
|
+
rowHeightStore.small = smallEl.clientHeight;
|
|
26183
|
+
}
|
|
26184
|
+
if (miniEl) {
|
|
26185
|
+
rowHeightStore.mini = miniEl.clientHeight;
|
|
26186
|
+
}
|
|
26187
|
+
}
|
|
26081
26188
|
if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
|
|
26082
26189
|
initTpImg();
|
|
26083
26190
|
}
|
|
@@ -26256,6 +26363,17 @@ function renderBody(h, $xeTable) {
|
|
|
26256
26363
|
class: 'vxe-table-slots',
|
|
26257
26364
|
ref: 'hideColumn'
|
|
26258
26365
|
}, this.$slots.default), h('div', {
|
|
26366
|
+
ref: 'refVarElem',
|
|
26367
|
+
class: 'vxe-table-vars'
|
|
26368
|
+
}, [h('div', {
|
|
26369
|
+
class: 'vxe-table-var-default'
|
|
26370
|
+
}), h('div', {
|
|
26371
|
+
class: 'vxe-table-var-medium'
|
|
26372
|
+
}), h('div', {
|
|
26373
|
+
class: 'vxe-table-var-small'
|
|
26374
|
+
}), h('div', {
|
|
26375
|
+
class: 'vxe-table-var-mini'
|
|
26376
|
+
})]), h('div', {
|
|
26259
26377
|
key: 'tw',
|
|
26260
26378
|
class: 'vxe-table--render-wrapper'
|
|
26261
26379
|
}, scrollbarXToTop ? [renderScrollX(h, $xeTable), renderBody(h, $xeTable)] : [renderBody(h, $xeTable), renderScrollX(h, $xeTable)]),
|
|
@@ -28931,12 +29049,17 @@ function getCellLabelVNs(h, renderOpts, params, cellLabel) {
|
|
|
28931
29049
|
* @param modelFunc
|
|
28932
29050
|
* @param changeFunc
|
|
28933
29051
|
*/
|
|
28934
|
-
function getNativeElementOns(renderOpts, params,
|
|
29052
|
+
function getNativeElementOns(renderOpts, params, eFns) {
|
|
28935
29053
|
const {
|
|
28936
29054
|
events
|
|
28937
29055
|
} = renderOpts;
|
|
28938
29056
|
const modelEvent = getModelEvent(renderOpts);
|
|
28939
29057
|
const changeEvent = getChangeEvent(renderOpts);
|
|
29058
|
+
const {
|
|
29059
|
+
model: modelFunc,
|
|
29060
|
+
change: changeFunc,
|
|
29061
|
+
blur: blurFunc
|
|
29062
|
+
} = eFns || {};
|
|
28940
29063
|
const isSameEvent = changeEvent === modelEvent;
|
|
28941
29064
|
const ons = {};
|
|
28942
29065
|
if (events) {
|
|
@@ -28958,15 +29081,24 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
28958
29081
|
};
|
|
28959
29082
|
}
|
|
28960
29083
|
if (!isSameEvent && changeFunc) {
|
|
28961
|
-
ons[getOnName(changeEvent)] = function (
|
|
28962
|
-
changeFunc(
|
|
29084
|
+
ons[getOnName(changeEvent)] = function (evnt) {
|
|
29085
|
+
changeFunc(evnt);
|
|
28963
29086
|
if (events && events[changeEvent]) {
|
|
28964
|
-
events[changeEvent](params,
|
|
29087
|
+
events[changeEvent](params, evnt);
|
|
29088
|
+
}
|
|
29089
|
+
};
|
|
29090
|
+
}
|
|
29091
|
+
if (blurFunc) {
|
|
29092
|
+
ons[getOnName(blurEvent)] = function (evnt) {
|
|
29093
|
+
blurFunc(evnt);
|
|
29094
|
+
if (events && events[blurEvent]) {
|
|
29095
|
+
events[blurEvent](params, evnt);
|
|
28965
29096
|
}
|
|
28966
29097
|
};
|
|
28967
29098
|
}
|
|
28968
29099
|
return ons;
|
|
28969
29100
|
}
|
|
29101
|
+
const blurEvent = 'blur';
|
|
28970
29102
|
/**
|
|
28971
29103
|
* 组件事件处理
|
|
28972
29104
|
* @param renderOpts
|
|
@@ -28974,12 +29106,17 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
28974
29106
|
* @param modelFunc
|
|
28975
29107
|
* @param changeFunc
|
|
28976
29108
|
*/
|
|
28977
|
-
function getComponentOns(renderOpts, params,
|
|
29109
|
+
function getComponentOns(renderOpts, params, eFns) {
|
|
28978
29110
|
const {
|
|
28979
29111
|
events
|
|
28980
29112
|
} = renderOpts;
|
|
28981
29113
|
const modelEvent = getModelEvent(renderOpts);
|
|
28982
29114
|
const changeEvent = getChangeEvent(renderOpts);
|
|
29115
|
+
const {
|
|
29116
|
+
model: modelFunc,
|
|
29117
|
+
change: changeFunc,
|
|
29118
|
+
blur: blurFunc
|
|
29119
|
+
} = eFns || {};
|
|
28983
29120
|
const ons = {};
|
|
28984
29121
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(events, (func, key) => {
|
|
28985
29122
|
ons[getOnName(key)] = function (...args) {
|
|
@@ -29007,6 +29144,14 @@ function getComponentOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
29007
29144
|
}
|
|
29008
29145
|
};
|
|
29009
29146
|
}
|
|
29147
|
+
if (blurFunc) {
|
|
29148
|
+
ons[getOnName(blurEvent)] = function (...args) {
|
|
29149
|
+
blurFunc(...args);
|
|
29150
|
+
if (events && events[blurEvent]) {
|
|
29151
|
+
events[blurEvent](params, ...args);
|
|
29152
|
+
}
|
|
29153
|
+
};
|
|
29154
|
+
}
|
|
29010
29155
|
return ons;
|
|
29011
29156
|
}
|
|
29012
29157
|
function getEditOns(renderOpts, params) {
|
|
@@ -29022,31 +29167,47 @@ function getEditOns(renderOpts, params) {
|
|
|
29022
29167
|
model
|
|
29023
29168
|
} = column;
|
|
29024
29169
|
const isImmediate = isImmediateCell(renderOpts, params);
|
|
29025
|
-
return getComponentOns(renderOpts, params,
|
|
29026
|
-
|
|
29027
|
-
|
|
29028
|
-
model.value = cellValue;
|
|
29029
|
-
if (isImmediate) {
|
|
29030
|
-
setCellValue(row, column, cellValue);
|
|
29031
|
-
}
|
|
29032
|
-
}, eventParams => {
|
|
29033
|
-
// 处理 change 事件相关逻辑
|
|
29034
|
-
if (!isImmediate && ['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name)) {
|
|
29035
|
-
const cellValue = eventParams.value;
|
|
29170
|
+
return getComponentOns(renderOpts, params, {
|
|
29171
|
+
model(cellValue) {
|
|
29172
|
+
// 处理 model 值双向绑定
|
|
29036
29173
|
model.update = true;
|
|
29037
29174
|
model.value = cellValue;
|
|
29038
|
-
|
|
29039
|
-
|
|
29040
|
-
|
|
29175
|
+
if (isImmediate) {
|
|
29176
|
+
setCellValue(row, column, cellValue);
|
|
29177
|
+
}
|
|
29178
|
+
},
|
|
29179
|
+
change(eventParams) {
|
|
29180
|
+
// 处理 change 事件相关逻辑
|
|
29181
|
+
if (!isImmediate && name && ['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name)) {
|
|
29182
|
+
const cellValue = eventParams.value;
|
|
29183
|
+
model.update = true;
|
|
29184
|
+
model.value = cellValue;
|
|
29185
|
+
$table.updateStatus(params, cellValue);
|
|
29186
|
+
} else {
|
|
29187
|
+
$table.updateStatus(params);
|
|
29188
|
+
}
|
|
29189
|
+
},
|
|
29190
|
+
blur() {
|
|
29191
|
+
if (isImmediate) {
|
|
29192
|
+
$table.handleCellRuleUpdateStatus('blur', params);
|
|
29193
|
+
} else {
|
|
29194
|
+
$table.handleCellRuleUpdateStatus('blur', params, model.value);
|
|
29195
|
+
}
|
|
29041
29196
|
}
|
|
29042
29197
|
});
|
|
29043
29198
|
}
|
|
29044
29199
|
function getFilterOns(renderOpts, params, option) {
|
|
29045
|
-
return getComponentOns(renderOpts, params,
|
|
29046
|
-
|
|
29047
|
-
|
|
29048
|
-
|
|
29049
|
-
|
|
29200
|
+
return getComponentOns(renderOpts, params, {
|
|
29201
|
+
model(value) {
|
|
29202
|
+
// 处理 model 值双向绑定
|
|
29203
|
+
option.data = value;
|
|
29204
|
+
},
|
|
29205
|
+
change() {
|
|
29206
|
+
handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(option.data), option);
|
|
29207
|
+
},
|
|
29208
|
+
blur() {
|
|
29209
|
+
handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(option.data), option);
|
|
29210
|
+
}
|
|
29050
29211
|
});
|
|
29051
29212
|
}
|
|
29052
29213
|
function getNativeEditOns(renderOpts, params) {
|
|
@@ -29058,27 +29219,52 @@ function getNativeEditOns(renderOpts, params) {
|
|
|
29058
29219
|
const {
|
|
29059
29220
|
model
|
|
29060
29221
|
} = column;
|
|
29061
|
-
return getNativeElementOns(renderOpts, params,
|
|
29062
|
-
|
|
29063
|
-
|
|
29064
|
-
|
|
29065
|
-
|
|
29066
|
-
|
|
29067
|
-
|
|
29068
|
-
|
|
29222
|
+
return getNativeElementOns(renderOpts, params, {
|
|
29223
|
+
model(evnt) {
|
|
29224
|
+
// 处理 model 值双向绑定
|
|
29225
|
+
const targetEl = evnt.target;
|
|
29226
|
+
if (targetEl) {
|
|
29227
|
+
const cellValue = targetEl.value;
|
|
29228
|
+
if (isImmediateCell(renderOpts, params)) {
|
|
29229
|
+
setCellValue(row, column, cellValue);
|
|
29230
|
+
} else {
|
|
29231
|
+
model.update = true;
|
|
29232
|
+
model.value = cellValue;
|
|
29233
|
+
}
|
|
29234
|
+
}
|
|
29235
|
+
},
|
|
29236
|
+
change(evnt) {
|
|
29237
|
+
// 处理 change 事件相关逻辑
|
|
29238
|
+
const targetEl = evnt.target;
|
|
29239
|
+
if (targetEl) {
|
|
29240
|
+
const cellValue = targetEl.value;
|
|
29241
|
+
$table.updateStatus(params, cellValue);
|
|
29242
|
+
}
|
|
29243
|
+
},
|
|
29244
|
+
blur(evnt) {
|
|
29245
|
+
const targetEl = evnt.target;
|
|
29246
|
+
if (targetEl) {
|
|
29247
|
+
const cellValue = targetEl.value;
|
|
29248
|
+
$table.updateStatus(params, cellValue);
|
|
29249
|
+
}
|
|
29069
29250
|
}
|
|
29070
|
-
}, evnt => {
|
|
29071
|
-
// 处理 change 事件相关逻辑
|
|
29072
|
-
const cellValue = evnt.target.value;
|
|
29073
|
-
$table.updateStatus(params, cellValue);
|
|
29074
29251
|
});
|
|
29075
29252
|
}
|
|
29076
29253
|
function getNativeFilterOns(renderOpts, params, option) {
|
|
29077
|
-
return getNativeElementOns(renderOpts, params,
|
|
29078
|
-
|
|
29079
|
-
|
|
29080
|
-
|
|
29081
|
-
|
|
29254
|
+
return getNativeElementOns(renderOpts, params, {
|
|
29255
|
+
model(evnt) {
|
|
29256
|
+
// 处理 model 值双向绑定
|
|
29257
|
+
const targetEl = evnt.target;
|
|
29258
|
+
if (targetEl) {
|
|
29259
|
+
option.data = targetEl.value;
|
|
29260
|
+
}
|
|
29261
|
+
},
|
|
29262
|
+
change() {
|
|
29263
|
+
handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(option.data), option);
|
|
29264
|
+
},
|
|
29265
|
+
blur() {
|
|
29266
|
+
handleConfirmFilter(params, !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(option.data), option);
|
|
29267
|
+
}
|
|
29082
29268
|
});
|
|
29083
29269
|
}
|
|
29084
29270
|
/**
|