vxe-table 3.14.0-beta.0 → 3.14.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid/src/grid.js +60 -75
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +25 -27
- package/es/table/module/edit/mixin.js +1 -1
- package/es/table/module/export/export-panel.js +22 -24
- package/es/table/module/export/import-panel.js +14 -16
- package/es/table/module/export/mixin.js +15 -31
- package/es/table/module/keyboard/mixin.js +3 -2
- package/es/table/module/validator/mixin.js +1 -3
- package/es/table/render/index.js +2 -4
- package/es/table/src/body.js +2 -2
- package/es/table/src/column.js +2 -2
- package/es/table/src/columnInfo.js +30 -32
- package/es/table/src/group.js +2 -2
- package/es/table/src/methods.js +128 -97
- package/es/table/src/table.js +17 -19
- package/es/table/src/util.js +5 -7
- package/es/toolbar/src/toolbar.js +20 -28
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +61 -88
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +372 -380
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +31 -33
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +1 -1
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +22 -24
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +14 -16
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +15 -31
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +3 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +1 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +2 -4
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +2 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/column.js +3 -2
- package/lib/table/src/columnInfo.js +32 -34
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/group.js +3 -2
- package/lib/table/src/methods.js +138 -94
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +14 -16
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +4 -6
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +21 -28
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +62 -75
- package/packages/table/module/custom/panel.ts +25 -27
- package/packages/table/module/edit/mixin.ts +1 -1
- package/packages/table/module/export/export-panel.ts +22 -24
- package/packages/table/module/export/import-panel.ts +14 -16
- package/packages/table/module/export/mixin.ts +15 -31
- package/packages/table/module/keyboard/mixin.ts +6 -2
- package/packages/table/module/validator/mixin.ts +1 -3
- package/packages/table/render/index.ts +2 -4
- package/packages/table/src/body.ts +2 -2
- package/packages/table/src/column.ts +2 -2
- package/packages/table/src/columnInfo.ts +30 -32
- package/packages/table/src/group.ts +2 -2
- package/packages/table/src/methods.ts +140 -104
- package/packages/table/src/table.ts +14 -16
- package/packages/table/src/util.ts +4 -6
- package/packages/toolbar/src/toolbar.ts +20 -28
- /package/es/{iconfont.1740732119954.ttf → iconfont.1741079977180.ttf} +0 -0
- /package/es/{iconfont.1740732119954.woff → iconfont.1741079977180.woff} +0 -0
- /package/es/{iconfont.1740732119954.woff2 → iconfont.1741079977180.woff2} +0 -0
- /package/lib/{iconfont.1740732119954.ttf → iconfont.1741079977180.ttf} +0 -0
- /package/lib/{iconfont.1740732119954.woff → iconfont.1741079977180.woff} +0 -0
- /package/lib/{iconfont.1740732119954.woff2 → iconfont.1741079977180.woff2} +0 -0
package/es/table/src/methods.js
CHANGED
|
@@ -285,14 +285,12 @@ function cacheColumnMap($xeTable) {
|
|
|
285
285
|
if ((expandColumn && expandOpts.mode !== 'fixed') && mouseOpts.area) {
|
|
286
286
|
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
|
|
287
287
|
}
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
errLog('vxe.error.reqProp', ['row-config.useKey & column.type=html']);
|
|
295
|
-
}
|
|
288
|
+
if (htmlColumn) {
|
|
289
|
+
if (!columnOpts.useKey) {
|
|
290
|
+
errLog('vxe.error.reqProp', ['column-config.useKey & column.type=html']);
|
|
291
|
+
}
|
|
292
|
+
if (!rowOpts.useKey) {
|
|
293
|
+
errLog('vxe.error.reqProp', ['row-config.useKey & column.type=html']);
|
|
296
294
|
}
|
|
297
295
|
}
|
|
298
296
|
reactData.isGroup = isGroup;
|
|
@@ -2370,28 +2368,26 @@ const Methods = {
|
|
|
2370
2368
|
if (treeConfig) {
|
|
2371
2369
|
// 树结构自动转换
|
|
2372
2370
|
if (treeOpts.transform) {
|
|
2373
|
-
if (
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
errLog('vxe.error.reqProp', ['table.tree-config.parentField']);
|
|
2379
|
-
}
|
|
2380
|
-
if (!childrenField) {
|
|
2381
|
-
errLog('vxe.error.reqProp', ['tree-config.childrenField']);
|
|
2382
|
-
}
|
|
2383
|
-
if (!treeOpts.mapChildrenField) {
|
|
2384
|
-
errLog('vxe.error.reqProp', ['tree-config.mapChildrenField']);
|
|
2385
|
-
}
|
|
2386
|
-
if (childrenField === treeOpts.mapChildrenField) {
|
|
2387
|
-
errLog('vxe.error.errConflicts', ['tree-config.childrenField', 'tree-config.mapChildrenField']);
|
|
2388
|
-
}
|
|
2389
|
-
// fullData.forEach(row => {
|
|
2390
|
-
// if (row[childrenField] && row[childrenField].length) {
|
|
2391
|
-
// warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${childrenField}`])
|
|
2392
|
-
// }
|
|
2393
|
-
// })
|
|
2371
|
+
if (!treeOpts.rowField) {
|
|
2372
|
+
errLog('vxe.error.reqProp', ['table.tree-config.rowField']);
|
|
2373
|
+
}
|
|
2374
|
+
if (!treeOpts.parentField) {
|
|
2375
|
+
errLog('vxe.error.reqProp', ['table.tree-config.parentField']);
|
|
2394
2376
|
}
|
|
2377
|
+
if (!childrenField) {
|
|
2378
|
+
errLog('vxe.error.reqProp', ['tree-config.childrenField']);
|
|
2379
|
+
}
|
|
2380
|
+
if (!treeOpts.mapChildrenField) {
|
|
2381
|
+
errLog('vxe.error.reqProp', ['tree-config.mapChildrenField']);
|
|
2382
|
+
}
|
|
2383
|
+
if (childrenField === treeOpts.mapChildrenField) {
|
|
2384
|
+
errLog('vxe.error.errConflicts', ['tree-config.childrenField', 'tree-config.mapChildrenField']);
|
|
2385
|
+
}
|
|
2386
|
+
// fullData.forEach(row => {
|
|
2387
|
+
// if (row[childrenField] && row[childrenField].length) {
|
|
2388
|
+
// warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${childrenField}`])
|
|
2389
|
+
// }
|
|
2390
|
+
// })
|
|
2395
2391
|
treeData = XEUtils.toArrayTree(fullData, {
|
|
2396
2392
|
key: treeOpts.rowField,
|
|
2397
2393
|
parentKey: treeOpts.parentField,
|
|
@@ -2456,16 +2452,14 @@ const Methods = {
|
|
|
2456
2452
|
// }
|
|
2457
2453
|
// }
|
|
2458
2454
|
// }
|
|
2459
|
-
if (
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
warnLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
2468
|
-
}
|
|
2455
|
+
if (!(this.height || this.maxHeight)) {
|
|
2456
|
+
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
2457
|
+
}
|
|
2458
|
+
// if (!this.showOverflow) {
|
|
2459
|
+
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
2460
|
+
// }
|
|
2461
|
+
if (this.spanMethod) {
|
|
2462
|
+
warnLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
2469
2463
|
}
|
|
2470
2464
|
}
|
|
2471
2465
|
handleReserveStatus($xeTable);
|
|
@@ -2610,16 +2604,18 @@ const Methods = {
|
|
|
2610
2604
|
cacheRowMap() {
|
|
2611
2605
|
const $xeTable = this;
|
|
2612
2606
|
const props = $xeTable;
|
|
2607
|
+
const reactData = $xeTable;
|
|
2613
2608
|
const internalData = $xeTable;
|
|
2614
2609
|
const { treeConfig } = props;
|
|
2615
|
-
const
|
|
2610
|
+
const { treeExpandedMaps } = reactData;
|
|
2616
2611
|
const { fullAllDataRowIdData, tableFullData, tableFullTreeData } = internalData;
|
|
2612
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
2617
2613
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2618
2614
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
2619
2615
|
const rowkey = getRowkey($xeTable);
|
|
2620
|
-
const
|
|
2621
|
-
const fullAllDataRowIdMaps = {};
|
|
2616
|
+
const fullAllDataRowIdMaps = Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
|
|
2622
2617
|
const fullDataRowIdMaps = {};
|
|
2618
|
+
const treeTempExpandedMaps = Object.assign({}, treeExpandedMaps);
|
|
2623
2619
|
const handleRow = (row, index, items, path, parentRow, nodes) => {
|
|
2624
2620
|
let rowid = getRowid($xeTable, row);
|
|
2625
2621
|
const seq = treeConfig && path ? toTreePathSeq(path) : index + 1;
|
|
@@ -2628,13 +2624,23 @@ const Methods = {
|
|
|
2628
2624
|
rowid = getRowUniqueId();
|
|
2629
2625
|
XEUtils.set(row, rowkey, rowid);
|
|
2630
2626
|
}
|
|
2631
|
-
if (
|
|
2632
|
-
|
|
2627
|
+
if (treeConfig && treeOpts.lazy) {
|
|
2628
|
+
const treeExpRest = treeExpandedMaps[rowid];
|
|
2629
|
+
if (row[hasChildField] && XEUtils.isUndefined(row[childrenField])) {
|
|
2630
|
+
row[childrenField] = null;
|
|
2631
|
+
}
|
|
2632
|
+
if (treeExpRest) {
|
|
2633
|
+
if (!row[childrenField] || !row[childrenField].length) {
|
|
2634
|
+
delete treeTempExpandedMaps[rowid];
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2633
2637
|
}
|
|
2634
2638
|
let rowRest = fullAllDataRowIdData[rowid];
|
|
2635
2639
|
if (!rowRest) {
|
|
2636
2640
|
rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
2637
2641
|
}
|
|
2642
|
+
rowRest.treeLoaded = false;
|
|
2643
|
+
rowRest.expandLoaded = false;
|
|
2638
2644
|
rowRest.row = row;
|
|
2639
2645
|
rowRest.items = items;
|
|
2640
2646
|
rowRest.parent = parentRow;
|
|
@@ -2643,14 +2649,15 @@ const Methods = {
|
|
|
2643
2649
|
fullDataRowIdMaps[rowid] = rowRest;
|
|
2644
2650
|
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
2645
2651
|
};
|
|
2646
|
-
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
2647
|
-
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
2648
2652
|
if (treeConfig) {
|
|
2649
2653
|
XEUtils.eachTree(tableFullTreeData, handleRow, { children: childrenField });
|
|
2650
2654
|
}
|
|
2651
2655
|
else {
|
|
2652
2656
|
tableFullData.forEach(handleRow);
|
|
2653
2657
|
}
|
|
2658
|
+
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
2659
|
+
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
2660
|
+
reactData.treeExpandedMaps = treeTempExpandedMaps;
|
|
2654
2661
|
},
|
|
2655
2662
|
cacheSourceMap(fullData) {
|
|
2656
2663
|
let { treeConfig, treeOpts, sourceDataRowIdData } = this;
|
|
@@ -2962,23 +2969,6 @@ const Methods = {
|
|
|
2962
2969
|
}
|
|
2963
2970
|
return this.createData(records).then((rows) => isArr ? rows : rows[0]);
|
|
2964
2971
|
},
|
|
2965
|
-
// toOriginalRecords (rows: any[]) {
|
|
2966
|
-
// const { treeConfig } = props
|
|
2967
|
-
// const treeOpts = computeTreeOpts.value
|
|
2968
|
-
// const { transform, mapChildrenField } = treeOpts
|
|
2969
|
-
// const rowkey = getRowkey($xeTable)
|
|
2970
|
-
// if (treeConfig) {
|
|
2971
|
-
// if (transform) {
|
|
2972
|
-
// return []
|
|
2973
|
-
// }
|
|
2974
|
-
// return []
|
|
2975
|
-
// }
|
|
2976
|
-
// return rows.map(item => {
|
|
2977
|
-
// const obj = Object.assign({}, item)
|
|
2978
|
-
// delete obj.rowkey
|
|
2979
|
-
// return obj
|
|
2980
|
-
// })
|
|
2981
|
-
// },
|
|
2982
2972
|
/**
|
|
2983
2973
|
* 还原数据
|
|
2984
2974
|
* 如果不传任何参数,则还原整个表格
|
|
@@ -2987,12 +2977,19 @@ const Methods = {
|
|
|
2987
2977
|
* 如果还额外传了 field 则还原指定的单元格数据
|
|
2988
2978
|
*/
|
|
2989
2979
|
revertData(rows, field) {
|
|
2990
|
-
const
|
|
2980
|
+
const $xeTable = this;
|
|
2981
|
+
const props = $xeTable;
|
|
2982
|
+
const reactData = $xeTable;
|
|
2983
|
+
const internalData = $xeTable;
|
|
2984
|
+
const { keepSource, treeConfig } = props;
|
|
2985
|
+
const { fullAllDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
|
|
2986
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
2987
|
+
const { transform } = treeOpts;
|
|
2991
2988
|
if (!keepSource) {
|
|
2992
2989
|
if (process.env.NODE_ENV === 'development') {
|
|
2993
2990
|
warnLog('vxe.error.reqProp', ['keep-source']);
|
|
2994
2991
|
}
|
|
2995
|
-
return
|
|
2992
|
+
return $xeTable.$nextTick();
|
|
2996
2993
|
}
|
|
2997
2994
|
let targetRows = rows;
|
|
2998
2995
|
if (rows) {
|
|
@@ -3001,16 +2998,14 @@ const Methods = {
|
|
|
3001
2998
|
}
|
|
3002
2999
|
}
|
|
3003
3000
|
else {
|
|
3004
|
-
targetRows = XEUtils.toArray(
|
|
3001
|
+
targetRows = XEUtils.toArray($xeTable.getUpdateRecords());
|
|
3005
3002
|
}
|
|
3003
|
+
let reDelFlag = false;
|
|
3006
3004
|
if (targetRows.length) {
|
|
3007
3005
|
targetRows.forEach((row) => {
|
|
3008
|
-
if (
|
|
3009
|
-
const
|
|
3010
|
-
|
|
3011
|
-
errLog('vxe.error.noTree', ['revertData']);
|
|
3012
|
-
}
|
|
3013
|
-
const oRow = tableSourceData[rowIndex];
|
|
3006
|
+
if (!$xeTable.isInsertByRow(row)) {
|
|
3007
|
+
const rowid = getRowid($xeTable, row);
|
|
3008
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
3014
3009
|
if (oRow && row) {
|
|
3015
3010
|
if (field) {
|
|
3016
3011
|
XEUtils.set(row, field, XEUtils.clone(XEUtils.get(oRow, field), true));
|
|
@@ -3018,14 +3013,38 @@ const Methods = {
|
|
|
3018
3013
|
else {
|
|
3019
3014
|
XEUtils.destructuring(row, XEUtils.clone(oRow, true));
|
|
3020
3015
|
}
|
|
3016
|
+
if ($xeTable.isRemoveByRow(row)) {
|
|
3017
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
3018
|
+
if (rowRest) {
|
|
3019
|
+
const reRow = rowRest.row;
|
|
3020
|
+
tableFullData.unshift(reRow);
|
|
3021
|
+
afterFullData.unshift(reRow);
|
|
3022
|
+
reDelFlag = true;
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3021
3025
|
}
|
|
3022
3026
|
}
|
|
3023
3027
|
});
|
|
3024
3028
|
}
|
|
3025
3029
|
if (rows) {
|
|
3026
|
-
|
|
3030
|
+
if (reDelFlag) {
|
|
3031
|
+
$xeTable.updateFooter();
|
|
3032
|
+
$xeTable.cacheRowMap(false);
|
|
3033
|
+
$xeTable.handleTableData(treeConfig && transform);
|
|
3034
|
+
if (!(treeConfig && transform)) {
|
|
3035
|
+
$xeTable.updateAfterDataIndex();
|
|
3036
|
+
}
|
|
3037
|
+
$xeTable.checkSelectionStatus();
|
|
3038
|
+
if (reactData.scrollYLoad) {
|
|
3039
|
+
$xeTable.updateScrollYSpace();
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
return $xeTable.$nextTick().then(() => {
|
|
3043
|
+
$xeTable.updateCellAreas();
|
|
3044
|
+
return $xeTable.recalculate();
|
|
3045
|
+
});
|
|
3027
3046
|
}
|
|
3028
|
-
return
|
|
3047
|
+
return $xeTable.reloadData(tableSourceData);
|
|
3029
3048
|
},
|
|
3030
3049
|
/**
|
|
3031
3050
|
* 清空单元格内容
|
|
@@ -3095,6 +3114,7 @@ const Methods = {
|
|
|
3095
3114
|
},
|
|
3096
3115
|
getCellLabel(row, fieldOrColumn) {
|
|
3097
3116
|
const $xeTable = this;
|
|
3117
|
+
const internalData = $xeTable;
|
|
3098
3118
|
const column = handleFieldOrColumn(this, fieldOrColumn);
|
|
3099
3119
|
if (!column) {
|
|
3100
3120
|
return null;
|
|
@@ -3104,7 +3124,7 @@ const Methods = {
|
|
|
3104
3124
|
let cellLabel = cellValue;
|
|
3105
3125
|
if (formatter) {
|
|
3106
3126
|
let formatData;
|
|
3107
|
-
const { fullAllDataRowIdData } =
|
|
3127
|
+
const { fullAllDataRowIdData } = internalData;
|
|
3108
3128
|
const rowid = getRowid($xeTable, row);
|
|
3109
3129
|
const colid = column.id;
|
|
3110
3130
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
@@ -3144,10 +3164,19 @@ const Methods = {
|
|
|
3144
3164
|
* @param {Row} row 行对象
|
|
3145
3165
|
*/
|
|
3146
3166
|
isInsertByRow(row) {
|
|
3147
|
-
const
|
|
3148
|
-
const
|
|
3167
|
+
const $xeTable = this;
|
|
3168
|
+
const reactData = $xeTable;
|
|
3169
|
+
const { editStore } = reactData;
|
|
3170
|
+
const rowid = getRowid($xeTable, row);
|
|
3149
3171
|
return !!editStore.insertMaps[rowid];
|
|
3150
3172
|
},
|
|
3173
|
+
isRemoveByRow(row) {
|
|
3174
|
+
const $xeTable = this;
|
|
3175
|
+
const reactData = $xeTable;
|
|
3176
|
+
const { editStore } = reactData;
|
|
3177
|
+
const rowid = getRowid($xeTable, row);
|
|
3178
|
+
return !!editStore.removeMaps[rowid];
|
|
3179
|
+
},
|
|
3151
3180
|
/**
|
|
3152
3181
|
* 删除所有新增的临时数据
|
|
3153
3182
|
* @returns
|
|
@@ -5664,8 +5693,8 @@ const Methods = {
|
|
|
5664
5693
|
const { treeConfig } = props;
|
|
5665
5694
|
const { selectCheckboxMaps, treeIndeterminateMaps } = reactData;
|
|
5666
5695
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
5667
|
-
const { checkField, checkMethod } = checkboxOpts;
|
|
5668
|
-
const { afterFullData, afterTreeFullData } = internalData;
|
|
5696
|
+
const { checkField, checkMethod, showReserveStatus } = checkboxOpts;
|
|
5697
|
+
const { afterFullData, afterTreeFullData, checkboxReserveRowMap } = internalData;
|
|
5669
5698
|
let sLen = 0; // 已选
|
|
5670
5699
|
let hLen = 0; // 半选
|
|
5671
5700
|
let vLen = 0; // 有效行
|
|
@@ -5704,7 +5733,11 @@ const Methods = {
|
|
|
5704
5733
|
vLen++;
|
|
5705
5734
|
});
|
|
5706
5735
|
const isSelected = rootList.length > 0 ? (vLen > 0 ? (sLen >= vLen) : (sLen >= rootList.length)) : false;
|
|
5707
|
-
|
|
5736
|
+
let halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
|
|
5737
|
+
// 如果复选框启用保留记录,当保留数据存在时显示半选
|
|
5738
|
+
if (!isSelected && !halfSelect && showReserveStatus) {
|
|
5739
|
+
halfSelect = !XEUtils.isEmpty(checkboxReserveRowMap);
|
|
5740
|
+
}
|
|
5708
5741
|
reactData.isAllSelected = isSelected;
|
|
5709
5742
|
reactData.isIndeterminate = halfSelect;
|
|
5710
5743
|
},
|
|
@@ -8944,23 +8977,21 @@ const Methods = {
|
|
|
8944
8977
|
const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,resetFilterPanel,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,insertChild,insertChildAt,insertChildNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
8945
8978
|
funcs.forEach(name => {
|
|
8946
8979
|
Methods[name] = function (...args) {
|
|
8947
|
-
if (
|
|
8948
|
-
if (
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
errLog('vxe.error.reqModule', ['VxeTableCustomModule']);
|
|
8963
|
-
}
|
|
8980
|
+
if (!this[`_${name}`]) {
|
|
8981
|
+
if ('openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').includes(name)) {
|
|
8982
|
+
errLog('vxe.error.reqModule', ['VxeTableExportModule']);
|
|
8983
|
+
}
|
|
8984
|
+
else if ('fullValidate,validate'.split(',').includes(name)) {
|
|
8985
|
+
errLog('vxe.error.reqModule', ['VxeTableValidatorModule']);
|
|
8986
|
+
}
|
|
8987
|
+
else if ('setFilter,openFilter,clearFilter,getCheckedFilters'.split(',').includes(name)) {
|
|
8988
|
+
errLog('vxe.error.reqModule', ['VxeTableFilterModule']);
|
|
8989
|
+
}
|
|
8990
|
+
else if ('insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell'.split(',').includes(name)) {
|
|
8991
|
+
errLog('vxe.error.reqModule', ['VxeTableEditModule']);
|
|
8992
|
+
}
|
|
8993
|
+
else if ('openCustom'.split(',').includes(name)) {
|
|
8994
|
+
errLog('vxe.error.reqModule', ['VxeTableCustomModule']);
|
|
8964
8995
|
}
|
|
8965
8996
|
}
|
|
8966
8997
|
return this[`_${name}`] ? this[`_${name}`](...args) : null;
|
package/es/table/src/table.js
CHANGED
|
@@ -1357,7 +1357,7 @@ export default {
|
|
|
1357
1357
|
if (rowOpts.height && !this.showOverflow) {
|
|
1358
1358
|
warnLog('vxe.error.notProp', ['table.show-overflow']);
|
|
1359
1359
|
}
|
|
1360
|
-
if (!$xeTable.
|
|
1360
|
+
if (!$xeTable.handleCellAreaMousedownEvent) {
|
|
1361
1361
|
if (props.areaConfig) {
|
|
1362
1362
|
warnLog('vxe.error.notProp', ['area-config']);
|
|
1363
1363
|
}
|
|
@@ -1492,26 +1492,24 @@ export default {
|
|
|
1492
1492
|
warnLog('vxe.error.reqProp', ['tooltip-config']);
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
if (
|
|
1501
|
-
|
|
1502
|
-
errLog('vxe.error.reqComp', ['vxe-loading']);
|
|
1503
|
-
}
|
|
1495
|
+
// 使用已安装的组件,如果未安装则不渲染
|
|
1496
|
+
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
|
|
1497
|
+
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
1498
|
+
$xeTable.$nextTick(() => {
|
|
1499
|
+
if (props.loading) {
|
|
1500
|
+
if (!VxeUILoadingComponent && !this.$scopedSlots.loading) {
|
|
1501
|
+
errLog('vxe.error.reqComp', ['vxe-loading']);
|
|
1504
1502
|
}
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1503
|
+
}
|
|
1504
|
+
if ((props.showOverflow === true || props.showOverflow === 'tooltip') ||
|
|
1505
|
+
(props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip') ||
|
|
1506
|
+
(props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip') ||
|
|
1507
|
+
props.tooltipConfig || props.editRules) {
|
|
1508
|
+
if (!VxeUITooltipComponent) {
|
|
1509
|
+
errLog('vxe.error.reqComp', ['vxe-tooltip']);
|
|
1512
1510
|
}
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1515
1513
|
if (this.autoResize) {
|
|
1516
1514
|
const resizeObserver = globalResize.create(() => {
|
|
1517
1515
|
if (this.autoResize) {
|
package/es/table/src/util.js
CHANGED
|
@@ -133,13 +133,11 @@ export function assembleColumn(_vm) {
|
|
|
133
133
|
const { $el, $xetable, $xecolumn, columnConfig } = _vm;
|
|
134
134
|
const groupConfig = $xecolumn ? $xecolumn.columnConfig : null;
|
|
135
135
|
if (groupConfig) {
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
warnLog('vxe.error.groupTag', [`<vxe-colgroup title=${$xecolumn.title} ...>`, `<vxe-column title=${$xecolumn.title} ...>`]);
|
|
142
|
-
}
|
|
136
|
+
if ($xecolumn.$options._componentTag === 'vxe-table-column') {
|
|
137
|
+
errLog('vxe.error.groupTag', [`<vxe-table-colgroup title=${$xecolumn.title} ...>`, `<vxe-table-column title=${$xecolumn.title} ...>`]);
|
|
138
|
+
}
|
|
139
|
+
else if ($xecolumn.$options._componentTag === 'vxe-column') {
|
|
140
|
+
warnLog('vxe.error.groupTag', [`<vxe-colgroup title=${$xecolumn.title} ...>`, `<vxe-column title=${$xecolumn.title} ...>`]);
|
|
143
141
|
}
|
|
144
142
|
if (!groupConfig.children) {
|
|
145
143
|
groupConfig.children = [];
|
|
@@ -4,7 +4,7 @@ import { VxeUI } from '../../ui';
|
|
|
4
4
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
5
5
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
6
6
|
const { getConfig, getIcon, getI18n, renderer, commands, createEvent, globalMixins, renderEmptyElement } = VxeUI;
|
|
7
|
-
export default
|
|
7
|
+
export default {
|
|
8
8
|
name: 'VxeToolbar',
|
|
9
9
|
mixins: [
|
|
10
10
|
globalMixins.sizeMixin
|
|
@@ -230,9 +230,7 @@ export default defineVxeComponent({
|
|
|
230
230
|
tCommandMethod(params);
|
|
231
231
|
}
|
|
232
232
|
else {
|
|
233
|
-
|
|
234
|
-
errLog('vxe.error.notCommands', [code]);
|
|
235
|
-
}
|
|
233
|
+
errLog('vxe.error.notCommands', [code]);
|
|
236
234
|
}
|
|
237
235
|
}
|
|
238
236
|
$xeToolbar.dispatchEvent('button-click', params, evnt);
|
|
@@ -259,9 +257,7 @@ export default defineVxeComponent({
|
|
|
259
257
|
tCommandMethod(params);
|
|
260
258
|
}
|
|
261
259
|
else {
|
|
262
|
-
|
|
263
|
-
errLog('vxe.error.notCommands', [code]);
|
|
264
|
-
}
|
|
260
|
+
errLog('vxe.error.notCommands', [code]);
|
|
265
261
|
}
|
|
266
262
|
}
|
|
267
263
|
$xeToolbar.dispatchEvent('tool-click', params, evnt);
|
|
@@ -676,32 +672,28 @@ export default defineVxeComponent({
|
|
|
676
672
|
$xetable.connect(this);
|
|
677
673
|
}
|
|
678
674
|
const customOpts = $xeToolbar.computeCustomOpts;
|
|
679
|
-
if (
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
|
|
691
|
-
}
|
|
675
|
+
if (customOpts.isFooter) {
|
|
676
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter']);
|
|
677
|
+
}
|
|
678
|
+
if (customOpts.showFooter) {
|
|
679
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter']);
|
|
680
|
+
}
|
|
681
|
+
if (customOpts.immediate) {
|
|
682
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate']);
|
|
683
|
+
}
|
|
684
|
+
if (customOpts.trigger) {
|
|
685
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger']);
|
|
692
686
|
}
|
|
693
687
|
});
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
700
|
-
}
|
|
688
|
+
// 使用已安装的组件,如果未安装则不渲染
|
|
689
|
+
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
|
|
690
|
+
if (props.refresh || props.import || props.export || props.print || props.zoom) {
|
|
691
|
+
if (!VxeUIButtonComponent) {
|
|
692
|
+
errLog('vxe.error.reqComp', ['vxe-button']);
|
|
701
693
|
}
|
|
702
694
|
}
|
|
703
695
|
},
|
|
704
696
|
render(h) {
|
|
705
697
|
return this.renderVN(h);
|
|
706
698
|
}
|
|
707
|
-
}
|
|
699
|
+
};
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED