@fecp/designer 5.4.108 → 5.4.110
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/designer/package.json.mjs +1 -1
- package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
- package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
- package/es/designer.css +5 -5
- package/es/node_modules/vxe-table/es/grid/src/grid.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/custom/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/custom/panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/edit/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/export/export-panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/export/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/export/import-panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/filter/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/filter/panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/keyboard/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/menu/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/menu/panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/validator/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/render/index.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/body.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/cell.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/columnInfo.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/footer.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/header.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/table.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/use/cell-view.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/util.mjs +1 -1
- package/es/node_modules/vxe-table/es/toolbar/src/toolbar.mjs +1 -1
- package/es/node_modules/vxe-table/es/ui/src/anime.mjs +1 -1
- package/es/node_modules/vxe-table/es/ui/src/dom.mjs +1 -1
- package/es/node_modules/vxe-table/es/ui/src/utils.mjs +1 -1
- package/es/node_modules/vxe-table/es/ui/src/vn.mjs +1 -1
- package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
- package/es/packages/mobile/src/components/dataDisplay/table/Table.vue.mjs +2 -1
- package/es/packages/mobile/src/components/form/field/Field.vue.mjs +0 -1
- package/es/packages/mobile/src/utils/optionUtil.mjs +2 -3
- package/es/packages/vue/src/components/forms/form/FormProxy.vue.mjs +13 -0
- package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +2 -2
- package/es/packages/vue/src/components/table/CustomButtons.vue.mjs +2 -1
- package/es/packages/vue/src/components/table/DynamicQuery.vue.mjs +2 -1
- package/es/packages/vue/src/components/table/Table.vue.mjs +2 -1
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +2 -1
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
- package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
- package/lib/designer.css +5 -5
- package/lib/node_modules/vxe-table/es/grid/src/grid.js +41 -41
- package/lib/node_modules/vxe-table/es/table/module/custom/hook.js +9 -9
- package/lib/node_modules/vxe-table/es/table/module/custom/panel.js +23 -23
- package/lib/node_modules/vxe-table/es/table/module/edit/hook.js +28 -28
- package/lib/node_modules/vxe-table/es/table/module/export/export-panel.js +6 -6
- package/lib/node_modules/vxe-table/es/table/module/export/hook.js +50 -50
- package/lib/node_modules/vxe-table/es/table/module/export/import-panel.js +2 -2
- package/lib/node_modules/vxe-table/es/table/module/filter/hook.js +2 -2
- package/lib/node_modules/vxe-table/es/table/module/filter/panel.js +3 -3
- package/lib/node_modules/vxe-table/es/table/module/keyboard/hook.js +6 -6
- package/lib/node_modules/vxe-table/es/table/module/menu/hook.js +7 -7
- package/lib/node_modules/vxe-table/es/table/module/menu/panel.js +9 -9
- package/lib/node_modules/vxe-table/es/table/module/validator/hook.js +26 -26
- package/lib/node_modules/vxe-table/es/table/render/index.js +65 -65
- package/lib/node_modules/vxe-table/es/table/src/body.js +10 -10
- package/lib/node_modules/vxe-table/es/table/src/cell.js +15 -15
- package/lib/node_modules/vxe-table/es/table/src/columnInfo.js +12 -12
- package/lib/node_modules/vxe-table/es/table/src/footer.js +7 -7
- package/lib/node_modules/vxe-table/es/table/src/header.js +12 -12
- package/lib/node_modules/vxe-table/es/table/src/table.js +342 -342
- package/lib/node_modules/vxe-table/es/table/src/use/cell-view.js +3 -3
- package/lib/node_modules/vxe-table/es/table/src/util.js +24 -24
- package/lib/node_modules/vxe-table/es/toolbar/src/toolbar.js +23 -23
- package/lib/node_modules/vxe-table/es/ui/src/anime.js +7 -7
- package/lib/node_modules/vxe-table/es/ui/src/dom.js +5 -5
- package/lib/node_modules/vxe-table/es/ui/src/utils.js +4 -4
- package/lib/node_modules/vxe-table/es/ui/src/vn.js +2 -2
- package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
- package/lib/packages/mobile/src/components/dataDisplay/table/Table.vue.js +3 -2
- package/lib/packages/mobile/src/components/form/field/Field.vue.js +0 -1
- package/lib/packages/mobile/src/utils/optionUtil.js +2 -3
- package/lib/packages/vue/src/components/forms/form/FormProxy.vue.js +13 -0
- package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +2 -2
- package/lib/packages/vue/src/components/table/CustomButtons.vue.js +5 -4
- package/lib/packages/vue/src/components/table/DynamicQuery.vue.js +27 -26
- package/lib/packages/vue/src/components/table/Table.vue.js +5 -4
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +17 -16
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const comp = require("../../ui/src/comp.js");
|
|
5
|
-
const
|
|
5
|
+
const XEUtils = require("xe-utils");
|
|
6
6
|
const dom = require("../../ui/src/dom.js");
|
|
7
7
|
const utils = require("../../ui/src/utils.js");
|
|
8
8
|
require("../../ui/index.js");
|
|
@@ -44,8 +44,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
44
44
|
emits: emits.tableEmits,
|
|
45
45
|
setup(props$1, context) {
|
|
46
46
|
const { slots, emit } = context;
|
|
47
|
-
const xID =
|
|
48
|
-
const browseObj =
|
|
47
|
+
const xID = XEUtils.uniqueId();
|
|
48
|
+
const browseObj = XEUtils.browse();
|
|
49
49
|
const VxeUILoadingComponent = index_esm.VxeUI.getComponent("VxeLoading");
|
|
50
50
|
const VxeUITooltipComponent = index_esm.VxeUI.getComponent("VxeTooltip");
|
|
51
51
|
const $xeTabs = vue.inject("$xeTabs", null);
|
|
@@ -344,7 +344,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
344
344
|
const computeTableId = vue.computed(() => {
|
|
345
345
|
const { id } = props$1;
|
|
346
346
|
if (id) {
|
|
347
|
-
if (
|
|
347
|
+
if (XEUtils.isFunction(id)) {
|
|
348
348
|
return `${id({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) || ""}`;
|
|
349
349
|
}
|
|
350
350
|
return `${id}`;
|
|
@@ -366,7 +366,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
366
366
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
367
367
|
const { threshold } = virtualXOpts;
|
|
368
368
|
if (threshold) {
|
|
369
|
-
return
|
|
369
|
+
return XEUtils.toNumber(threshold);
|
|
370
370
|
}
|
|
371
371
|
return 0;
|
|
372
372
|
});
|
|
@@ -429,7 +429,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
429
429
|
const virtualYOpts = computeVirtualYOpts.value;
|
|
430
430
|
const { threshold } = virtualYOpts;
|
|
431
431
|
if (threshold) {
|
|
432
|
-
return
|
|
432
|
+
return XEUtils.toNumber(threshold);
|
|
433
433
|
}
|
|
434
434
|
return 0;
|
|
435
435
|
});
|
|
@@ -450,7 +450,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
450
450
|
const computeCellOpts = vue.computed(() => {
|
|
451
451
|
const cellOpts = Object.assign({}, getConfig().table.cellConfig, props$1.cellConfig);
|
|
452
452
|
if (cellOpts.height) {
|
|
453
|
-
cellOpts.height =
|
|
453
|
+
cellOpts.height = XEUtils.toNumber(cellOpts.height);
|
|
454
454
|
}
|
|
455
455
|
return cellOpts;
|
|
456
456
|
});
|
|
@@ -458,7 +458,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
458
458
|
const headerCellOpts = Object.assign({}, getConfig().table.headerCellConfig, props$1.headerCellConfig);
|
|
459
459
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
460
460
|
const cellOpts = computeCellOpts.value;
|
|
461
|
-
let headCellHeight =
|
|
461
|
+
let headCellHeight = XEUtils.toNumber(util.getCalcHeight(headerCellOpts.height || cellOpts.height));
|
|
462
462
|
if ($xeGantt) {
|
|
463
463
|
const { computeTaskViewScales } = $xeGantt.getComputeMaps();
|
|
464
464
|
const taskViewScales = computeTaskViewScales.value;
|
|
@@ -473,7 +473,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
473
473
|
const computeFooterCellOpts = vue.computed(() => {
|
|
474
474
|
const footerCellOpts = Object.assign({}, getConfig().table.footerCellConfig, props$1.footerCellConfig);
|
|
475
475
|
const cellOpts = computeCellOpts.value;
|
|
476
|
-
footerCellOpts.height =
|
|
476
|
+
footerCellOpts.height = XEUtils.toNumber(util.getCalcHeight(footerCellOpts.height || cellOpts.height));
|
|
477
477
|
return footerCellOpts;
|
|
478
478
|
});
|
|
479
479
|
const computeRowOpts = vue.computed(() => {
|
|
@@ -709,7 +709,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
709
709
|
const { visibleDataRowIdData, rowExpandedMaps } = internalData;
|
|
710
710
|
const expandList = [];
|
|
711
711
|
if (tableData.length && expandColumn && rowExpandedFlag && rowGroupExpandedFlag && treeExpandedFlag) {
|
|
712
|
-
|
|
712
|
+
XEUtils.each(rowExpandedMaps, (row, rowid) => {
|
|
713
713
|
if (visibleDataRowIdData[rowid]) {
|
|
714
714
|
expandList.push(row);
|
|
715
715
|
}
|
|
@@ -920,15 +920,15 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
920
920
|
xegrid: $xeGrid
|
|
921
921
|
};
|
|
922
922
|
const eqCellValue = (row1, row2, field) => {
|
|
923
|
-
const val1 =
|
|
924
|
-
const val2 =
|
|
923
|
+
const val1 = XEUtils.get(row1, field);
|
|
924
|
+
const val2 = XEUtils.get(row2, field);
|
|
925
925
|
if (utils.eqEmptyValue(val1) && utils.eqEmptyValue(val2)) {
|
|
926
926
|
return true;
|
|
927
927
|
}
|
|
928
|
-
if (
|
|
928
|
+
if (XEUtils.isString(val1) || XEUtils.isNumber(val1)) {
|
|
929
929
|
return "" + val1 === "" + val2;
|
|
930
930
|
}
|
|
931
|
-
return
|
|
931
|
+
return XEUtils.isEqual(val1, val2);
|
|
932
932
|
};
|
|
933
933
|
const handleKeyField = () => {
|
|
934
934
|
const keyField = computeRowField.value;
|
|
@@ -936,7 +936,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
936
936
|
internalData.isCurrDeepKey = util.hasDeepKey(keyField);
|
|
937
937
|
};
|
|
938
938
|
const hangleStorageDefaultValue = (value, isAll) => {
|
|
939
|
-
return
|
|
939
|
+
return XEUtils.isBoolean(value) ? value : isAll;
|
|
940
940
|
};
|
|
941
941
|
const getNextSortOrder = (column) => {
|
|
942
942
|
const sortOpts = computeSortOpts.value;
|
|
@@ -947,7 +947,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
947
947
|
};
|
|
948
948
|
const getCustomStorageMap = (id) => {
|
|
949
949
|
const version = getConfig().version;
|
|
950
|
-
const rest =
|
|
950
|
+
const rest = XEUtils.toStringJSON(localStorage.getItem(customStorageKey) || "");
|
|
951
951
|
const maps = rest && rest._v === version ? rest : { _v: version };
|
|
952
952
|
return (id ? maps[id] : maps) || {};
|
|
953
953
|
};
|
|
@@ -956,12 +956,12 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
956
956
|
const maps = getCustomStorageMap();
|
|
957
957
|
maps[id] = data || void 0;
|
|
958
958
|
maps._v = version;
|
|
959
|
-
localStorage.setItem(customStorageKey,
|
|
959
|
+
localStorage.setItem(customStorageKey, XEUtils.toJSONString(maps));
|
|
960
960
|
};
|
|
961
961
|
const getRecoverRowMaps = (keyMaps) => {
|
|
962
962
|
const { fullAllDataRowIdData } = internalData;
|
|
963
963
|
const restKeys = {};
|
|
964
|
-
|
|
964
|
+
XEUtils.each(keyMaps, (row, rowid) => {
|
|
965
965
|
if (fullAllDataRowIdData[rowid]) {
|
|
966
966
|
restKeys[rowid] = row;
|
|
967
967
|
}
|
|
@@ -971,7 +971,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
971
971
|
const handleReserveRow = (reserveRowMap) => {
|
|
972
972
|
const { fullDataRowIdData } = internalData;
|
|
973
973
|
const reserveList = [];
|
|
974
|
-
|
|
974
|
+
XEUtils.each(reserveRowMap, (item, rowid) => {
|
|
975
975
|
if (fullDataRowIdData[rowid] && $xeTable.findRowIndexOf(reserveList, fullDataRowIdData[rowid].row) === -1) {
|
|
976
976
|
reserveList.push(fullDataRowIdData[rowid].row);
|
|
977
977
|
}
|
|
@@ -1152,14 +1152,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1152
1152
|
const { fullAllDataRowIdData, fullColumnIdData, visibleColumn, afterFullData, mergeBodyList, mergeBodyMaps } = internalData;
|
|
1153
1153
|
if (merges) {
|
|
1154
1154
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
1155
|
-
if (!
|
|
1155
|
+
if (!XEUtils.isArray(merges)) {
|
|
1156
1156
|
merges = [merges];
|
|
1157
1157
|
}
|
|
1158
1158
|
merges.forEach((item) => {
|
|
1159
1159
|
let { row: margeRow, col: margeCol, rowspan, colspan } = item;
|
|
1160
1160
|
let mergeRowIndex = -1;
|
|
1161
1161
|
let mergeColumnIndex = -1;
|
|
1162
|
-
if (
|
|
1162
|
+
if (XEUtils.isNumber(margeRow)) {
|
|
1163
1163
|
mergeRowIndex = margeRow;
|
|
1164
1164
|
} else {
|
|
1165
1165
|
const rowid = margeRow ? handleGetRowId(margeRow) : null;
|
|
@@ -1168,7 +1168,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1168
1168
|
mergeRowIndex = rowRest._index;
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
if (
|
|
1171
|
+
if (XEUtils.isNumber(margeCol)) {
|
|
1172
1172
|
mergeColumnIndex = margeCol;
|
|
1173
1173
|
} else {
|
|
1174
1174
|
const colid = margeCol ? margeCol.id : null;
|
|
@@ -1178,8 +1178,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
1180
|
if (mergeRowIndex > -1 && mergeColumnIndex > -1 && (rowspan || colspan)) {
|
|
1181
|
-
rowspan =
|
|
1182
|
-
colspan =
|
|
1181
|
+
rowspan = XEUtils.toNumber(rowspan) || 1;
|
|
1182
|
+
colspan = XEUtils.toNumber(colspan) || 1;
|
|
1183
1183
|
if (rowspan > 1 || colspan > 1) {
|
|
1184
1184
|
const row = afterFullData[mergeRowIndex];
|
|
1185
1185
|
const column = visibleColumn[mergeColumnIndex];
|
|
@@ -1213,14 +1213,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1213
1213
|
const rest = [];
|
|
1214
1214
|
if (merges) {
|
|
1215
1215
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
1216
|
-
if (!
|
|
1216
|
+
if (!XEUtils.isArray(merges)) {
|
|
1217
1217
|
merges = [merges];
|
|
1218
1218
|
}
|
|
1219
1219
|
merges.forEach((item) => {
|
|
1220
1220
|
const { row: margeRow, col: margeCol } = item;
|
|
1221
1221
|
let mergeRowIndex = -1;
|
|
1222
1222
|
let mergeColumnIndex = -1;
|
|
1223
|
-
if (
|
|
1223
|
+
if (XEUtils.isNumber(margeRow)) {
|
|
1224
1224
|
mergeRowIndex = margeRow;
|
|
1225
1225
|
} else {
|
|
1226
1226
|
const rowid = margeRow ? handleGetRowId(margeRow) : null;
|
|
@@ -1229,7 +1229,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1229
1229
|
mergeRowIndex = rowRest._index;
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
|
-
if (
|
|
1232
|
+
if (XEUtils.isNumber(margeCol)) {
|
|
1233
1233
|
mergeColumnIndex = margeCol;
|
|
1234
1234
|
} else {
|
|
1235
1235
|
const colid = margeCol ? margeCol.id : null;
|
|
@@ -1238,7 +1238,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1238
1238
|
mergeColumnIndex = colRest._index;
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
|
-
const mcIndex =
|
|
1241
|
+
const mcIndex = XEUtils.findIndexOf(mergeBodyList, (item2) => item2.row === mergeRowIndex && item2.col === mergeColumnIndex);
|
|
1242
1242
|
if (mcIndex > -1) {
|
|
1243
1243
|
const rItems = mergeBodyList.splice(mcIndex, 1);
|
|
1244
1244
|
const item2 = rItems[0];
|
|
@@ -1265,14 +1265,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1265
1265
|
const { mergeHeaderList, mergeHeaderMaps, fullColumnIdData } = internalData;
|
|
1266
1266
|
if (merges) {
|
|
1267
1267
|
const { visibleColumn } = internalData;
|
|
1268
|
-
if (!
|
|
1268
|
+
if (!XEUtils.isArray(merges)) {
|
|
1269
1269
|
merges = [merges];
|
|
1270
1270
|
}
|
|
1271
1271
|
merges.forEach((item) => {
|
|
1272
1272
|
let { row: margeRow, col: margeCol, rowspan, colspan } = item;
|
|
1273
|
-
const mergeRowIndex =
|
|
1273
|
+
const mergeRowIndex = XEUtils.isNumber(margeRow) ? margeRow : -1;
|
|
1274
1274
|
let mergeColumnIndex = -1;
|
|
1275
|
-
if (
|
|
1275
|
+
if (XEUtils.isNumber(margeCol)) {
|
|
1276
1276
|
mergeColumnIndex = margeCol;
|
|
1277
1277
|
} else {
|
|
1278
1278
|
const colid = margeCol ? margeCol.id : null;
|
|
@@ -1282,8 +1282,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
1284
|
if (mergeRowIndex > -1 && mergeColumnIndex > -1 && (rowspan || colspan)) {
|
|
1285
|
-
rowspan =
|
|
1286
|
-
colspan =
|
|
1285
|
+
rowspan = XEUtils.toNumber(rowspan) || 1;
|
|
1286
|
+
colspan = XEUtils.toNumber(colspan) || 1;
|
|
1287
1287
|
if (!showCustomHeader && rowspan > 1) {
|
|
1288
1288
|
log.errLog("vxe.error.notSupportProp", ["[table] show-custom-header=false", `rowspan=${rowspan}`, "rowspan=1"]);
|
|
1289
1289
|
return;
|
|
@@ -1320,14 +1320,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1320
1320
|
const { mergeHeaderList, fullColumnIdData, mergeHeaderMaps } = internalData;
|
|
1321
1321
|
const rest = [];
|
|
1322
1322
|
if (merges) {
|
|
1323
|
-
if (!
|
|
1323
|
+
if (!XEUtils.isArray(merges)) {
|
|
1324
1324
|
merges = [merges];
|
|
1325
1325
|
}
|
|
1326
1326
|
merges.forEach((item) => {
|
|
1327
1327
|
const { row: margeRow, col: margeCol } = item;
|
|
1328
|
-
const mergeRowIndex =
|
|
1328
|
+
const mergeRowIndex = XEUtils.isNumber(margeRow) ? margeRow : -1;
|
|
1329
1329
|
let mergeColumnIndex = -1;
|
|
1330
|
-
if (
|
|
1330
|
+
if (XEUtils.isNumber(margeCol)) {
|
|
1331
1331
|
mergeColumnIndex = margeCol;
|
|
1332
1332
|
} else {
|
|
1333
1333
|
const colid = margeCol ? margeCol.id : null;
|
|
@@ -1336,7 +1336,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1336
1336
|
mergeColumnIndex = colRest._index;
|
|
1337
1337
|
}
|
|
1338
1338
|
}
|
|
1339
|
-
const mcIndex =
|
|
1339
|
+
const mcIndex = XEUtils.findIndexOf(mergeHeaderList, (item2) => item2.row === mergeRowIndex && item2.col === mergeColumnIndex);
|
|
1340
1340
|
if (mcIndex > -1) {
|
|
1341
1341
|
const rItems = mergeHeaderList.splice(mcIndex, 1);
|
|
1342
1342
|
const item2 = rItems[0];
|
|
@@ -1362,14 +1362,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1362
1362
|
const { mergeFooterList, mergeFooterMaps, fullColumnIdData } = internalData;
|
|
1363
1363
|
if (merges) {
|
|
1364
1364
|
const { visibleColumn } = internalData;
|
|
1365
|
-
if (!
|
|
1365
|
+
if (!XEUtils.isArray(merges)) {
|
|
1366
1366
|
merges = [merges];
|
|
1367
1367
|
}
|
|
1368
1368
|
merges.forEach((item) => {
|
|
1369
1369
|
let { row: margeRow, col: margeCol, rowspan, colspan } = item;
|
|
1370
|
-
const mergeRowIndex =
|
|
1370
|
+
const mergeRowIndex = XEUtils.isNumber(margeRow) ? margeRow : -1;
|
|
1371
1371
|
let mergeColumnIndex = -1;
|
|
1372
|
-
if (
|
|
1372
|
+
if (XEUtils.isNumber(margeCol)) {
|
|
1373
1373
|
mergeColumnIndex = margeCol;
|
|
1374
1374
|
} else {
|
|
1375
1375
|
const colid = margeCol ? margeCol.id : null;
|
|
@@ -1379,8 +1379,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
1381
|
if (mergeRowIndex > -1 && mergeColumnIndex > -1 && (rowspan || colspan)) {
|
|
1382
|
-
rowspan =
|
|
1383
|
-
colspan =
|
|
1382
|
+
rowspan = XEUtils.toNumber(rowspan) || 1;
|
|
1383
|
+
colspan = XEUtils.toNumber(colspan) || 1;
|
|
1384
1384
|
if (rowspan > 1 || colspan > 1) {
|
|
1385
1385
|
const row = footerTableData[mergeRowIndex];
|
|
1386
1386
|
const column = visibleColumn[mergeColumnIndex];
|
|
@@ -1413,14 +1413,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1413
1413
|
const { mergeFooterList, fullColumnIdData, mergeFooterMaps } = internalData;
|
|
1414
1414
|
const rest = [];
|
|
1415
1415
|
if (merges) {
|
|
1416
|
-
if (!
|
|
1416
|
+
if (!XEUtils.isArray(merges)) {
|
|
1417
1417
|
merges = [merges];
|
|
1418
1418
|
}
|
|
1419
1419
|
merges.forEach((item) => {
|
|
1420
1420
|
const { row: margeRow, col: margeCol } = item;
|
|
1421
|
-
const mergeRowIndex =
|
|
1421
|
+
const mergeRowIndex = XEUtils.isNumber(margeRow) ? margeRow : -1;
|
|
1422
1422
|
let mergeColumnIndex = -1;
|
|
1423
|
-
if (
|
|
1423
|
+
if (XEUtils.isNumber(margeCol)) {
|
|
1424
1424
|
mergeColumnIndex = margeCol;
|
|
1425
1425
|
} else {
|
|
1426
1426
|
const colid = margeCol ? margeCol.id : null;
|
|
@@ -1429,7 +1429,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1429
1429
|
mergeColumnIndex = colRest._index;
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
|
-
const mcIndex =
|
|
1432
|
+
const mcIndex = XEUtils.findIndexOf(mergeFooterList, (item2) => item2.row === mergeRowIndex && item2.col === mergeColumnIndex);
|
|
1433
1433
|
if (mcIndex > -1) {
|
|
1434
1434
|
const rItems = mergeFooterList.splice(mcIndex, 1);
|
|
1435
1435
|
const item2 = rItems[0];
|
|
@@ -1448,7 +1448,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1448
1448
|
const { tableFullColumn } = internalData;
|
|
1449
1449
|
const sortOpts = computeSortOpts.value;
|
|
1450
1450
|
const { multiple, remote, orders } = sortOpts;
|
|
1451
|
-
if (!
|
|
1451
|
+
if (!XEUtils.isArray(sortConfs)) {
|
|
1452
1452
|
sortConfs = [sortConfs];
|
|
1453
1453
|
}
|
|
1454
1454
|
if (sortConfs && sortConfs.length) {
|
|
@@ -1463,10 +1463,10 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1463
1463
|
}
|
|
1464
1464
|
const sortColMpps = {};
|
|
1465
1465
|
let firstColumn = null;
|
|
1466
|
-
sortConfs.forEach((confs, index
|
|
1466
|
+
sortConfs.forEach((confs, index) => {
|
|
1467
1467
|
let { field, order } = confs;
|
|
1468
1468
|
let column = field;
|
|
1469
|
-
if (
|
|
1469
|
+
if (XEUtils.isString(field)) {
|
|
1470
1470
|
column = $xeTable.getColumnByField(field);
|
|
1471
1471
|
}
|
|
1472
1472
|
if (!firstColumn) {
|
|
@@ -1479,12 +1479,12 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1479
1479
|
if (column.order !== order) {
|
|
1480
1480
|
column.order = order;
|
|
1481
1481
|
}
|
|
1482
|
-
column.sortTime = Date.now() + index
|
|
1482
|
+
column.sortTime = Date.now() + index;
|
|
1483
1483
|
sortColMpps[column.id] = column;
|
|
1484
1484
|
}
|
|
1485
1485
|
});
|
|
1486
1486
|
if (!multiple) {
|
|
1487
|
-
|
|
1487
|
+
XEUtils.each(orderActiveMaps, (oaCol, oaId) => {
|
|
1488
1488
|
if (!sortColMpps[oaId]) {
|
|
1489
1489
|
oaCol.order = null;
|
|
1490
1490
|
}
|
|
@@ -1518,7 +1518,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1518
1518
|
let val = props$1[key];
|
|
1519
1519
|
if (key === "minHeight") {
|
|
1520
1520
|
const defMinHeight = getConfig().table.minHeight;
|
|
1521
|
-
if (
|
|
1521
|
+
if (XEUtils.eqNull(val)) {
|
|
1522
1522
|
if (utils.eqEmptyValue(defMinHeight)) {
|
|
1523
1523
|
if (!tableColumn.length) {
|
|
1524
1524
|
val = 40;
|
|
@@ -1537,9 +1537,9 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1537
1537
|
} else {
|
|
1538
1538
|
const excludeHeight = $xeTable.getExcludeHeight();
|
|
1539
1539
|
if (dom.isScale(val)) {
|
|
1540
|
-
num = Math.floor((
|
|
1540
|
+
num = Math.floor((XEUtils.toInteger(val) || 1) / 100 * parentHeight);
|
|
1541
1541
|
} else {
|
|
1542
|
-
num =
|
|
1542
|
+
num = XEUtils.toNumber(val);
|
|
1543
1543
|
}
|
|
1544
1544
|
num = Math.max(40, num - excludeHeight);
|
|
1545
1545
|
}
|
|
@@ -1563,15 +1563,15 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1563
1563
|
if (isCustomResizable && resizableData || isCustomSort && sortData || isCustomVisible && visibleData || isCustomFixed && fixedData || isCustomAggGroup && aggGroupData || isCustomAggFunc && aggFuncData) {
|
|
1564
1564
|
const sortColMaps = {};
|
|
1565
1565
|
if (isCustomSort && sortData) {
|
|
1566
|
-
if (!
|
|
1566
|
+
if (!XEUtils.isArray(sortData)) {
|
|
1567
1567
|
const sortRests = [];
|
|
1568
|
-
|
|
1569
|
-
sortRests.push({ key: colKey, index
|
|
1568
|
+
XEUtils.each(sortData, (index, colKey) => {
|
|
1569
|
+
sortRests.push({ key: colKey, index });
|
|
1570
1570
|
});
|
|
1571
|
-
sortData =
|
|
1571
|
+
sortData = XEUtils.orderBy(sortRests, { field: "index", order: "asc" }).map((item) => ({ k: item.key }));
|
|
1572
1572
|
}
|
|
1573
1573
|
let colNum = 1;
|
|
1574
|
-
|
|
1574
|
+
XEUtils.eachTree(sortData, (sObj, index, sOjs, path, pSObj) => {
|
|
1575
1575
|
sortColMaps[sObj.k] = {
|
|
1576
1576
|
key: sObj.k,
|
|
1577
1577
|
sNum: colNum++,
|
|
@@ -1582,17 +1582,17 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1582
1582
|
const colKeyMaps = {};
|
|
1583
1583
|
const allCols = [];
|
|
1584
1584
|
const aggGroupConfs = [];
|
|
1585
|
-
|
|
1585
|
+
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
1586
1586
|
const colKey = column.getKey();
|
|
1587
1587
|
if (!parentColumn) {
|
|
1588
1588
|
if (isCustomFixed && fixedData && fixedData[colKey] !== void 0) {
|
|
1589
1589
|
column.fixed = fixedData[colKey];
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
|
-
if (isCustomResizable && resizableData &&
|
|
1592
|
+
if (isCustomResizable && resizableData && XEUtils.isNumber(resizableData[colKey])) {
|
|
1593
1593
|
column.resizeWidth = resizableData[colKey];
|
|
1594
1594
|
}
|
|
1595
|
-
if (isCustomVisible && visibleData &&
|
|
1595
|
+
if (isCustomVisible && visibleData && XEUtils.isBoolean(visibleData[colKey])) {
|
|
1596
1596
|
column.visible = visibleData[colKey];
|
|
1597
1597
|
}
|
|
1598
1598
|
if (isCustomAggFunc && aggFuncData && (aggregateConfig || rowGroupConfig) && aggFuncData[colKey]) {
|
|
@@ -1622,7 +1622,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1622
1622
|
column.renderSortNumber = scItem.sNum;
|
|
1623
1623
|
}
|
|
1624
1624
|
});
|
|
1625
|
-
const newCollectCols =
|
|
1625
|
+
const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, "renderSortNumber"), { key: "id", parentKey: "parentId", children: "children" });
|
|
1626
1626
|
internalData.collectColumn = newCollectCols;
|
|
1627
1627
|
internalData.tableFullColumn = util.getColumnList(newCollectCols);
|
|
1628
1628
|
}
|
|
@@ -1685,9 +1685,9 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1685
1685
|
let checkboxColumn;
|
|
1686
1686
|
let radioColumn;
|
|
1687
1687
|
let htmlColumn;
|
|
1688
|
-
const handleFunc = (column,
|
|
1688
|
+
const handleFunc = (column, index, items, path, parentColumn) => {
|
|
1689
1689
|
const { id: colid, field, fixed, type, treeNode, rowGroupNode } = column;
|
|
1690
|
-
const rest = { $index: -1, _index: -1, column, colid, index
|
|
1690
|
+
const rest = { $index: -1, _index: -1, column, colid, index, items, parent: parentColumn || null, width: 0, oLeft: 0 };
|
|
1691
1691
|
if (field) {
|
|
1692
1692
|
if (fullColFieldData[field]) {
|
|
1693
1693
|
log.errLog("vxe.error.colRepet", ["field", field]);
|
|
@@ -1752,9 +1752,9 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1752
1752
|
fullColIdData[colid] = rest;
|
|
1753
1753
|
};
|
|
1754
1754
|
if (isGroup) {
|
|
1755
|
-
|
|
1755
|
+
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn, nodes) => {
|
|
1756
1756
|
column.level = nodes.length;
|
|
1757
|
-
handleFunc(column,
|
|
1757
|
+
handleFunc(column, index, items, path, parentColumn);
|
|
1758
1758
|
});
|
|
1759
1759
|
} else {
|
|
1760
1760
|
tableFullColumn.forEach(handleFunc);
|
|
@@ -1816,7 +1816,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1816
1816
|
const firstCellEl = cellElemList[0];
|
|
1817
1817
|
if (firstCellEl && firstCellEl.parentElement) {
|
|
1818
1818
|
const cellStyle = getComputedStyle(firstCellEl.parentElement);
|
|
1819
|
-
leftRightPadding = Math.ceil(
|
|
1819
|
+
leftRightPadding = Math.ceil(XEUtils.toNumber(cellStyle.paddingLeft) + XEUtils.toNumber(cellStyle.paddingRight));
|
|
1820
1820
|
}
|
|
1821
1821
|
let colWidth = column.renderAutoWidth - leftRightPadding;
|
|
1822
1822
|
for (let i = 0; i < cellElemList.length; i++) {
|
|
@@ -1867,37 +1867,37 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1867
1867
|
const { columnStore } = reactData;
|
|
1868
1868
|
const { resizeList, pxMinList, autoMinList, pxList, scaleList, scaleMinList, autoList, remainList } = columnStore;
|
|
1869
1869
|
pxMinList.forEach((column) => {
|
|
1870
|
-
const minWidth =
|
|
1870
|
+
const minWidth = XEUtils.toInteger(column.minWidth);
|
|
1871
1871
|
tWidth += minWidth;
|
|
1872
1872
|
column.renderWidth = minWidth;
|
|
1873
1873
|
});
|
|
1874
1874
|
autoMinList.forEach((column) => {
|
|
1875
|
-
const caWidth = Math.max(60,
|
|
1875
|
+
const caWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth));
|
|
1876
1876
|
tWidth += caWidth;
|
|
1877
1877
|
column.renderWidth = caWidth;
|
|
1878
1878
|
});
|
|
1879
1879
|
scaleMinList.forEach((column) => {
|
|
1880
|
-
const smWidth = Math.floor(
|
|
1880
|
+
const smWidth = Math.floor(XEUtils.toInteger(column.minWidth) * meanWidth);
|
|
1881
1881
|
tWidth += smWidth;
|
|
1882
1882
|
column.renderWidth = smWidth;
|
|
1883
1883
|
});
|
|
1884
1884
|
scaleList.forEach((column) => {
|
|
1885
|
-
const sfWidth = Math.floor(
|
|
1885
|
+
const sfWidth = Math.floor(XEUtils.toInteger(column.width) * meanWidth);
|
|
1886
1886
|
tWidth += sfWidth;
|
|
1887
1887
|
column.renderWidth = sfWidth;
|
|
1888
1888
|
});
|
|
1889
1889
|
pxList.forEach((column) => {
|
|
1890
|
-
const pWidth =
|
|
1890
|
+
const pWidth = XEUtils.toInteger(column.width);
|
|
1891
1891
|
tWidth += pWidth;
|
|
1892
1892
|
column.renderWidth = pWidth;
|
|
1893
1893
|
});
|
|
1894
1894
|
autoList.forEach((column) => {
|
|
1895
|
-
const aWidth = Math.max(60,
|
|
1895
|
+
const aWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth));
|
|
1896
1896
|
tWidth += aWidth;
|
|
1897
1897
|
column.renderWidth = aWidth;
|
|
1898
1898
|
});
|
|
1899
1899
|
resizeList.forEach((column) => {
|
|
1900
|
-
const reWidth =
|
|
1900
|
+
const reWidth = XEUtils.toInteger(column.resizeWidth);
|
|
1901
1901
|
tWidth += reWidth;
|
|
1902
1902
|
column.renderWidth = reWidth;
|
|
1903
1903
|
});
|
|
@@ -1953,7 +1953,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1953
1953
|
}
|
|
1954
1954
|
if (!firstCellStyle) {
|
|
1955
1955
|
firstCellStyle = getComputedStyle(cellElem);
|
|
1956
|
-
topBottomPadding = firstCellStyle ? Math.ceil(
|
|
1956
|
+
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
1957
1957
|
}
|
|
1958
1958
|
if (!scrollXLoad) {
|
|
1959
1959
|
cellStyle.height = orHeight;
|
|
@@ -1999,31 +1999,31 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
1999
1999
|
}
|
|
2000
2000
|
let cellValue;
|
|
2001
2001
|
if (sortBy) {
|
|
2002
|
-
cellValue =
|
|
2002
|
+
cellValue = XEUtils.isFunction(sortBy) ? sortBy({ row, column }) : XEUtils.get(row, sortBy);
|
|
2003
2003
|
} else {
|
|
2004
2004
|
cellValue = tableMethods.getCellLabel(row, column);
|
|
2005
2005
|
}
|
|
2006
2006
|
if (!sortType || sortType === "auto") {
|
|
2007
|
-
return isNaN(cellValue) ? cellValue :
|
|
2007
|
+
return isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
|
|
2008
2008
|
} else if (sortType === "number") {
|
|
2009
|
-
return
|
|
2009
|
+
return XEUtils.toNumber(cellValue);
|
|
2010
2010
|
} else if (sortType === "string") {
|
|
2011
|
-
return
|
|
2011
|
+
return XEUtils.toValueString(cellValue);
|
|
2012
2012
|
}
|
|
2013
2013
|
return cellValue;
|
|
2014
2014
|
} : (row) => {
|
|
2015
2015
|
let cellValue;
|
|
2016
2016
|
if (sortBy) {
|
|
2017
|
-
cellValue =
|
|
2017
|
+
cellValue = XEUtils.isFunction(sortBy) ? sortBy({ row, column }) : XEUtils.get(row, sortBy);
|
|
2018
2018
|
} else {
|
|
2019
2019
|
cellValue = tableMethods.getCellLabel(row, column);
|
|
2020
2020
|
}
|
|
2021
2021
|
if (!sortType || sortType === "auto") {
|
|
2022
|
-
return isNaN(cellValue) ? cellValue :
|
|
2022
|
+
return isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
|
|
2023
2023
|
} else if (sortType === "number") {
|
|
2024
|
-
return
|
|
2024
|
+
return XEUtils.toNumber(cellValue);
|
|
2025
2025
|
} else if (sortType === "string") {
|
|
2026
|
-
return
|
|
2026
|
+
return XEUtils.toValueString(cellValue);
|
|
2027
2027
|
}
|
|
2028
2028
|
return cellValue;
|
|
2029
2029
|
};
|
|
@@ -2033,17 +2033,17 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2033
2033
|
const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
|
|
2034
2034
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
2035
2035
|
const fullMaps = {};
|
|
2036
|
-
afterFullData.forEach((row,
|
|
2036
|
+
afterFullData.forEach((row, index) => {
|
|
2037
2037
|
const rowid = handleGetRowId(row);
|
|
2038
2038
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2039
|
-
const seq =
|
|
2039
|
+
const seq = index + 1;
|
|
2040
2040
|
if (rowRest) {
|
|
2041
2041
|
if (!treeConfig) {
|
|
2042
2042
|
rowRest.seq = seq;
|
|
2043
2043
|
}
|
|
2044
|
-
rowRest._index =
|
|
2044
|
+
rowRest._index = index;
|
|
2045
2045
|
} else {
|
|
2046
|
-
const rest = { row, rowid, seq, index: -1, $index: -1, _index:
|
|
2046
|
+
const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, _tIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
2047
2047
|
fullAllDataRowIdData[rowid] = rest;
|
|
2048
2048
|
fullDataRowIdData[rowid] = rest;
|
|
2049
2049
|
}
|
|
@@ -2061,13 +2061,13 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2061
2061
|
if (treeConfig) {
|
|
2062
2062
|
let _treeIndex = 0;
|
|
2063
2063
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
2064
|
-
|
|
2064
|
+
XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
2065
2065
|
const rowid = handleGetRowId(row);
|
|
2066
2066
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2067
2067
|
const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : ".").join("");
|
|
2068
2068
|
if (rowRest) {
|
|
2069
2069
|
rowRest.seq = seq;
|
|
2070
|
-
rowRest.treeIndex =
|
|
2070
|
+
rowRest.treeIndex = index;
|
|
2071
2071
|
rowRest._tIndex = _treeIndex;
|
|
2072
2072
|
} else {
|
|
2073
2073
|
const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, _tIndex: _treeIndex, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
@@ -2078,15 +2078,15 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2078
2078
|
fullMaps[rowid] = row;
|
|
2079
2079
|
}, { children: transform ? treeOpts.mapChildrenField : childrenField });
|
|
2080
2080
|
if (transform) {
|
|
2081
|
-
afterFullData.forEach((row,
|
|
2081
|
+
afterFullData.forEach((row, index) => {
|
|
2082
2082
|
const rowid = handleGetRowId(row);
|
|
2083
2083
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2084
|
-
const seq =
|
|
2084
|
+
const seq = index + 1;
|
|
2085
2085
|
if (rowRest) {
|
|
2086
2086
|
if (!treeConfig) {
|
|
2087
2087
|
rowRest.seq = seq;
|
|
2088
2088
|
}
|
|
2089
|
-
rowRest._index =
|
|
2089
|
+
rowRest._index = index;
|
|
2090
2090
|
}
|
|
2091
2091
|
});
|
|
2092
2092
|
}
|
|
@@ -2106,7 +2106,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2106
2106
|
const expandMaps = {};
|
|
2107
2107
|
if (treeConfig && treeOpts.transform) {
|
|
2108
2108
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2109
|
-
|
|
2109
|
+
XEUtils.eachTree(internalData.afterTreeFullData, (row, index, items, path, parentRow) => {
|
|
2110
2110
|
const rowid = handleGetRowId(row);
|
|
2111
2111
|
const parentRowid = handleGetRowId(parentRow);
|
|
2112
2112
|
if (!parentRow || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
|
|
@@ -2123,7 +2123,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2123
2123
|
return fullData;
|
|
2124
2124
|
} else if (isRowGroupStatus) {
|
|
2125
2125
|
const { childrenField } = aggregateOpts;
|
|
2126
|
-
|
|
2126
|
+
XEUtils.eachTree(internalData.afterGroupFullData, (row, index, items, path, parentRow) => {
|
|
2127
2127
|
const rowid = handleGetRowId(row);
|
|
2128
2128
|
const parentRowid = handleGetRowId(parentRow);
|
|
2129
2129
|
if (!parentRow || expandMaps[parentRowid] && rowGroupExpandedMaps[parentRowid]) {
|
|
@@ -2178,7 +2178,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2178
2178
|
}
|
|
2179
2179
|
});
|
|
2180
2180
|
if (sortMultiple && chronological && orderColumns.length > 1) {
|
|
2181
|
-
orderColumns =
|
|
2181
|
+
orderColumns = XEUtils.orderBy(orderColumns, "sortTime");
|
|
2182
2182
|
}
|
|
2183
2183
|
if (!allRemoteFilter && filterColumns.length) {
|
|
2184
2184
|
const handleFilter = (row) => {
|
|
@@ -2197,11 +2197,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2197
2197
|
} else if (tdFilterMethod) {
|
|
2198
2198
|
return itemList.some((item) => tdFilterMethod({ value: item.value, option: item, cellValue, row, column, $table: $xeTable }));
|
|
2199
2199
|
}
|
|
2200
|
-
return valueList.indexOf(
|
|
2200
|
+
return valueList.indexOf(XEUtils.get(row, column.field)) > -1;
|
|
2201
2201
|
});
|
|
2202
2202
|
};
|
|
2203
2203
|
if (isRowGroupStatus) {
|
|
2204
|
-
tableTree =
|
|
2204
|
+
tableTree = XEUtils.searchTree(tableFullGroupData, handleFilter, {
|
|
2205
2205
|
original: true,
|
|
2206
2206
|
isEvery: true,
|
|
2207
2207
|
children: aggregateOpts.mapChildrenField,
|
|
@@ -2209,7 +2209,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2209
2209
|
});
|
|
2210
2210
|
tableData = tableTree;
|
|
2211
2211
|
} else if (treeConfig && transform) {
|
|
2212
|
-
tableTree =
|
|
2212
|
+
tableTree = XEUtils.searchTree(tableFullTreeData, handleFilter, {
|
|
2213
2213
|
original: true,
|
|
2214
2214
|
isEvery,
|
|
2215
2215
|
children: mapChildrenField,
|
|
@@ -2222,7 +2222,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2222
2222
|
}
|
|
2223
2223
|
} else {
|
|
2224
2224
|
if (isRowGroupStatus) {
|
|
2225
|
-
tableTree =
|
|
2225
|
+
tableTree = XEUtils.searchTree(tableFullGroupData, () => true, {
|
|
2226
2226
|
original: true,
|
|
2227
2227
|
isEvery: true,
|
|
2228
2228
|
children: aggregateOpts.mapChildrenField,
|
|
@@ -2230,7 +2230,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2230
2230
|
});
|
|
2231
2231
|
tableData = tableTree;
|
|
2232
2232
|
} else if (treeConfig && transform) {
|
|
2233
|
-
tableTree =
|
|
2233
|
+
tableTree = XEUtils.searchTree(tableFullTreeData, () => true, {
|
|
2234
2234
|
original: true,
|
|
2235
2235
|
isEvery,
|
|
2236
2236
|
children: mapChildrenField,
|
|
@@ -2246,14 +2246,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2246
2246
|
if (isRowGroupStatus) {
|
|
2247
2247
|
if (allSortMethod) {
|
|
2248
2248
|
const sortRests = allSortMethod({ data: tableTree, sortList: orderColumns, $table: $xeTable });
|
|
2249
|
-
tableTree =
|
|
2249
|
+
tableTree = XEUtils.isArray(sortRests) ? sortRests : tableTree;
|
|
2250
2250
|
} else {
|
|
2251
|
-
const treeList =
|
|
2251
|
+
const treeList = XEUtils.toTreeArray(tableTree, {
|
|
2252
2252
|
key: aggregateOpts.rowField,
|
|
2253
2253
|
parentKey: aggregateOpts.parentField,
|
|
2254
2254
|
children: aggregateOpts.mapChildrenField
|
|
2255
2255
|
});
|
|
2256
|
-
tableTree =
|
|
2256
|
+
tableTree = XEUtils.toArrayTree(XEUtils.orderBy(treeList, orderColumns.map(({ column, order }) => [getOrderField(column), order])), {
|
|
2257
2257
|
key: aggregateOpts.rowField,
|
|
2258
2258
|
parentKey: aggregateOpts.parentField,
|
|
2259
2259
|
children: aggregateOpts.childrenField,
|
|
@@ -2264,12 +2264,12 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2264
2264
|
} else if (treeConfig && transform) {
|
|
2265
2265
|
if (allSortMethod) {
|
|
2266
2266
|
const sortRests = allSortMethod({ data: tableTree, sortList: orderColumns, $table: $xeTable });
|
|
2267
|
-
tableTree =
|
|
2267
|
+
tableTree = XEUtils.isArray(sortRests) ? sortRests : tableTree;
|
|
2268
2268
|
} else {
|
|
2269
|
-
const treeList =
|
|
2269
|
+
const treeList = XEUtils.toTreeArray(tableTree, {
|
|
2270
2270
|
children: mapChildrenField
|
|
2271
2271
|
});
|
|
2272
|
-
tableTree =
|
|
2272
|
+
tableTree = XEUtils.toArrayTree(XEUtils.orderBy(treeList, orderColumns.map(({ column, order }) => [getOrderField(column), order])), {
|
|
2273
2273
|
key: rowField,
|
|
2274
2274
|
parentKey: parentField,
|
|
2275
2275
|
children: childrenField,
|
|
@@ -2280,16 +2280,16 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2280
2280
|
} else {
|
|
2281
2281
|
if (allSortMethod) {
|
|
2282
2282
|
const sortRests = allSortMethod({ data: tableData, sortList: orderColumns, $table: $xeTable });
|
|
2283
|
-
tableData =
|
|
2283
|
+
tableData = XEUtils.isArray(sortRests) ? sortRests : tableData;
|
|
2284
2284
|
} else {
|
|
2285
|
-
tableData =
|
|
2285
|
+
tableData = XEUtils.orderBy(tableData, orderColumns.map(({ column, order }) => [getOrderField(column), order]));
|
|
2286
2286
|
}
|
|
2287
2287
|
tableTree = tableData;
|
|
2288
2288
|
}
|
|
2289
2289
|
}
|
|
2290
2290
|
} else {
|
|
2291
2291
|
if (isRowGroupStatus) {
|
|
2292
|
-
tableTree =
|
|
2292
|
+
tableTree = XEUtils.searchTree(tableFullGroupData, () => true, {
|
|
2293
2293
|
original: true,
|
|
2294
2294
|
isEvery: true,
|
|
2295
2295
|
children: aggregateOpts.mapChildrenField,
|
|
@@ -2297,7 +2297,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2297
2297
|
});
|
|
2298
2298
|
tableData = tableTree;
|
|
2299
2299
|
} else if (treeConfig && transform) {
|
|
2300
|
-
tableTree =
|
|
2300
|
+
tableTree = XEUtils.searchTree(tableFullTreeData, () => true, {
|
|
2301
2301
|
original: true,
|
|
2302
2302
|
isEvery,
|
|
2303
2303
|
children: mapChildrenField,
|
|
@@ -2438,8 +2438,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2438
2438
|
rowExpandEl.style.top = `${tHeaderHeight}px`;
|
|
2439
2439
|
}
|
|
2440
2440
|
internalData.tBodyHeight = tbHeight;
|
|
2441
|
-
containerList.forEach((name,
|
|
2442
|
-
const fixedType =
|
|
2441
|
+
containerList.forEach((name, index) => {
|
|
2442
|
+
const fixedType = index > 0 ? name : "";
|
|
2443
2443
|
const layoutList = ["header", "body", "footer"];
|
|
2444
2444
|
const isFixedLeft = fixedType === "left";
|
|
2445
2445
|
let fixedColumn = [];
|
|
@@ -2597,17 +2597,17 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2597
2597
|
const sortOpts = computeSortOpts.value;
|
|
2598
2598
|
let { defaultSort } = sortOpts;
|
|
2599
2599
|
if (defaultSort) {
|
|
2600
|
-
if (!
|
|
2600
|
+
if (!XEUtils.isArray(defaultSort)) {
|
|
2601
2601
|
defaultSort = [defaultSort];
|
|
2602
2602
|
}
|
|
2603
2603
|
if (defaultSort.length) {
|
|
2604
|
-
(sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach((item,
|
|
2604
|
+
(sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach((item, index) => {
|
|
2605
2605
|
const { field, order } = item;
|
|
2606
2606
|
if (field && order) {
|
|
2607
2607
|
const column = $xeTable.getColumnByField(field);
|
|
2608
2608
|
if (column && column.sortable) {
|
|
2609
2609
|
column.order = order;
|
|
2610
|
-
column.sortTime = Date.now() +
|
|
2610
|
+
column.sortTime = Date.now() + index;
|
|
2611
2611
|
}
|
|
2612
2612
|
}
|
|
2613
2613
|
});
|
|
@@ -2701,7 +2701,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2701
2701
|
return vue.nextTick();
|
|
2702
2702
|
};
|
|
2703
2703
|
const handleCheckedCheckboxRow = (rows, value, isForce) => {
|
|
2704
|
-
if (rows && !
|
|
2704
|
+
if (rows && !XEUtils.isArray(rows)) {
|
|
2705
2705
|
rows = [rows];
|
|
2706
2706
|
}
|
|
2707
2707
|
$xeTable.handleBatchSelectRows(rows, !!value, isForce);
|
|
@@ -2726,21 +2726,21 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2726
2726
|
if (checked) {
|
|
2727
2727
|
selectRowMaps[handleGetRowId(row)] = row;
|
|
2728
2728
|
}
|
|
2729
|
-
|
|
2729
|
+
XEUtils.set(row, checkField, checked);
|
|
2730
2730
|
}
|
|
2731
2731
|
if ((treeConfig || isRowGroupStatus) && indeterminateField) {
|
|
2732
|
-
|
|
2732
|
+
XEUtils.set(row, indeterminateField, false);
|
|
2733
2733
|
}
|
|
2734
2734
|
};
|
|
2735
2735
|
if (treeConfig || isRowGroupStatus) {
|
|
2736
|
-
|
|
2736
|
+
XEUtils.eachTree(afterFullData, checkValFn, { children: childrenField });
|
|
2737
2737
|
} else {
|
|
2738
2738
|
afterFullData.forEach(checkValFn);
|
|
2739
2739
|
}
|
|
2740
2740
|
} else {
|
|
2741
2741
|
if (isRowGroupStatus) {
|
|
2742
2742
|
if (checked) {
|
|
2743
|
-
|
|
2743
|
+
XEUtils.eachTree(afterGroupFullData, (row) => {
|
|
2744
2744
|
if (isForce || (!checkMethod || checkMethod({ $table: $xeTable, row }))) {
|
|
2745
2745
|
const rowid = handleGetRowId(row);
|
|
2746
2746
|
selectRowMaps[rowid] = row;
|
|
@@ -2748,7 +2748,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2748
2748
|
}, { children: aggregateOpts.mapChildrenField });
|
|
2749
2749
|
} else {
|
|
2750
2750
|
if (!isForce && checkMethod) {
|
|
2751
|
-
|
|
2751
|
+
XEUtils.eachTree(afterGroupFullData, (row) => {
|
|
2752
2752
|
const rowid = handleGetRowId(row);
|
|
2753
2753
|
if (checkMethod({ $table: $xeTable, row }) ? false : selectCheckboxMaps[rowid]) {
|
|
2754
2754
|
selectRowMaps[rowid] = row;
|
|
@@ -2758,7 +2758,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2758
2758
|
}
|
|
2759
2759
|
} else if (treeConfig) {
|
|
2760
2760
|
if (checked) {
|
|
2761
|
-
|
|
2761
|
+
XEUtils.eachTree(afterTreeFullData, (row) => {
|
|
2762
2762
|
if (isForce || (!checkMethod || checkMethod({ $table: $xeTable, row }))) {
|
|
2763
2763
|
const rowid = handleGetRowId(row);
|
|
2764
2764
|
selectRowMaps[rowid] = row;
|
|
@@ -2766,7 +2766,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2766
2766
|
}, { children: childrenField });
|
|
2767
2767
|
} else {
|
|
2768
2768
|
if (!isForce && checkMethod) {
|
|
2769
|
-
|
|
2769
|
+
XEUtils.eachTree(afterTreeFullData, (row) => {
|
|
2770
2770
|
const rowid = handleGetRowId(row);
|
|
2771
2771
|
if (checkMethod({ $table: $xeTable, row }) ? false : selectCheckboxMaps[rowid]) {
|
|
2772
2772
|
selectRowMaps[rowid] = row;
|
|
@@ -2803,7 +2803,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2803
2803
|
}
|
|
2804
2804
|
if (reserve) {
|
|
2805
2805
|
if (checked) {
|
|
2806
|
-
|
|
2806
|
+
XEUtils.each(selectRowMaps, (row, rowid) => {
|
|
2807
2807
|
checkboxReserveRowMap[rowid] = row;
|
|
2808
2808
|
});
|
|
2809
2809
|
} else {
|
|
@@ -2892,7 +2892,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
2892
2892
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
2893
2893
|
delete treeExpandLazyLoadedMaps[rowid];
|
|
2894
2894
|
}
|
|
2895
|
-
if (!
|
|
2895
|
+
if (!XEUtils.isArray(childRecords)) {
|
|
2896
2896
|
childRecords = [];
|
|
2897
2897
|
}
|
|
2898
2898
|
if (childRecords) {
|
|
@@ -3015,8 +3015,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3015
3015
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
3016
3016
|
if (scrollXLoad) {
|
|
3017
3017
|
const { toVisibleIndex: toXVisibleIndex, visibleSize: visibleXSize } = handleVirtualXVisible();
|
|
3018
|
-
const offsetXSize = Math.max(0, virtualXOpts.oSize ?
|
|
3019
|
-
scrollXStore.preloadSize =
|
|
3018
|
+
const offsetXSize = Math.max(0, virtualXOpts.oSize ? XEUtils.toNumber(virtualXOpts.oSize) : 0);
|
|
3019
|
+
scrollXStore.preloadSize = XEUtils.toNumber(virtualXOpts.preSize);
|
|
3020
3020
|
scrollXStore.offsetSize = offsetXSize;
|
|
3021
3021
|
scrollXStore.visibleSize = visibleXSize;
|
|
3022
3022
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
@@ -3033,8 +3033,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3033
3033
|
reactData.rowHeight = rowHeight;
|
|
3034
3034
|
const { toVisibleIndex: toYVisibleIndex, visibleSize: visibleYSize } = handleVirtualYVisible();
|
|
3035
3035
|
if (scrollYLoad) {
|
|
3036
|
-
const offsetYSize = Math.max(0, virtualYOpts.oSize ?
|
|
3037
|
-
scrollYStore.preloadSize =
|
|
3036
|
+
const offsetYSize = Math.max(0, virtualYOpts.oSize ? XEUtils.toNumber(virtualYOpts.oSize) : 0);
|
|
3037
|
+
scrollYStore.preloadSize = XEUtils.toNumber(virtualYOpts.preSize);
|
|
3038
3038
|
scrollYStore.offsetSize = offsetYSize;
|
|
3039
3039
|
scrollYStore.visibleSize = visibleYSize;
|
|
3040
3040
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
@@ -3180,7 +3180,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3180
3180
|
const aggGroupFields = [];
|
|
3181
3181
|
const aggGroupConfs = [];
|
|
3182
3182
|
if (groupFields) {
|
|
3183
|
-
(
|
|
3183
|
+
(XEUtils.isArray(groupFields) ? groupFields : [groupFields]).forEach((field) => {
|
|
3184
3184
|
aggGroupFields.push(field);
|
|
3185
3185
|
aggGroupConfs.push({
|
|
3186
3186
|
field
|
|
@@ -3198,9 +3198,9 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3198
3198
|
const { mapChildrenField } = aggregateOpts;
|
|
3199
3199
|
const aggCalcMethod = aggregateOpts.calcValuesMethod || aggregateOpts.countMethod || aggregateOpts.aggregateMethod;
|
|
3200
3200
|
if (mapChildrenField) {
|
|
3201
|
-
|
|
3201
|
+
XEUtils.lastEach(aggList, (aggRow) => {
|
|
3202
3202
|
let count = 0;
|
|
3203
|
-
|
|
3203
|
+
XEUtils.each(aggRow[mapChildrenField], (row) => {
|
|
3204
3204
|
if (row.isAggregate) {
|
|
3205
3205
|
count += row.childCount || 0;
|
|
3206
3206
|
} else {
|
|
@@ -3213,7 +3213,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3213
3213
|
$xeTable.handlePivotTableAggregateData(aggList);
|
|
3214
3214
|
} else {
|
|
3215
3215
|
if (aggFuncColumns.length) {
|
|
3216
|
-
|
|
3216
|
+
XEUtils.lastEach(aggList, (aggRow) => {
|
|
3217
3217
|
const aggDtObj = {};
|
|
3218
3218
|
const aggData = aggRow.aggData;
|
|
3219
3219
|
const groupField = aggRow.groupField;
|
|
@@ -3246,7 +3246,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3246
3246
|
};
|
|
3247
3247
|
let aggVal = 0;
|
|
3248
3248
|
if (childList.length && childList[0].isAggregate) {
|
|
3249
|
-
|
|
3249
|
+
XEUtils.each(childList, (row) => {
|
|
3250
3250
|
if (row.isAggregate) {
|
|
3251
3251
|
const currAggData2 = row.aggData[field];
|
|
3252
3252
|
if (currAggData2) {
|
|
@@ -3277,7 +3277,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3277
3277
|
const { mapChildrenField } = aggregateOpts;
|
|
3278
3278
|
if ((aggregateConfig || rowGroupConfig) && isRowGroupStatus) {
|
|
3279
3279
|
const aggList = [];
|
|
3280
|
-
|
|
3280
|
+
XEUtils.eachTree(tableFullGroupData, (row) => {
|
|
3281
3281
|
if (row.isAggregate) {
|
|
3282
3282
|
aggList.push(row);
|
|
3283
3283
|
}
|
|
@@ -3304,8 +3304,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3304
3304
|
const aggList = [];
|
|
3305
3305
|
const rowkey = util.getRowkey($xeTable);
|
|
3306
3306
|
list.forEach((row) => {
|
|
3307
|
-
const cellValue = groupColumn ? $xeTable.getCellLabel(row, groupColumn) :
|
|
3308
|
-
const groupValue =
|
|
3307
|
+
const cellValue = groupColumn ? $xeTable.getCellLabel(row, groupColumn) : XEUtils.get(row, groupField);
|
|
3308
|
+
const groupValue = XEUtils.eqNull(cellValue) ? "" : cellValue;
|
|
3309
3309
|
let childList = groupMaps[groupValue];
|
|
3310
3310
|
if (!childList) {
|
|
3311
3311
|
childList = [];
|
|
@@ -3316,7 +3316,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3316
3316
|
}
|
|
3317
3317
|
childList.push(row);
|
|
3318
3318
|
});
|
|
3319
|
-
|
|
3319
|
+
XEUtils.objectEach(groupMaps, (childList, groupValue) => {
|
|
3320
3320
|
const { fullData: childFullData, treeData: childTreeData } = handleGroupData(childList, rowGroups.slice(1));
|
|
3321
3321
|
const aggRow = {
|
|
3322
3322
|
isAggregate: true,
|
|
@@ -3410,7 +3410,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3410
3410
|
if (childrenField === treeOpts.mapChildrenField) {
|
|
3411
3411
|
log.errLog("vxe.error.errConflicts", ["tree-config.childrenField", "tree-config.mapChildrenField"]);
|
|
3412
3412
|
}
|
|
3413
|
-
treeData =
|
|
3413
|
+
treeData = XEUtils.toArrayTree(fullData, {
|
|
3414
3414
|
key: treeOpts.rowField,
|
|
3415
3415
|
parentKey: treeOpts.parentField,
|
|
3416
3416
|
children: childrenField,
|
|
@@ -3576,7 +3576,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3576
3576
|
reactData.tableColumn = tableColumn;
|
|
3577
3577
|
};
|
|
3578
3578
|
const handleUpdateColumn = () => {
|
|
3579
|
-
const columnList =
|
|
3579
|
+
const columnList = XEUtils.orderBy(internalData.collectColumn, "renderSortNumber");
|
|
3580
3580
|
internalData.collectColumn = columnList;
|
|
3581
3581
|
const tableFullColumn = util.getColumnList(columnList);
|
|
3582
3582
|
internalData.tableFullColumn = tableFullColumn;
|
|
@@ -3614,7 +3614,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3614
3614
|
const leftGroupList = [];
|
|
3615
3615
|
const centerGroupList = [];
|
|
3616
3616
|
const rightGroupList = [];
|
|
3617
|
-
|
|
3617
|
+
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
3618
3618
|
const isColGroup = utils.hasChildrenList(column);
|
|
3619
3619
|
if (parentColumn && parentColumn.fixed) {
|
|
3620
3620
|
column.fixed = parentColumn.fixed;
|
|
@@ -3623,7 +3623,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3623
3623
|
log.errLog("vxe.error.groupFixed");
|
|
3624
3624
|
}
|
|
3625
3625
|
if (isColGroup) {
|
|
3626
|
-
column.visible = !!
|
|
3626
|
+
column.visible = !!XEUtils.findTree(column.children, (subColumn) => utils.hasChildrenList(subColumn) ? false : subColumn.visible);
|
|
3627
3627
|
} else if (column.visible) {
|
|
3628
3628
|
if (column.fixed === "left") {
|
|
3629
3629
|
leftList.push(column);
|
|
@@ -3681,15 +3681,15 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3681
3681
|
scrollXStore.visibleEndIndex = visibleSize;
|
|
3682
3682
|
}
|
|
3683
3683
|
}
|
|
3684
|
-
if (visibleColumn.length !== internalData.visibleColumn.length || !internalData.visibleColumn.every((column,
|
|
3684
|
+
if (visibleColumn.length !== internalData.visibleColumn.length || !internalData.visibleColumn.every((column, index) => column === visibleColumn[index])) {
|
|
3685
3685
|
$xeTable.clearMergeCells();
|
|
3686
3686
|
$xeTable.clearMergeFooterItems();
|
|
3687
3687
|
}
|
|
3688
|
-
visibleColumn.forEach((column,
|
|
3688
|
+
visibleColumn.forEach((column, index) => {
|
|
3689
3689
|
const colid = column.id;
|
|
3690
3690
|
const colRest = fullColumnIdData[colid];
|
|
3691
3691
|
if (colRest) {
|
|
3692
|
-
colRest._index =
|
|
3692
|
+
colRest._index = index;
|
|
3693
3693
|
}
|
|
3694
3694
|
});
|
|
3695
3695
|
handleTableColumn();
|
|
@@ -3710,10 +3710,10 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3710
3710
|
const fullColIdData = {};
|
|
3711
3711
|
const fullColFieldData = {};
|
|
3712
3712
|
let sortIndex = 1;
|
|
3713
|
-
|
|
3713
|
+
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
3714
3714
|
const { id: colid, field } = column;
|
|
3715
3715
|
const parentId = parentColumn ? parentColumn.id : null;
|
|
3716
|
-
const rest = { $index: -1, _index: -1, column, colid, index
|
|
3716
|
+
const rest = { $index: -1, _index: -1, column, colid, index, items, parent: parentColumn || null, width: 0, oLeft: 0 };
|
|
3717
3717
|
column.parentId = parentId;
|
|
3718
3718
|
column.defaultParentId = parentId;
|
|
3719
3719
|
column.sortNumber = sortIndex;
|
|
@@ -3806,7 +3806,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3806
3806
|
let validRows = toggleMethod ? rows.filter((row) => toggleMethod({ $table: $xeTable, expanded, column: treeNodeColumn, columnIndex, $columnIndex, row })) : rows;
|
|
3807
3807
|
if (accordion) {
|
|
3808
3808
|
validRows = validRows.length ? [validRows[validRows.length - 1]] : [];
|
|
3809
|
-
const matchObj =
|
|
3809
|
+
const matchObj = XEUtils.findTree(tableFullTreeData, (item) => item === validRows[0], { children: childrenField });
|
|
3810
3810
|
if (matchObj) {
|
|
3811
3811
|
matchObj.items.forEach((item) => {
|
|
3812
3812
|
const rowid = handleGetRowId(item);
|
|
@@ -3877,7 +3877,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
3877
3877
|
if (mapChildrenField) {
|
|
3878
3878
|
if (accordion) {
|
|
3879
3879
|
validRows = validRows.length ? [validRows[validRows.length - 1]] : [];
|
|
3880
|
-
const matchObj =
|
|
3880
|
+
const matchObj = XEUtils.findTree(tableFullGroupData, (item) => util.getRowid($xeTable, item) === util.getRowid($xeTable, validRows[0]), { children: mapChildrenField });
|
|
3881
3881
|
if (matchObj) {
|
|
3882
3882
|
matchObj.items.forEach((item) => {
|
|
3883
3883
|
const rowid = handleGetRowId(item);
|
|
@@ -4230,7 +4230,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4230
4230
|
const bodyScrollElem = util.getRefElem(elemStore["main-body-scroll"]);
|
|
4231
4231
|
if (rowExpandEl && bodyScrollElem) {
|
|
4232
4232
|
let isUpdateHeight = false;
|
|
4233
|
-
|
|
4233
|
+
XEUtils.arrayEach(rowExpandEl.children, (reEl) => {
|
|
4234
4234
|
const expandEl = reEl;
|
|
4235
4235
|
const rowid = expandEl.getAttribute("rowid") || "";
|
|
4236
4236
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
@@ -4316,7 +4316,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4316
4316
|
tableData.forEach((row, rIndex) => {
|
|
4317
4317
|
handleNodeRow(row, rIndex, tableData);
|
|
4318
4318
|
});
|
|
4319
|
-
|
|
4319
|
+
XEUtils.lastArrayEach(expParentList, ({ row, nextRow }) => {
|
|
4320
4320
|
const rowid = handleGetRowId(row);
|
|
4321
4321
|
const childList = row[transform ? mapChildrenField : childrenField];
|
|
4322
4322
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
@@ -4363,12 +4363,12 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4363
4363
|
const handleColumnVisible = (visible) => {
|
|
4364
4364
|
return function(fieldOrColumn) {
|
|
4365
4365
|
let status = false;
|
|
4366
|
-
const cols =
|
|
4366
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
4367
4367
|
cols.forEach((item) => {
|
|
4368
4368
|
const column = util.handleFieldOrColumn($xeTable, item);
|
|
4369
4369
|
if (column) {
|
|
4370
4370
|
if (column.children && column.children.length) {
|
|
4371
|
-
|
|
4371
|
+
XEUtils.eachTree([column], (item2) => {
|
|
4372
4372
|
item2.visible = visible;
|
|
4373
4373
|
item2.renderVisible = visible;
|
|
4374
4374
|
});
|
|
@@ -4470,14 +4470,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4470
4470
|
setRow(rows, record) {
|
|
4471
4471
|
if (rows && record) {
|
|
4472
4472
|
let rest = rows;
|
|
4473
|
-
if (!
|
|
4473
|
+
if (!XEUtils.isArray(rows)) {
|
|
4474
4474
|
rest = [rows];
|
|
4475
4475
|
}
|
|
4476
4476
|
const rowkey = util.getRowkey($xeTable);
|
|
4477
4477
|
rest.forEach((row) => {
|
|
4478
4478
|
const rowid = util.getRowid($xeTable, row);
|
|
4479
|
-
const newRecord =
|
|
4480
|
-
|
|
4479
|
+
const newRecord = XEUtils.clone(Object.assign({}, record), true);
|
|
4480
|
+
XEUtils.set(newRecord, rowkey, rowid);
|
|
4481
4481
|
Object.assign(row, newRecord);
|
|
4482
4482
|
});
|
|
4483
4483
|
}
|
|
@@ -4499,17 +4499,17 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4499
4499
|
return vue.nextTick();
|
|
4500
4500
|
}
|
|
4501
4501
|
const rowkey = util.getRowkey($xeTable);
|
|
4502
|
-
const rowid =
|
|
4502
|
+
const rowid = XEUtils.get(row, rowkey);
|
|
4503
4503
|
const oRow = sourceDataRowIdData[rowid];
|
|
4504
4504
|
if (oRow && row) {
|
|
4505
4505
|
if (field) {
|
|
4506
|
-
const newValue =
|
|
4507
|
-
|
|
4508
|
-
|
|
4506
|
+
const newValue = XEUtils.clone(XEUtils.get(record || row, field), true);
|
|
4507
|
+
XEUtils.set(row, field, newValue);
|
|
4508
|
+
XEUtils.set(oRow, field, newValue);
|
|
4509
4509
|
} else {
|
|
4510
|
-
const newRecord =
|
|
4511
|
-
|
|
4512
|
-
|
|
4510
|
+
const newRecord = XEUtils.clone(Object.assign({}, record), true);
|
|
4511
|
+
XEUtils.set(newRecord, rowkey, rowid);
|
|
4512
|
+
XEUtils.destructuring(oRow, Object.assign(row, newRecord));
|
|
4513
4513
|
}
|
|
4514
4514
|
}
|
|
4515
4515
|
reactData.tableData = tableData.slice(0);
|
|
@@ -4535,25 +4535,25 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4535
4535
|
return tableMethods.createData(childRecords).then((rows) => {
|
|
4536
4536
|
if (keepSource) {
|
|
4537
4537
|
const rowid = util.getRowid($xeTable, row);
|
|
4538
|
-
const matchObj =
|
|
4538
|
+
const matchObj = XEUtils.findTree(tableSourceData, (item) => rowid === util.getRowid($xeTable, item), { children: childrenField });
|
|
4539
4539
|
if (matchObj) {
|
|
4540
|
-
matchObj.item[childrenField] =
|
|
4540
|
+
matchObj.item[childrenField] = XEUtils.clone(rows, true);
|
|
4541
4541
|
}
|
|
4542
4542
|
rows.forEach((childRow) => {
|
|
4543
4543
|
const rowid2 = util.getRowid($xeTable, childRow);
|
|
4544
|
-
sourceDataRowIdData[rowid2] =
|
|
4544
|
+
sourceDataRowIdData[rowid2] = XEUtils.clone(childRow, true);
|
|
4545
4545
|
});
|
|
4546
4546
|
}
|
|
4547
|
-
|
|
4547
|
+
XEUtils.eachTree(rows, (childRow, index, items, path, parentItem, nodes) => {
|
|
4548
4548
|
const rowid = util.getRowid($xeTable, childRow);
|
|
4549
4549
|
const parentRow = parentItem || parentRest.row;
|
|
4550
|
-
const rest = { row: childRow, rowid, seq: -1, index
|
|
4550
|
+
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
4551
4551
|
fullDataRowIdData[rowid] = rest;
|
|
4552
4552
|
fullAllDataRowIdData[rowid] = rest;
|
|
4553
4553
|
}, { children: childrenField });
|
|
4554
4554
|
row[childrenField] = rows;
|
|
4555
4555
|
if (transform) {
|
|
4556
|
-
row[mapChildrenField] =
|
|
4556
|
+
row[mapChildrenField] = XEUtils.clone(rows, false);
|
|
4557
4557
|
}
|
|
4558
4558
|
updateAfterDataIndex();
|
|
4559
4559
|
return rows;
|
|
@@ -4566,7 +4566,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4566
4566
|
*/
|
|
4567
4567
|
loadColumn(columns) {
|
|
4568
4568
|
const { lastScrollLeft, lastScrollTop } = internalData;
|
|
4569
|
-
const collectColumn =
|
|
4569
|
+
const collectColumn = XEUtils.mapTree(columns, (column) => vue.reactive(cell.Cell.createColumn($xeTable, column)));
|
|
4570
4570
|
return handleInitColumn(collectColumn).then(() => {
|
|
4571
4571
|
let targetScrollLeft = lastScrollLeft;
|
|
4572
4572
|
let targetScrollTop = lastScrollTop;
|
|
@@ -4688,7 +4688,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4688
4688
|
* @param {Array/Object} records 新数据
|
|
4689
4689
|
*/
|
|
4690
4690
|
createRow(records) {
|
|
4691
|
-
const isArr =
|
|
4691
|
+
const isArr = XEUtils.isArray(records);
|
|
4692
4692
|
if (!isArr) {
|
|
4693
4693
|
records = [records || {}];
|
|
4694
4694
|
}
|
|
@@ -4713,11 +4713,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4713
4713
|
}
|
|
4714
4714
|
let targetRows = rows;
|
|
4715
4715
|
if (rows) {
|
|
4716
|
-
if (!
|
|
4716
|
+
if (!XEUtils.isArray(rows)) {
|
|
4717
4717
|
targetRows = [rows];
|
|
4718
4718
|
}
|
|
4719
4719
|
} else {
|
|
4720
|
-
targetRows =
|
|
4720
|
+
targetRows = XEUtils.toArray($xeTable.getUpdateRecords());
|
|
4721
4721
|
}
|
|
4722
4722
|
let reDelFlag = false;
|
|
4723
4723
|
if (targetRows.length) {
|
|
@@ -4730,9 +4730,9 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4730
4730
|
const oRow = sourceDataRowIdData[rowid];
|
|
4731
4731
|
if (oRow && row) {
|
|
4732
4732
|
if (field) {
|
|
4733
|
-
|
|
4733
|
+
XEUtils.set(row, field, XEUtils.clone(XEUtils.get(oRow, field), true));
|
|
4734
4734
|
} else {
|
|
4735
|
-
|
|
4735
|
+
XEUtils.destructuring(row, XEUtils.clone(oRow, true));
|
|
4736
4736
|
}
|
|
4737
4737
|
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
4738
4738
|
if (removeRowMaps[rowid]) {
|
|
@@ -4781,11 +4781,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4781
4781
|
const { tableFullData, visibleColumn } = internalData;
|
|
4782
4782
|
if (!arguments.length) {
|
|
4783
4783
|
rows = tableFullData;
|
|
4784
|
-
} else if (rows && !
|
|
4784
|
+
} else if (rows && !XEUtils.isArray(rows)) {
|
|
4785
4785
|
rows = [rows];
|
|
4786
4786
|
}
|
|
4787
4787
|
if (field) {
|
|
4788
|
-
rows.forEach((row) =>
|
|
4788
|
+
rows.forEach((row) => XEUtils.set(row, field, null));
|
|
4789
4789
|
} else {
|
|
4790
4790
|
rows.forEach((row) => {
|
|
4791
4791
|
visibleColumn.forEach((column) => {
|
|
@@ -4867,11 +4867,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4867
4867
|
columnIndex: $xeTable.getColumnIndex(column)
|
|
4868
4868
|
};
|
|
4869
4869
|
if (formatter) {
|
|
4870
|
-
if (
|
|
4870
|
+
if (XEUtils.isString(formatter)) {
|
|
4871
4871
|
const gFormatOpts = formats.get(formatter);
|
|
4872
4872
|
const tcFormatMethod = gFormatOpts ? gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod : null;
|
|
4873
4873
|
cellLabel = tcFormatMethod ? tcFormatMethod(formatParams) : "";
|
|
4874
|
-
} else if (
|
|
4874
|
+
} else if (XEUtils.isArray(formatter)) {
|
|
4875
4875
|
const gFormatOpts = formats.get(formatter[0]);
|
|
4876
4876
|
const tcFormatMethod = gFormatOpts ? gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod : null;
|
|
4877
4877
|
cellLabel = tcFormatMethod ? tcFormatMethod(formatParams, ...formatter.slice(1)) : "";
|
|
@@ -4895,10 +4895,10 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4895
4895
|
const { footerFormatter } = column;
|
|
4896
4896
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
4897
4897
|
let itemValue = "";
|
|
4898
|
-
if (
|
|
4898
|
+
if (XEUtils.isArray(row)) {
|
|
4899
4899
|
itemValue = row[_columnIndex];
|
|
4900
4900
|
} else {
|
|
4901
|
-
itemValue =
|
|
4901
|
+
itemValue = XEUtils.get(row, column.field);
|
|
4902
4902
|
}
|
|
4903
4903
|
let cellLabel = itemValue;
|
|
4904
4904
|
if (footerFormatter) {
|
|
@@ -4934,11 +4934,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4934
4934
|
_columnIndex,
|
|
4935
4935
|
columnIndex: $xeTable.getColumnIndex(column)
|
|
4936
4936
|
};
|
|
4937
|
-
if (
|
|
4937
|
+
if (XEUtils.isString(footerFormatter)) {
|
|
4938
4938
|
const gFormatOpts = formats.get(footerFormatter);
|
|
4939
4939
|
const fcFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
4940
4940
|
cellLabel = fcFormatMethod ? fcFormatMethod(footerFormatParams) : "";
|
|
4941
|
-
} else if (
|
|
4941
|
+
} else if (XEUtils.isArray(footerFormatter)) {
|
|
4942
4942
|
const gFormatOpts = formats.get(footerFormatter[0]);
|
|
4943
4943
|
const fcFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
4944
4944
|
cellLabel = fcFormatMethod ? fcFormatMethod(footerFormatParams, ...footerFormatter.slice(1)) : "";
|
|
@@ -4967,7 +4967,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4967
4967
|
*/
|
|
4968
4968
|
removeInsertRow() {
|
|
4969
4969
|
const { insertRowMaps } = internalData;
|
|
4970
|
-
return $xeTable.remove(
|
|
4970
|
+
return $xeTable.remove(XEUtils.values(insertRowMaps));
|
|
4971
4971
|
},
|
|
4972
4972
|
/**
|
|
4973
4973
|
* 检查行或列数据是否发生改变
|
|
@@ -4976,7 +4976,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4976
4976
|
const { keepSource } = props$1;
|
|
4977
4977
|
const { tableFullColumn, fullDataRowIdData, sourceDataRowIdData } = internalData;
|
|
4978
4978
|
if (keepSource) {
|
|
4979
|
-
const rowid =
|
|
4979
|
+
const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : util.getRowid($xeTable, rowidOrRow);
|
|
4980
4980
|
const rowRest = fullDataRowIdData[rowid];
|
|
4981
4981
|
if (!rowRest) {
|
|
4982
4982
|
return false;
|
|
@@ -4987,8 +4987,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
4987
4987
|
if (arguments.length > 1) {
|
|
4988
4988
|
return !eqCellValue(oRow, row, field);
|
|
4989
4989
|
}
|
|
4990
|
-
for (let
|
|
4991
|
-
const property = tableFullColumn[
|
|
4990
|
+
for (let index = 0, len = tableFullColumn.length; index < len; index++) {
|
|
4991
|
+
const property = tableFullColumn[index].field;
|
|
4992
4992
|
if (property && !eqCellValue(oRow, row, property)) {
|
|
4993
4993
|
return true;
|
|
4994
4994
|
}
|
|
@@ -5003,7 +5003,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5003
5003
|
*/
|
|
5004
5004
|
getColumns(columnIndex) {
|
|
5005
5005
|
const { visibleColumn } = internalData;
|
|
5006
|
-
return
|
|
5006
|
+
return XEUtils.isUndefined(columnIndex) ? visibleColumn.slice(0) : visibleColumn[columnIndex];
|
|
5007
5007
|
},
|
|
5008
5008
|
/**
|
|
5009
5009
|
* 根据列获取列的唯一主键
|
|
@@ -5058,7 +5058,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5058
5058
|
let prevDragCol = null;
|
|
5059
5059
|
const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
|
|
5060
5060
|
let defPos = "left";
|
|
5061
|
-
if (
|
|
5061
|
+
if (XEUtils.isNumber(targetFieldOrColumn)) {
|
|
5062
5062
|
if (colRest && targetFieldOrColumn) {
|
|
5063
5063
|
let currList = colRest.items;
|
|
5064
5064
|
let offsetIndex = colRest._index + targetFieldOrColumn;
|
|
@@ -5099,7 +5099,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5099
5099
|
let prevDragRow = null;
|
|
5100
5100
|
let defPos = "top";
|
|
5101
5101
|
const rowRest = dragRow ? fullAllDataRowIdData[util.getRowid($xeTable, dragRow)] : null;
|
|
5102
|
-
if (
|
|
5102
|
+
if (XEUtils.isNumber(targetRowidOrRow)) {
|
|
5103
5103
|
if (rowRest && targetRowidOrRow) {
|
|
5104
5104
|
let currList = afterFullData;
|
|
5105
5105
|
let offsetIndex = rowRest._index + targetRowidOrRow;
|
|
@@ -5144,7 +5144,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5144
5144
|
*/
|
|
5145
5145
|
getData(rowIndex) {
|
|
5146
5146
|
const tableSynchData = props$1.data || internalData.tableSynchData;
|
|
5147
|
-
return
|
|
5147
|
+
return XEUtils.isUndefined(rowIndex) ? tableSynchData.slice(0) : tableSynchData[rowIndex];
|
|
5148
5148
|
},
|
|
5149
5149
|
/**
|
|
5150
5150
|
* 用于多选行,获取已选中的数据
|
|
@@ -5163,14 +5163,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5163
5163
|
if (checkField) {
|
|
5164
5164
|
if (treeConfig) {
|
|
5165
5165
|
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? tableFullTreeData : afterFullData;
|
|
5166
|
-
rowList =
|
|
5166
|
+
rowList = XEUtils.filterTree(currTableData, (row) => XEUtils.get(row, checkField), { children: transform ? mapChildrenField : childrenField });
|
|
5167
5167
|
} else {
|
|
5168
5168
|
const currTableData = isFull ? tableFullData : afterFullData;
|
|
5169
|
-
rowList = currTableData.filter((row) =>
|
|
5169
|
+
rowList = currTableData.filter((row) => XEUtils.get(row, checkField));
|
|
5170
5170
|
}
|
|
5171
5171
|
} else {
|
|
5172
5172
|
const currMaps = isFull || treeConfig && !transform ? fullDataRowIdData : afterFullRowMaps;
|
|
5173
|
-
|
|
5173
|
+
XEUtils.each(selectCheckboxMaps, (row, rowid) => {
|
|
5174
5174
|
if (currMaps[rowid]) {
|
|
5175
5175
|
rowList.push(fullDataRowIdData[rowid].row);
|
|
5176
5176
|
}
|
|
@@ -5190,7 +5190,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5190
5190
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5191
5191
|
if (rowOrRowid && treeConfig) {
|
|
5192
5192
|
let rowid;
|
|
5193
|
-
if (
|
|
5193
|
+
if (XEUtils.isString(rowOrRowid)) {
|
|
5194
5194
|
rowid = rowOrRowid;
|
|
5195
5195
|
} else {
|
|
5196
5196
|
rowid = util.getRowid($xeTable, rowOrRowid);
|
|
@@ -5213,7 +5213,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5213
5213
|
const { fullAllDataRowIdData } = internalData;
|
|
5214
5214
|
if (rowOrRowid && treeConfig) {
|
|
5215
5215
|
let rowid;
|
|
5216
|
-
if (
|
|
5216
|
+
if (XEUtils.isString(rowOrRowid)) {
|
|
5217
5217
|
rowid = rowOrRowid;
|
|
5218
5218
|
} else {
|
|
5219
5219
|
rowid = util.getRowid($xeTable, rowOrRowid);
|
|
@@ -5235,7 +5235,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5235
5235
|
const { fullAllDataRowIdData } = internalData;
|
|
5236
5236
|
if (rowOrRowid && treeConfig) {
|
|
5237
5237
|
let rowid;
|
|
5238
|
-
if (
|
|
5238
|
+
if (XEUtils.isString(rowOrRowid)) {
|
|
5239
5239
|
rowid = rowOrRowid;
|
|
5240
5240
|
} else {
|
|
5241
5241
|
rowid = util.getRowid($xeTable, rowOrRowid);
|
|
@@ -5259,7 +5259,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5259
5259
|
*/
|
|
5260
5260
|
getRowById(cellValue) {
|
|
5261
5261
|
const { fullAllDataRowIdData } = internalData;
|
|
5262
|
-
const rowid =
|
|
5262
|
+
const rowid = XEUtils.eqNull(cellValue) ? "" : encodeURIComponent(cellValue || "");
|
|
5263
5263
|
return fullAllDataRowIdData[rowid] ? fullAllDataRowIdData[rowid].row : null;
|
|
5264
5264
|
},
|
|
5265
5265
|
/**
|
|
@@ -5300,7 +5300,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5300
5300
|
*/
|
|
5301
5301
|
setColumnFixed(fieldOrColumn, fixed) {
|
|
5302
5302
|
let status = false;
|
|
5303
|
-
const cols =
|
|
5303
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
5304
5304
|
const columnOpts = computeColumnOpts.value;
|
|
5305
5305
|
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
5306
5306
|
for (let i = 0; i < cols.length; i++) {
|
|
@@ -5317,7 +5317,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5317
5317
|
}
|
|
5318
5318
|
return vue.nextTick();
|
|
5319
5319
|
}
|
|
5320
|
-
|
|
5320
|
+
XEUtils.eachTree([targetColumn], (column2) => {
|
|
5321
5321
|
column2.fixed = fixed;
|
|
5322
5322
|
column2.renderFixed = fixed;
|
|
5323
5323
|
});
|
|
@@ -5337,12 +5337,12 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5337
5337
|
*/
|
|
5338
5338
|
clearColumnFixed(fieldOrColumn) {
|
|
5339
5339
|
let status = false;
|
|
5340
|
-
const cols =
|
|
5340
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
5341
5341
|
cols.forEach((item) => {
|
|
5342
5342
|
const column = util.handleFieldOrColumn($xeTable, item);
|
|
5343
5343
|
const targetColumn = util.getRootColumn($xeTable, column);
|
|
5344
5344
|
if (targetColumn && targetColumn.fixed) {
|
|
5345
|
-
|
|
5345
|
+
XEUtils.eachTree([targetColumn], (column2) => {
|
|
5346
5346
|
column2.fixed = null;
|
|
5347
5347
|
column2.renderFixed = null;
|
|
5348
5348
|
});
|
|
@@ -5368,8 +5368,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5368
5368
|
setColumnWidth(fieldOrColumn, width) {
|
|
5369
5369
|
const { elemStore } = internalData;
|
|
5370
5370
|
let status = false;
|
|
5371
|
-
const cols =
|
|
5372
|
-
let cWidth =
|
|
5371
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
5372
|
+
let cWidth = XEUtils.toInteger(width);
|
|
5373
5373
|
if (dom.isScale(width)) {
|
|
5374
5374
|
const bodyScrollElem = util.getRefElem(elemStore["main-body-scroll"]);
|
|
5375
5375
|
const bodyWidth = bodyScrollElem ? bodyScrollElem.clientWidth - 1 : 0;
|
|
@@ -5430,10 +5430,10 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5430
5430
|
const { fullAllDataRowIdData } = internalData;
|
|
5431
5431
|
let status = false;
|
|
5432
5432
|
if (heightConf) {
|
|
5433
|
-
|
|
5433
|
+
XEUtils.each(heightConf, (height, rowid) => {
|
|
5434
5434
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5435
5435
|
if (rowRest) {
|
|
5436
|
-
const rHeight =
|
|
5436
|
+
const rHeight = XEUtils.toInteger(height);
|
|
5437
5437
|
if (rHeight) {
|
|
5438
5438
|
rowRest.resizeHeight = rHeight;
|
|
5439
5439
|
if (!status) {
|
|
@@ -5474,13 +5474,13 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5474
5474
|
},
|
|
5475
5475
|
recalcRowHeight(rowOrId) {
|
|
5476
5476
|
const { fullAllDataRowIdData } = internalData;
|
|
5477
|
-
const rows =
|
|
5477
|
+
const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
5478
5478
|
const el = refElem.value;
|
|
5479
5479
|
if (el) {
|
|
5480
5480
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
5481
5481
|
el.setAttribute("data-calc-row", "Y");
|
|
5482
5482
|
rows.forEach((row) => {
|
|
5483
|
-
const rowid =
|
|
5483
|
+
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
5484
5484
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5485
5485
|
if (rowRest) {
|
|
5486
5486
|
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
@@ -5494,8 +5494,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5494
5494
|
setRowHeight(rowOrId, height) {
|
|
5495
5495
|
const { fullAllDataRowIdData } = internalData;
|
|
5496
5496
|
let status = false;
|
|
5497
|
-
const rows =
|
|
5498
|
-
let rHeight =
|
|
5497
|
+
const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
5498
|
+
let rHeight = XEUtils.toInteger(height);
|
|
5499
5499
|
if (dom.isScale(height)) {
|
|
5500
5500
|
const tableBody = refTableBody.value;
|
|
5501
5501
|
const bodyElem = tableBody ? tableBody.$el : null;
|
|
@@ -5505,7 +5505,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5505
5505
|
if (rHeight) {
|
|
5506
5506
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
5507
5507
|
rows.forEach((row) => {
|
|
5508
|
-
const rowid =
|
|
5508
|
+
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
5509
5509
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5510
5510
|
if (rowRest) {
|
|
5511
5511
|
rowRest.resizeHeight = rHeight;
|
|
@@ -5528,7 +5528,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5528
5528
|
const rowOpts = computeRowOpts.value;
|
|
5529
5529
|
const cellOpts = computeCellOpts.value;
|
|
5530
5530
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
5531
|
-
const rowid =
|
|
5531
|
+
const rowid = XEUtils.isString(rowOrId) || XEUtils.isNumber(rowOrId) ? rowOrId : util.getRowid($xeTable, rowOrId);
|
|
5532
5532
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5533
5533
|
if (rowRest) {
|
|
5534
5534
|
return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
@@ -5629,7 +5629,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5629
5629
|
if (treeConfig) {
|
|
5630
5630
|
const fullRest = [];
|
|
5631
5631
|
const defRest = [];
|
|
5632
|
-
|
|
5632
|
+
XEUtils.each(treeIndeterminateRowMaps, (item, rowid) => {
|
|
5633
5633
|
if (item) {
|
|
5634
5634
|
fullRest.push(item);
|
|
5635
5635
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -5650,14 +5650,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5650
5650
|
* @param {Boolean} value 是否选中
|
|
5651
5651
|
*/
|
|
5652
5652
|
setCheckboxRow(rows, checked) {
|
|
5653
|
-
if (rows && !
|
|
5653
|
+
if (rows && !XEUtils.isArray(rows)) {
|
|
5654
5654
|
rows = [rows];
|
|
5655
5655
|
}
|
|
5656
5656
|
return handleCheckedCheckboxRow(rows, checked, true);
|
|
5657
5657
|
},
|
|
5658
5658
|
setCheckboxRowKey(keys, checked) {
|
|
5659
5659
|
const { fullAllDataRowIdData } = internalData;
|
|
5660
|
-
if (!
|
|
5660
|
+
if (!XEUtils.isArray(keys)) {
|
|
5661
5661
|
keys = [keys];
|
|
5662
5662
|
}
|
|
5663
5663
|
const rows = [];
|
|
@@ -5675,7 +5675,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5675
5675
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
5676
5676
|
const { checkField } = checkboxOpts;
|
|
5677
5677
|
if (checkField) {
|
|
5678
|
-
return
|
|
5678
|
+
return XEUtils.get(row, checkField);
|
|
5679
5679
|
}
|
|
5680
5680
|
return !!updateCheckboxFlag && !!selectCheckboxMaps[util.getRowid($xeTable, row)];
|
|
5681
5681
|
},
|
|
@@ -5687,7 +5687,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5687
5687
|
if (checkField) {
|
|
5688
5688
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5689
5689
|
if (rowRest) {
|
|
5690
|
-
return
|
|
5690
|
+
return XEUtils.get(rowRest.row, checkField);
|
|
5691
5691
|
}
|
|
5692
5692
|
return false;
|
|
5693
5693
|
}
|
|
@@ -5708,7 +5708,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5708
5708
|
const { selectCheckboxMaps } = internalData;
|
|
5709
5709
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
5710
5710
|
const { checkField } = checkboxOpts;
|
|
5711
|
-
const checked = checkField ? !
|
|
5711
|
+
const checked = checkField ? !XEUtils.get(row, checkField) : !selectCheckboxMaps[util.getRowid($xeTable, row)];
|
|
5712
5712
|
tablePrivateMethods.handleBatchSelectRows([row], checked, true);
|
|
5713
5713
|
tablePrivateMethods.checkSelectionStatus();
|
|
5714
5714
|
return vue.nextTick();
|
|
@@ -5738,12 +5738,12 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5738
5738
|
} else {
|
|
5739
5739
|
const rowkey = util.getRowkey($xeTable);
|
|
5740
5740
|
if (treeConfig) {
|
|
5741
|
-
const matchObj =
|
|
5741
|
+
const matchObj = XEUtils.findTree(afterFullData, (row) => rowid === XEUtils.get(row, rowkey), { children: childrenField });
|
|
5742
5742
|
if (matchObj) {
|
|
5743
5743
|
return radioReserveRow;
|
|
5744
5744
|
}
|
|
5745
5745
|
} else {
|
|
5746
|
-
if (!afterFullData.some((row) => rowid ===
|
|
5746
|
+
if (!afterFullData.some((row) => rowid === XEUtils.get(row, rowkey))) {
|
|
5747
5747
|
return radioReserveRow;
|
|
5748
5748
|
}
|
|
5749
5749
|
}
|
|
@@ -5769,7 +5769,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5769
5769
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
5770
5770
|
const afterFullIdMaps = {};
|
|
5771
5771
|
if (treeConfig) {
|
|
5772
|
-
|
|
5772
|
+
XEUtils.eachTree(afterFullData, (row) => {
|
|
5773
5773
|
afterFullIdMaps[handleGetRowId(row)] = 1;
|
|
5774
5774
|
}, { children: childrenField });
|
|
5775
5775
|
} else {
|
|
@@ -5777,7 +5777,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5777
5777
|
afterFullIdMaps[handleGetRowId(row)] = 1;
|
|
5778
5778
|
});
|
|
5779
5779
|
}
|
|
5780
|
-
|
|
5780
|
+
XEUtils.each(checkboxReserveRowMap, (oldRow, oldRowid) => {
|
|
5781
5781
|
if (oldRow) {
|
|
5782
5782
|
if (isFull) {
|
|
5783
5783
|
if (!fullDataRowIdData[oldRowid]) {
|
|
@@ -5819,12 +5819,12 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5819
5819
|
if (checkField) {
|
|
5820
5820
|
const handleClearChecked = (item) => {
|
|
5821
5821
|
if (treeConfig && indeterminateField) {
|
|
5822
|
-
|
|
5822
|
+
XEUtils.set(item, indeterminateField, false);
|
|
5823
5823
|
}
|
|
5824
|
-
|
|
5824
|
+
XEUtils.set(item, checkField, false);
|
|
5825
5825
|
};
|
|
5826
5826
|
if (treeConfig) {
|
|
5827
|
-
|
|
5827
|
+
XEUtils.eachTree(tableFullData, handleClearChecked, { children: childrenField });
|
|
5828
5828
|
} else {
|
|
5829
5829
|
tableFullData.forEach(handleClearChecked);
|
|
5830
5830
|
}
|
|
@@ -5851,7 +5851,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5851
5851
|
reactData.currentRow = row;
|
|
5852
5852
|
if (rowOpts.isCurrent || props$1.highlightCurrentRow) {
|
|
5853
5853
|
if (el) {
|
|
5854
|
-
|
|
5854
|
+
XEUtils.arrayEach(el.querySelectorAll(`[rowid="${util.getRowid($xeTable, row)}"]`), (elem) => dom.addClass(elem, "row--current"));
|
|
5855
5855
|
}
|
|
5856
5856
|
}
|
|
5857
5857
|
if ($xeGanttView && $xeGanttView.handleUpdateCurrentRow) {
|
|
@@ -5901,7 +5901,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5901
5901
|
reactData.currentRow = null;
|
|
5902
5902
|
internalData.hoverRow = null;
|
|
5903
5903
|
if (el) {
|
|
5904
|
-
|
|
5904
|
+
XEUtils.arrayEach(el.querySelectorAll(".row--current"), (elem) => dom.removeClass(elem, "row--current"));
|
|
5905
5905
|
}
|
|
5906
5906
|
if ($xeGanttView && $xeGanttView.handleUpdateCurrentRow) {
|
|
5907
5907
|
$xeGanttView.handleUpdateCurrentRow();
|
|
@@ -5988,7 +5988,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
5988
5988
|
setPendingRow(rows, status) {
|
|
5989
5989
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
5990
5990
|
const { pendingRowMaps } = internalData;
|
|
5991
|
-
if (rows && !
|
|
5991
|
+
if (rows && !XEUtils.isArray(rows)) {
|
|
5992
5992
|
rows = [rows];
|
|
5993
5993
|
}
|
|
5994
5994
|
if (status) {
|
|
@@ -6012,7 +6012,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6012
6012
|
togglePendingRow(rows) {
|
|
6013
6013
|
const { handleGetRowId } = util.createHandleGetRowId($xeTable);
|
|
6014
6014
|
const { pendingRowMaps } = internalData;
|
|
6015
|
-
if (rows && !
|
|
6015
|
+
if (rows && !XEUtils.isArray(rows)) {
|
|
6016
6016
|
rows = [rows];
|
|
6017
6017
|
}
|
|
6018
6018
|
rows.forEach((row) => {
|
|
@@ -6039,7 +6039,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6039
6039
|
getPendingRecords() {
|
|
6040
6040
|
const { fullAllDataRowIdData, pendingRowMaps } = internalData;
|
|
6041
6041
|
const insertRecords = [];
|
|
6042
|
-
|
|
6042
|
+
XEUtils.each(pendingRowMaps, (row, rowid) => {
|
|
6043
6043
|
if (fullAllDataRowIdData[rowid]) {
|
|
6044
6044
|
insertRecords.push(row);
|
|
6045
6045
|
}
|
|
@@ -6055,23 +6055,23 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6055
6055
|
const sortOpts = computeSortOpts.value;
|
|
6056
6056
|
const { multiple, remote, orders } = sortOpts;
|
|
6057
6057
|
if (sortConfs) {
|
|
6058
|
-
if (
|
|
6058
|
+
if (XEUtils.isString(sortConfs)) {
|
|
6059
6059
|
sortConfs = [
|
|
6060
6060
|
{ field: sortConfs, order: sortOrder }
|
|
6061
6061
|
];
|
|
6062
6062
|
}
|
|
6063
6063
|
}
|
|
6064
|
-
if (!
|
|
6064
|
+
if (!XEUtils.isArray(sortConfs)) {
|
|
6065
6065
|
sortConfs = [sortConfs];
|
|
6066
6066
|
}
|
|
6067
6067
|
if (sortConfs.length) {
|
|
6068
6068
|
if (!multiple) {
|
|
6069
6069
|
clearAllSort();
|
|
6070
6070
|
}
|
|
6071
|
-
(multiple ? sortConfs : [sortConfs[0]]).forEach((confs, index
|
|
6071
|
+
(multiple ? sortConfs : [sortConfs[0]]).forEach((confs, index) => {
|
|
6072
6072
|
let { field, order } = confs;
|
|
6073
6073
|
let column = field;
|
|
6074
|
-
if (
|
|
6074
|
+
if (XEUtils.isString(field)) {
|
|
6075
6075
|
column = tableMethods.getColumnByField(field);
|
|
6076
6076
|
}
|
|
6077
6077
|
if (column && column.sortable) {
|
|
@@ -6081,7 +6081,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6081
6081
|
if (column.order !== order) {
|
|
6082
6082
|
column.order = order;
|
|
6083
6083
|
}
|
|
6084
|
-
column.sortTime = Date.now() + index
|
|
6084
|
+
column.sortTime = Date.now() + index;
|
|
6085
6085
|
}
|
|
6086
6086
|
});
|
|
6087
6087
|
if (!remote) {
|
|
@@ -6182,7 +6182,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6182
6182
|
}
|
|
6183
6183
|
});
|
|
6184
6184
|
if (multiple && chronological && sortList.length > 1) {
|
|
6185
|
-
return
|
|
6185
|
+
return XEUtils.orderBy(sortList, "sortTime");
|
|
6186
6186
|
}
|
|
6187
6187
|
return sortList;
|
|
6188
6188
|
},
|
|
@@ -6353,7 +6353,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6353
6353
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6354
6354
|
let expandedRows = [];
|
|
6355
6355
|
if (props$1.treeConfig) {
|
|
6356
|
-
|
|
6356
|
+
XEUtils.eachTree(tableFullTreeData, (row) => {
|
|
6357
6357
|
expandedRows.push(row);
|
|
6358
6358
|
}, { children: childrenField });
|
|
6359
6359
|
} else {
|
|
@@ -6378,7 +6378,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6378
6378
|
const columnIndex = expandColumn ? $xeTable.getColumnIndex(expandColumn) : -1;
|
|
6379
6379
|
const $columnIndex = expandColumn ? $xeTable.getVMColumnIndex(expandColumn) : -1;
|
|
6380
6380
|
if (rows) {
|
|
6381
|
-
if (!
|
|
6381
|
+
if (!XEUtils.isArray(rows)) {
|
|
6382
6382
|
rows = [rows];
|
|
6383
6383
|
}
|
|
6384
6384
|
if (accordion) {
|
|
@@ -6466,7 +6466,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6466
6466
|
},
|
|
6467
6467
|
getRowExpandRecords() {
|
|
6468
6468
|
const rest = [];
|
|
6469
|
-
|
|
6469
|
+
XEUtils.each(internalData.rowExpandedMaps, (item) => {
|
|
6470
6470
|
if (item) {
|
|
6471
6471
|
rest.push(item);
|
|
6472
6472
|
}
|
|
@@ -6481,7 +6481,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6481
6481
|
log.errLog("vxe.error.reqProp", ["aggregate-config"]);
|
|
6482
6482
|
return vue.nextTick();
|
|
6483
6483
|
}
|
|
6484
|
-
const confList = fieldOrColumns ?
|
|
6484
|
+
const confList = fieldOrColumns ? XEUtils.isArray(fieldOrColumns) ? fieldOrColumns : [fieldOrColumns] : [];
|
|
6485
6485
|
if (maxGroupSize && confList.length > maxGroupSize) {
|
|
6486
6486
|
if (index_esm.VxeUI.modal) {
|
|
6487
6487
|
index_esm.VxeUI.modal.message({
|
|
@@ -6493,7 +6493,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6493
6493
|
}
|
|
6494
6494
|
if (confList.length) {
|
|
6495
6495
|
handleUpdateRowGroup(confList.map((fieldOrColumn) => {
|
|
6496
|
-
return
|
|
6496
|
+
return XEUtils.isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field;
|
|
6497
6497
|
}));
|
|
6498
6498
|
return loadTableData(internalData.tableSynchData, false, true);
|
|
6499
6499
|
}
|
|
@@ -6559,7 +6559,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6559
6559
|
},
|
|
6560
6560
|
setRowGroupExpand(rows, expanded) {
|
|
6561
6561
|
if (rows) {
|
|
6562
|
-
if (!
|
|
6562
|
+
if (!XEUtils.isArray(rows)) {
|
|
6563
6563
|
rows = [rows];
|
|
6564
6564
|
}
|
|
6565
6565
|
return handleRowGroupVirtualExpand(rows, expanded);
|
|
@@ -6571,7 +6571,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6571
6571
|
const aggregateOpts = computeAggregateOpts.value;
|
|
6572
6572
|
const { childrenField } = aggregateOpts;
|
|
6573
6573
|
if (groupFields) {
|
|
6574
|
-
if (!
|
|
6574
|
+
if (!XEUtils.isArray(groupFields)) {
|
|
6575
6575
|
groupFields = [groupFields];
|
|
6576
6576
|
}
|
|
6577
6577
|
if (isRowGroupStatus) {
|
|
@@ -6580,7 +6580,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6580
6580
|
groupFields.forEach((groupField) => {
|
|
6581
6581
|
gfKeys[groupField] = true;
|
|
6582
6582
|
});
|
|
6583
|
-
|
|
6583
|
+
XEUtils.eachTree(internalData.afterGroupFullData, (row) => {
|
|
6584
6584
|
if (row.isAggregate && gfKeys[row.groupField]) {
|
|
6585
6585
|
rows.push(row);
|
|
6586
6586
|
}
|
|
@@ -6598,7 +6598,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6598
6598
|
const { mapChildrenField } = aggregateOpts;
|
|
6599
6599
|
const rgExpandedMaps = {};
|
|
6600
6600
|
if (expanded && mapChildrenField) {
|
|
6601
|
-
|
|
6601
|
+
XEUtils.eachTree(tableFullGroupData, (row) => {
|
|
6602
6602
|
if (row[mapChildrenField] && row[mapChildrenField].length) {
|
|
6603
6603
|
rgExpandedMaps[util.getRowid($xeTable, row)] = row;
|
|
6604
6604
|
}
|
|
@@ -6621,7 +6621,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6621
6621
|
},
|
|
6622
6622
|
getTreeExpandRecords() {
|
|
6623
6623
|
const rest = [];
|
|
6624
|
-
|
|
6624
|
+
XEUtils.each(internalData.treeExpandedMaps, (item) => {
|
|
6625
6625
|
if (item) {
|
|
6626
6626
|
rest.push(item);
|
|
6627
6627
|
}
|
|
@@ -6642,7 +6642,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6642
6642
|
const treeOpts = computeTreeOpts.value;
|
|
6643
6643
|
const { transform } = treeOpts;
|
|
6644
6644
|
if (rows) {
|
|
6645
|
-
if (!
|
|
6645
|
+
if (!XEUtils.isArray(rows)) {
|
|
6646
6646
|
rows = [rows];
|
|
6647
6647
|
}
|
|
6648
6648
|
rows.forEach((row) => {
|
|
@@ -6656,7 +6656,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6656
6656
|
}
|
|
6657
6657
|
});
|
|
6658
6658
|
} else {
|
|
6659
|
-
|
|
6659
|
+
XEUtils.each(fullAllDataRowIdData, (rowRest) => {
|
|
6660
6660
|
rowRest.treeLoaded = false;
|
|
6661
6661
|
});
|
|
6662
6662
|
internalData.treeExpandedMaps = {};
|
|
@@ -6713,7 +6713,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6713
6713
|
const { transform, lazy } = treeOpts;
|
|
6714
6714
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6715
6715
|
const expandeds = [];
|
|
6716
|
-
|
|
6716
|
+
XEUtils.eachTree(tableFullData, (row) => {
|
|
6717
6717
|
const rowChildren = row[childrenField];
|
|
6718
6718
|
if (lazy || rowChildren && rowChildren.length) {
|
|
6719
6719
|
expandeds.push(row);
|
|
@@ -6738,7 +6738,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6738
6738
|
const treeOpts = computeTreeOpts.value;
|
|
6739
6739
|
const { transform } = treeOpts;
|
|
6740
6740
|
if (rows) {
|
|
6741
|
-
if (!
|
|
6741
|
+
if (!XEUtils.isArray(rows)) {
|
|
6742
6742
|
rows = [rows];
|
|
6743
6743
|
}
|
|
6744
6744
|
if (rows.length) {
|
|
@@ -6771,7 +6771,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6771
6771
|
const expList = $xeTable.getTreeExpandRecords();
|
|
6772
6772
|
internalData.treeExpandedMaps = {};
|
|
6773
6773
|
if (reserve) {
|
|
6774
|
-
|
|
6774
|
+
XEUtils.eachTree(tableFullTreeData, (row) => handleTreeExpandReserve(row, false), { children: childrenField });
|
|
6775
6775
|
}
|
|
6776
6776
|
return $xeTable.handleTableData().then(() => {
|
|
6777
6777
|
if (transform) {
|
|
@@ -6844,19 +6844,19 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
6844
6844
|
const yHandleEl = refScrollYHandleElem.value;
|
|
6845
6845
|
internalData.intoRunScroll = true;
|
|
6846
6846
|
if (scrollLeft) {
|
|
6847
|
-
if (!
|
|
6847
|
+
if (!XEUtils.isNumber(scrollLeft)) {
|
|
6848
6848
|
scrollTop = scrollLeft.top;
|
|
6849
6849
|
scrollLeft = scrollLeft.left;
|
|
6850
6850
|
}
|
|
6851
6851
|
}
|
|
6852
|
-
if (
|
|
6852
|
+
if (XEUtils.isNumber(scrollLeft)) {
|
|
6853
6853
|
dom.setScrollLeft(xHandleEl, scrollLeft);
|
|
6854
6854
|
dom.setScrollLeft(bodyScrollElem, scrollLeft);
|
|
6855
6855
|
dom.setScrollLeft(headerScrollElem, scrollLeft);
|
|
6856
6856
|
dom.setScrollLeft(footerScrollElem, scrollLeft);
|
|
6857
6857
|
loadScrollXData();
|
|
6858
6858
|
}
|
|
6859
|
-
if (
|
|
6859
|
+
if (XEUtils.isNumber(scrollTop)) {
|
|
6860
6860
|
dom.setScrollTop(yHandleEl, scrollTop);
|
|
6861
6861
|
dom.setScrollTop(bodyScrollElem, scrollTop);
|
|
6862
6862
|
dom.setScrollTop(leftScrollElem, scrollTop);
|
|
@@ -7199,7 +7199,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
7199
7199
|
let hasVisible = 0;
|
|
7200
7200
|
let hasAggFunc = 0;
|
|
7201
7201
|
const sortMaps = {};
|
|
7202
|
-
|
|
7202
|
+
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
7203
7203
|
const colKey = column.getKey();
|
|
7204
7204
|
if (!colKey) {
|
|
7205
7205
|
log.errLog("vxe.error.reqProp", [`${column.getTitle() || column.type || ""} -> column.field=?`]);
|
|
@@ -7678,7 +7678,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
7678
7678
|
}
|
|
7679
7679
|
}
|
|
7680
7680
|
} else if (hasBackspaceKey && keyboardConfig && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
|
|
7681
|
-
const { parent: parentRow } =
|
|
7681
|
+
const { parent: parentRow } = XEUtils.findTree(internalData.afterTreeFullData, (item) => item === currentRow, { children: childrenField });
|
|
7682
7682
|
if (parentRow) {
|
|
7683
7683
|
evnt.preventDefault();
|
|
7684
7684
|
const params = {
|
|
@@ -7819,7 +7819,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
7819
7819
|
const el = refElem.value;
|
|
7820
7820
|
if (el) {
|
|
7821
7821
|
const clss = "row--drag-origin";
|
|
7822
|
-
|
|
7822
|
+
XEUtils.arrayEach(el.querySelectorAll(`.${clss}`), (elem) => {
|
|
7823
7823
|
elem.draggable = false;
|
|
7824
7824
|
dom.removeClass(elem, clss);
|
|
7825
7825
|
});
|
|
@@ -7830,7 +7830,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
7830
7830
|
if (el) {
|
|
7831
7831
|
const clss = "row--drag-origin";
|
|
7832
7832
|
const rowid = util.getRowid($xeTable, row);
|
|
7833
|
-
|
|
7833
|
+
XEUtils.arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`), (elem) => {
|
|
7834
7834
|
dom.addClass(elem, clss);
|
|
7835
7835
|
});
|
|
7836
7836
|
}
|
|
@@ -7857,11 +7857,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
7857
7857
|
const el = refElem.value;
|
|
7858
7858
|
if (el) {
|
|
7859
7859
|
const colQuerys = [];
|
|
7860
|
-
|
|
7860
|
+
XEUtils.eachTree([column], (item) => {
|
|
7861
7861
|
colQuerys.push(`[colid="${item.id}"]`);
|
|
7862
7862
|
});
|
|
7863
7863
|
const clss = "col--drag-origin";
|
|
7864
|
-
|
|
7864
|
+
XEUtils.arrayEach(el.querySelectorAll(colQuerys.join(",")), (elem) => {
|
|
7865
7865
|
dom.addClass(elem, clss);
|
|
7866
7866
|
});
|
|
7867
7867
|
}
|
|
@@ -7870,7 +7870,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
7870
7870
|
const el = refElem.value;
|
|
7871
7871
|
if (el) {
|
|
7872
7872
|
const clss = "col--drag-origin";
|
|
7873
|
-
|
|
7873
|
+
XEUtils.arrayEach(el.querySelectorAll(`.${clss}`), (elem) => {
|
|
7874
7874
|
elem.draggable = false;
|
|
7875
7875
|
dom.removeClass(elem, clss);
|
|
7876
7876
|
});
|
|
@@ -8030,8 +8030,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8030
8030
|
const { column, row } = params;
|
|
8031
8031
|
const { showAll, contentMethod } = tipOpts;
|
|
8032
8032
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
8033
|
-
const useCustom = contentMethod && !
|
|
8034
|
-
const content = useCustom ? customContent :
|
|
8033
|
+
const useCustom = contentMethod && !XEUtils.eqNull(customContent);
|
|
8034
|
+
const content = useCustom ? customContent : XEUtils.toString(column.type === "html" ? tipOverEl.innerText : tipOverEl.textContent).trim();
|
|
8035
8035
|
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth;
|
|
8036
8036
|
if (content && (showAll || useCustom || isOver)) {
|
|
8037
8037
|
const tipContent = utils.formatText(content);
|
|
@@ -8057,7 +8057,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8057
8057
|
if ($xeGGWrapper) {
|
|
8058
8058
|
return $xeGGWrapper.callSlot(slotFunc, params);
|
|
8059
8059
|
}
|
|
8060
|
-
if (
|
|
8060
|
+
if (XEUtils.isFunction(slotFunc)) {
|
|
8061
8061
|
return vn.getSlotVNs(slotFunc(params));
|
|
8062
8062
|
}
|
|
8063
8063
|
}
|
|
@@ -8124,36 +8124,36 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8124
8124
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
8125
8125
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8126
8126
|
const rowkey = util.getRowkey($xeTable);
|
|
8127
|
-
if (!
|
|
8127
|
+
if (!XEUtils.isArray(records)) {
|
|
8128
8128
|
records = [records];
|
|
8129
8129
|
}
|
|
8130
8130
|
return records.map((record) => {
|
|
8131
8131
|
internalData.tableFullColumn.forEach((column) => {
|
|
8132
8132
|
const { field, editRender } = column;
|
|
8133
|
-
if (field && !
|
|
8133
|
+
if (field && !XEUtils.has(record, field) && !record[field]) {
|
|
8134
8134
|
let cellValue = null;
|
|
8135
8135
|
if (editRender) {
|
|
8136
8136
|
const { defaultValue } = editRender;
|
|
8137
|
-
if (
|
|
8137
|
+
if (XEUtils.isFunction(defaultValue)) {
|
|
8138
8138
|
cellValue = defaultValue({ column });
|
|
8139
|
-
} else if (!
|
|
8139
|
+
} else if (!XEUtils.isUndefined(defaultValue)) {
|
|
8140
8140
|
cellValue = defaultValue;
|
|
8141
8141
|
}
|
|
8142
8142
|
}
|
|
8143
|
-
|
|
8143
|
+
XEUtils.set(record, field, cellValue);
|
|
8144
8144
|
}
|
|
8145
8145
|
});
|
|
8146
8146
|
const otherFields = [radioOpts.labelField, checkboxOpts.checkField, checkboxOpts.labelField, expandOpts.labelField];
|
|
8147
8147
|
otherFields.forEach((key) => {
|
|
8148
|
-
if (key && utils.eqEmptyValue(
|
|
8149
|
-
|
|
8148
|
+
if (key && utils.eqEmptyValue(XEUtils.get(record, key))) {
|
|
8149
|
+
XEUtils.set(record, key, null);
|
|
8150
8150
|
}
|
|
8151
8151
|
});
|
|
8152
|
-
if (treeConfig && treeOpts.lazy &&
|
|
8152
|
+
if (treeConfig && treeOpts.lazy && XEUtils.isUndefined(record[childrenField])) {
|
|
8153
8153
|
record[childrenField] = null;
|
|
8154
8154
|
}
|
|
8155
|
-
if (utils.eqEmptyValue(
|
|
8156
|
-
|
|
8155
|
+
if (utils.eqEmptyValue(XEUtils.get(record, rowkey))) {
|
|
8156
|
+
XEUtils.set(record, rowkey, util.getRowUniqueId());
|
|
8157
8157
|
}
|
|
8158
8158
|
return record;
|
|
8159
8159
|
});
|
|
@@ -8195,13 +8195,13 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8195
8195
|
const fullDataRowIdMaps = {};
|
|
8196
8196
|
const idMaps = {};
|
|
8197
8197
|
const { handleUpdateRowId } = util.createHandleUpdateRowId($xeTable);
|
|
8198
|
-
const handleRowCache = (row,
|
|
8198
|
+
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
8199
8199
|
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
8200
8200
|
if (idMaps[rowid]) {
|
|
8201
8201
|
log.errLog("vxe.error.repeatKey", [currKeyField, rowid]);
|
|
8202
8202
|
}
|
|
8203
8203
|
if (!rowRest) {
|
|
8204
|
-
rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex:
|
|
8204
|
+
rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, _tIndex: -1, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
8205
8205
|
fullDataRowIdMaps[rowid] = rowRest;
|
|
8206
8206
|
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
8207
8207
|
}
|
|
@@ -8212,7 +8212,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8212
8212
|
rowRest.parent = parentRow;
|
|
8213
8213
|
rowRest.level = level;
|
|
8214
8214
|
rowRest.index = currIndex;
|
|
8215
|
-
rowRest.treeIndex =
|
|
8215
|
+
rowRest.treeIndex = index;
|
|
8216
8216
|
if (selectCheckboxMaps[rowid]) {
|
|
8217
8217
|
selectCheckboxMaps[rowid] = row;
|
|
8218
8218
|
}
|
|
@@ -8228,7 +8228,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8228
8228
|
const { lazy } = treeOpts;
|
|
8229
8229
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8230
8230
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
8231
|
-
|
|
8231
|
+
XEUtils.eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
8232
8232
|
const rowid = handleUpdateRowId(row);
|
|
8233
8233
|
if (treeConfig && lazy) {
|
|
8234
8234
|
if (row[hasChildField] && row[childrenField] === void 0) {
|
|
@@ -8240,18 +8240,18 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8240
8240
|
}
|
|
8241
8241
|
}
|
|
8242
8242
|
}
|
|
8243
|
-
handleRowCache(row,
|
|
8243
|
+
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, util.toTreePathSeq(path));
|
|
8244
8244
|
}, { children: childrenField });
|
|
8245
8245
|
} else if (isRowGroupStatus) {
|
|
8246
8246
|
const aggregateOpts = computeAggregateOpts.value;
|
|
8247
8247
|
const { mapChildrenField } = aggregateOpts;
|
|
8248
|
-
|
|
8248
|
+
XEUtils.eachTree(tableFullGroupData, (row, index, items, path, parentRow, nodes) => {
|
|
8249
8249
|
const rowid = handleUpdateRowId(row);
|
|
8250
|
-
handleRowCache(row,
|
|
8250
|
+
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, util.toTreePathSeq(path));
|
|
8251
8251
|
}, { children: mapChildrenField });
|
|
8252
8252
|
} else {
|
|
8253
|
-
tableFullData.forEach((row,
|
|
8254
|
-
handleRowCache(row,
|
|
8253
|
+
tableFullData.forEach((row, index, items) => {
|
|
8254
|
+
handleRowCache(row, index, items, index, null, handleUpdateRowId(row), 0, index + 1);
|
|
8255
8255
|
});
|
|
8256
8256
|
}
|
|
8257
8257
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
@@ -8261,7 +8261,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8261
8261
|
cacheSourceMap(fullData) {
|
|
8262
8262
|
const { treeConfig } = props$1;
|
|
8263
8263
|
const treeOpts = computeTreeOpts.value;
|
|
8264
|
-
const sourceData =
|
|
8264
|
+
const sourceData = XEUtils.clone(fullData, true);
|
|
8265
8265
|
const { handleUpdateRowId } = util.createHandleUpdateRowId($xeTable);
|
|
8266
8266
|
const sourceRowIdData = {};
|
|
8267
8267
|
const handleSourceRow = (row) => {
|
|
@@ -8270,7 +8270,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8270
8270
|
};
|
|
8271
8271
|
if (treeConfig) {
|
|
8272
8272
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8273
|
-
|
|
8273
|
+
XEUtils.eachTree(sourceData, handleSourceRow, { children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField });
|
|
8274
8274
|
} else {
|
|
8275
8275
|
sourceData.forEach(handleSourceRow);
|
|
8276
8276
|
}
|
|
@@ -8361,14 +8361,14 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8361
8361
|
if (!cell2) {
|
|
8362
8362
|
return;
|
|
8363
8363
|
}
|
|
8364
|
-
const cellParams =
|
|
8364
|
+
const cellParams = XEUtils.assign(params, { cell: cell2, $table: $xeTable });
|
|
8365
8365
|
let dragLeft = 0;
|
|
8366
8366
|
const tableRect = tableEl.getBoundingClientRect();
|
|
8367
8367
|
const rightContainerRect = rightContainerElem ? rightContainerElem.getBoundingClientRect() : null;
|
|
8368
8368
|
const cellRect = cell2.getBoundingClientRect();
|
|
8369
8369
|
const dragBtnRect = dragBtnElem.getBoundingClientRect();
|
|
8370
8370
|
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
8371
|
-
const dragBtnOffsetWidth =
|
|
8371
|
+
const dragBtnOffsetWidth = XEUtils.floor(dragBtnWidth / 2);
|
|
8372
8372
|
const dragPosLeft = dragBtnRect.x - tableRect.x + dragBtnOffsetWidth;
|
|
8373
8373
|
const minInterval = util.getColReMinWidth(cellParams) - dragBtnOffsetWidth;
|
|
8374
8374
|
const dragMinLeft = isRightFixed ? 0 : cellRect.x - tableRect.x + dragBtnWidth + minInterval;
|
|
@@ -8475,7 +8475,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8475
8475
|
const { column } = params;
|
|
8476
8476
|
let resizeColumn = column;
|
|
8477
8477
|
if (column.children && column.children.length) {
|
|
8478
|
-
|
|
8478
|
+
XEUtils.eachTree(column.children, (childColumn) => {
|
|
8479
8479
|
resizeColumn = childColumn;
|
|
8480
8480
|
});
|
|
8481
8481
|
}
|
|
@@ -8555,7 +8555,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8555
8555
|
let cellMinHeight = 0;
|
|
8556
8556
|
if (cellEl) {
|
|
8557
8557
|
const cellStyle = getComputedStyle(cellEl);
|
|
8558
|
-
cellMinHeight = Math.max(1, Math.ceil(
|
|
8558
|
+
cellMinHeight = Math.max(1, Math.ceil(XEUtils.toNumber(cellStyle.paddingTop) + XEUtils.toNumber(cellStyle.paddingBottom)));
|
|
8559
8559
|
}
|
|
8560
8560
|
const minTop = trRect.y - tableRect.y + cellMinHeight;
|
|
8561
8561
|
const updateEvent = (evnt2) => {
|
|
@@ -8786,7 +8786,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8786
8786
|
if (isRowGroupStatus) {
|
|
8787
8787
|
const mapChildrenField = aggregateOpts.mapChildrenField;
|
|
8788
8788
|
if (mapChildrenField) {
|
|
8789
|
-
|
|
8789
|
+
XEUtils.eachTree(afterGroupFullData, (row) => {
|
|
8790
8790
|
const rowid = handleGetRowId(row);
|
|
8791
8791
|
const childList = row[mapChildrenField];
|
|
8792
8792
|
if (childList && childList.length && !childRowMaps[rowid]) {
|
|
@@ -8797,7 +8797,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8797
8797
|
}
|
|
8798
8798
|
} else if (treeConfig) {
|
|
8799
8799
|
const { transform, mapChildrenField } = treeOpts;
|
|
8800
|
-
|
|
8800
|
+
XEUtils.eachTree(afterTreeFullData, (row) => {
|
|
8801
8801
|
const rowid = handleGetRowId(row);
|
|
8802
8802
|
const childList = row[transform ? mapChildrenField : childrenField];
|
|
8803
8803
|
if (childList && childList.length && !childRowMaps[rowid]) {
|
|
@@ -8805,7 +8805,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8805
8805
|
childRowList.unshift([row, rowid, childList]);
|
|
8806
8806
|
} else {
|
|
8807
8807
|
if (indeterminateField) {
|
|
8808
|
-
|
|
8808
|
+
XEUtils.set(row, indeterminateField, false);
|
|
8809
8809
|
}
|
|
8810
8810
|
}
|
|
8811
8811
|
}, { children: transform ? mapChildrenField : childrenField });
|
|
@@ -8820,7 +8820,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8820
8820
|
const cLen = childList.length;
|
|
8821
8821
|
childList.forEach(checkMethod ? (item) => {
|
|
8822
8822
|
const childRowid = handleGetRowId(item);
|
|
8823
|
-
const isSelect = checkField ?
|
|
8823
|
+
const isSelect = checkField ? XEUtils.get(item, checkField) : selectCheckboxMaps[childRowid];
|
|
8824
8824
|
if (checkMethod({ $table: $xeTable, row: item })) {
|
|
8825
8825
|
if (isSelect) {
|
|
8826
8826
|
sLen++;
|
|
@@ -8837,7 +8837,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8837
8837
|
}
|
|
8838
8838
|
} : (item) => {
|
|
8839
8839
|
const childRowid = handleGetRowId(item);
|
|
8840
|
-
const isSelect = checkField ?
|
|
8840
|
+
const isSelect = checkField ? XEUtils.get(item, checkField) : selectCheckboxMaps[childRowid];
|
|
8841
8841
|
if (isSelect) {
|
|
8842
8842
|
sLen++;
|
|
8843
8843
|
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
@@ -8863,10 +8863,10 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8863
8863
|
}
|
|
8864
8864
|
const halfSelect = !isSelected && (sLen > 0 || hLen > 0);
|
|
8865
8865
|
if (checkField) {
|
|
8866
|
-
|
|
8866
|
+
XEUtils.set(row, checkField, isSelected);
|
|
8867
8867
|
}
|
|
8868
8868
|
if (indeterminateField) {
|
|
8869
|
-
|
|
8869
|
+
XEUtils.set(row, indeterminateField, halfSelect);
|
|
8870
8870
|
}
|
|
8871
8871
|
if (isSelected) {
|
|
8872
8872
|
if (!checkField) {
|
|
@@ -8910,7 +8910,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8910
8910
|
const rootList = treeConfig ? afterTreeFullData : isRowGroupStatus ? afterGroupFullData : afterFullData;
|
|
8911
8911
|
rootList.forEach(checkMethod ? (row) => {
|
|
8912
8912
|
const childRowid = handleGetRowId(row);
|
|
8913
|
-
const selected = checkField ?
|
|
8913
|
+
const selected = checkField ? XEUtils.get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
8914
8914
|
if (isRowGroupStatus && $xeTable.isAggregateRecord(row)) {
|
|
8915
8915
|
const childList = row[mapChildrenField || ""];
|
|
8916
8916
|
if (selected) {
|
|
@@ -8938,7 +8938,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8938
8938
|
}
|
|
8939
8939
|
} : (row) => {
|
|
8940
8940
|
const childRowid = handleGetRowId(row);
|
|
8941
|
-
const selected = checkField ?
|
|
8941
|
+
const selected = checkField ? XEUtils.get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
8942
8942
|
if (selected) {
|
|
8943
8943
|
sLen++;
|
|
8944
8944
|
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
@@ -8949,7 +8949,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8949
8949
|
const isSelected = rootList.length > 0 ? vLen > 0 ? sLen >= vLen : sLen >= rootList.length : false;
|
|
8950
8950
|
let halfSelect = !isSelected && (sLen > 0 || hLen > 0 || dsLen > 0 || dhLen > 0);
|
|
8951
8951
|
if (!isSelected && !halfSelect && showReserveStatus) {
|
|
8952
|
-
halfSelect = !
|
|
8952
|
+
halfSelect = !XEUtils.isEmpty(checkboxReserveRowMap);
|
|
8953
8953
|
}
|
|
8954
8954
|
reactData.isAllSelected = isSelected;
|
|
8955
8955
|
reactData.isIndeterminate = halfSelect;
|
|
@@ -8976,11 +8976,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8976
8976
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
8977
8977
|
if (checkField) {
|
|
8978
8978
|
if ((treeConfig || isRowGroupStatus) && !checkStrictly) {
|
|
8979
|
-
|
|
8979
|
+
XEUtils.eachTree(rows, (row) => {
|
|
8980
8980
|
if (isForce || (!checkMethod || checkMethod({ $table: $xeTable, row }))) {
|
|
8981
|
-
|
|
8981
|
+
XEUtils.set(row, checkField, checked);
|
|
8982
8982
|
if (indeterminateField) {
|
|
8983
|
-
|
|
8983
|
+
XEUtils.set(row, indeterminateField, false);
|
|
8984
8984
|
}
|
|
8985
8985
|
handleCheckboxReserveRow(row, checked);
|
|
8986
8986
|
}
|
|
@@ -8990,7 +8990,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8990
8990
|
}
|
|
8991
8991
|
rows.forEach((row) => {
|
|
8992
8992
|
if (isForce || (!checkMethod || checkMethod({ $table: $xeTable, row }))) {
|
|
8993
|
-
|
|
8993
|
+
XEUtils.set(row, checkField, checked);
|
|
8994
8994
|
handleCheckboxReserveRow(row, checked);
|
|
8995
8995
|
}
|
|
8996
8996
|
});
|
|
@@ -8999,7 +8999,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
8999
8999
|
}
|
|
9000
9000
|
if (!checkStrictly) {
|
|
9001
9001
|
if (isRowGroupStatus) {
|
|
9002
|
-
|
|
9002
|
+
XEUtils.eachTree(rows, (row) => {
|
|
9003
9003
|
const rowid = handleGetRowId(row);
|
|
9004
9004
|
if (isForce || (!checkMethod || checkMethod({ $table: $xeTable, row }))) {
|
|
9005
9005
|
if (checked) {
|
|
@@ -9015,7 +9015,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
9015
9015
|
reactData.updateCheckboxFlag++;
|
|
9016
9016
|
return;
|
|
9017
9017
|
} else if (treeConfig) {
|
|
9018
|
-
|
|
9018
|
+
XEUtils.eachTree(rows, (row) => {
|
|
9019
9019
|
const rowid = handleGetRowId(row);
|
|
9020
9020
|
if (isForce || (!checkMethod || checkMethod({ $table: $xeTable, row }))) {
|
|
9021
9021
|
if (checked) {
|
|
@@ -9355,7 +9355,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
9355
9355
|
}
|
|
9356
9356
|
let checked = false;
|
|
9357
9357
|
if (checkField) {
|
|
9358
|
-
checked = !
|
|
9358
|
+
checked = !XEUtils.get(row, checkField);
|
|
9359
9359
|
} else {
|
|
9360
9360
|
checked = !selectCheckboxMaps[util.getRowid($xeTable, row)];
|
|
9361
9361
|
}
|
|
@@ -9609,7 +9609,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
9609
9609
|
if ($xeTable.hasCellRules(type, row, column)) {
|
|
9610
9610
|
const cell2 = $xeTable.getCellElement(row, column);
|
|
9611
9611
|
if (cell2) {
|
|
9612
|
-
const customVal = !
|
|
9612
|
+
const customVal = !XEUtils.isUndefined(cellValue);
|
|
9613
9613
|
return $xeTable.validCellRules(type, row, column, cellValue).then(() => {
|
|
9614
9614
|
if (customVal && validStore.visible) {
|
|
9615
9615
|
util.setCellValue(row, column, cellValue);
|
|
@@ -9761,7 +9761,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
9761
9761
|
if (oldRest && newRest) {
|
|
9762
9762
|
const { level: oldLevel } = oldRest;
|
|
9763
9763
|
const { level: newLevel } = newRest;
|
|
9764
|
-
|
|
9764
|
+
XEUtils.eachTree([dragRow], (item) => {
|
|
9765
9765
|
oldAllMaps[util.getRowid($xeTable, item)] = item;
|
|
9766
9766
|
}, { children: mapChildrenField });
|
|
9767
9767
|
if (oldLevel && newLevel) {
|
|
@@ -9824,7 +9824,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
9824
9824
|
if (treeConfig) {
|
|
9825
9825
|
if (transform) {
|
|
9826
9826
|
if (oldRest && newRest) {
|
|
9827
|
-
const fullList =
|
|
9827
|
+
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
9828
9828
|
key: rowField,
|
|
9829
9829
|
parentKey: parentField,
|
|
9830
9830
|
children: mapChildrenField
|
|
@@ -9835,12 +9835,12 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
9835
9835
|
const ntfIndex = ptfIndex + dragOffsetIndex;
|
|
9836
9836
|
fullList.splice(ntfIndex, 0, dragRow);
|
|
9837
9837
|
if (isSelfToChildStatus && (isCrossDrag && isSelfToChildDrag)) {
|
|
9838
|
-
|
|
9838
|
+
XEUtils.each(dragRow[childrenField], (childRow) => {
|
|
9839
9839
|
childRow[parentField] = dragRow[parentField];
|
|
9840
9840
|
});
|
|
9841
9841
|
}
|
|
9842
9842
|
dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
|
|
9843
|
-
internalData.tableFullTreeData =
|
|
9843
|
+
internalData.tableFullTreeData = XEUtils.toArrayTree(fullList, {
|
|
9844
9844
|
key: rowField,
|
|
9845
9845
|
parentKey: parentField,
|
|
9846
9846
|
children: childrenField,
|
|
@@ -9998,7 +9998,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
9998
9998
|
rsIndex = dragRowRest.$index;
|
|
9999
9999
|
}
|
|
10000
10000
|
const dragRangeList = rsIndex > -1 && rsIndex < tableData.length - 1 ? tableData.slice(rsIndex + 1) : [];
|
|
10001
|
-
const dragList =
|
|
10001
|
+
const dragList = XEUtils.toTreeArray([dragRow], {
|
|
10002
10002
|
updated: true,
|
|
10003
10003
|
children: mapChildrenField
|
|
10004
10004
|
});
|
|
@@ -10105,7 +10105,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10105
10105
|
}
|
|
10106
10106
|
let insertRest = Promise.resolve();
|
|
10107
10107
|
if (treeConfig) {
|
|
10108
|
-
const dragList =
|
|
10108
|
+
const dragList = XEUtils.toTreeArray([dragRow], {
|
|
10109
10109
|
updated: true,
|
|
10110
10110
|
children: mapChildrenField
|
|
10111
10111
|
});
|
|
@@ -10362,7 +10362,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10362
10362
|
const dragAllTargetCols = [];
|
|
10363
10363
|
let dragColWidth = 0;
|
|
10364
10364
|
if (animation) {
|
|
10365
|
-
|
|
10365
|
+
XEUtils.eachTree([dragColumn], (column) => {
|
|
10366
10366
|
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
10367
10367
|
dragTargetColumn = column;
|
|
10368
10368
|
dragColWidth += column.renderWidth;
|
|
@@ -10385,7 +10385,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10385
10385
|
let oafIndex = -1;
|
|
10386
10386
|
let nafIndex = -1;
|
|
10387
10387
|
const oldAllMaps = {};
|
|
10388
|
-
|
|
10388
|
+
XEUtils.eachTree([dragColumn], (column) => {
|
|
10389
10389
|
oldAllMaps[column.id] = column;
|
|
10390
10390
|
});
|
|
10391
10391
|
let isSelfToChildStatus = false;
|
|
@@ -10443,7 +10443,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10443
10443
|
if (!status) {
|
|
10444
10444
|
return errRest;
|
|
10445
10445
|
}
|
|
10446
|
-
const oldewMatchRest =
|
|
10446
|
+
const oldewMatchRest = XEUtils.findTree(collectColumn, (item) => item.id === dragColumn.id);
|
|
10447
10447
|
if (isSelfToChildStatus && (isCrossDrag && isSelfToChildDrag)) {
|
|
10448
10448
|
if (oldewMatchRest) {
|
|
10449
10449
|
const { items: oCols, index: oIndex } = oldewMatchRest;
|
|
@@ -10463,7 +10463,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10463
10463
|
}
|
|
10464
10464
|
}
|
|
10465
10465
|
}
|
|
10466
|
-
const newMatchRest =
|
|
10466
|
+
const newMatchRest = XEUtils.findTree(collectColumn, (item) => item.id === newColumn.id);
|
|
10467
10467
|
if (newMatchRest) {
|
|
10468
10468
|
const { items: nCols, index: nIndex, parent: nParent } = newMatchRest;
|
|
10469
10469
|
if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
|
|
@@ -10477,9 +10477,9 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10477
10477
|
nafIndex = nIndex;
|
|
10478
10478
|
}
|
|
10479
10479
|
}
|
|
10480
|
-
|
|
10480
|
+
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
10481
10481
|
if (!parentColumn) {
|
|
10482
|
-
const sortIndex =
|
|
10482
|
+
const sortIndex = index + 1;
|
|
10483
10483
|
column.renderSortNumber = sortIndex;
|
|
10484
10484
|
}
|
|
10485
10485
|
});
|
|
@@ -10516,7 +10516,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10516
10516
|
const { visibleColumn, fullColumnIdData: fullColumnIdData2 } = internalData;
|
|
10517
10517
|
let dragNewColumn = null;
|
|
10518
10518
|
const dragNewColMaps = {};
|
|
10519
|
-
|
|
10519
|
+
XEUtils.eachTree([dragColumn], (column) => {
|
|
10520
10520
|
if (!dragNewColumn && (!column.children || !column.children.length)) {
|
|
10521
10521
|
dragNewColumn = column;
|
|
10522
10522
|
}
|
|
@@ -10526,7 +10526,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10526
10526
|
dragNewColumn = dragColumn;
|
|
10527
10527
|
}
|
|
10528
10528
|
if (dragColWidth && dragAllTargetCols.length) {
|
|
10529
|
-
const _newColIndex =
|
|
10529
|
+
const _newColIndex = XEUtils.findIndexOf(visibleColumn, (column) => !!dragNewColumn && column.id === dragNewColumn.id);
|
|
10530
10530
|
const firstCol = tableColumn[0];
|
|
10531
10531
|
const firstColRest = fullColumnIdData2[firstCol.id];
|
|
10532
10532
|
if (firstColRest) {
|
|
@@ -10562,7 +10562,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
10562
10562
|
dragRangeList.push(column);
|
|
10563
10563
|
}
|
|
10564
10564
|
}
|
|
10565
|
-
|
|
10565
|
+
XEUtils.eachTree([newColumn], (column) => {
|
|
10566
10566
|
if (!dragRangeMaps[column.id]) {
|
|
10567
10567
|
dragRangeMaps[column.id] = column;
|
|
10568
10568
|
dragRangeList.push(column);
|
|
@@ -11199,11 +11199,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
11199
11199
|
const aggregateOpts = computeAggregateOpts.value;
|
|
11200
11200
|
const treeOpts = computeTreeOpts.value;
|
|
11201
11201
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
11202
|
-
const matchObj =
|
|
11202
|
+
const matchObj = XEUtils.findTree(tableFullData, (item) => $xeTable.eqRow(item, row), { children: isRowGroupStatus ? aggregateOpts.mapChildrenField : childrenField });
|
|
11203
11203
|
if (matchObj) {
|
|
11204
11204
|
const nodes = matchObj.nodes;
|
|
11205
|
-
nodes.forEach((row2,
|
|
11206
|
-
if (
|
|
11205
|
+
nodes.forEach((row2, index) => {
|
|
11206
|
+
if (index < nodes.length - 1 && !$xeTable.isTreeExpandByRow(row2)) {
|
|
11207
11207
|
rests.push($xeTable.setTreeExpand(row2, true));
|
|
11208
11208
|
}
|
|
11209
11209
|
});
|
|
@@ -11495,7 +11495,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
11495
11495
|
const el = refElem.value;
|
|
11496
11496
|
tablePrivateMethods.clearHoverRow();
|
|
11497
11497
|
if (el) {
|
|
11498
|
-
|
|
11498
|
+
XEUtils.arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`), (elem) => dom.addClass(elem, "row--hover"));
|
|
11499
11499
|
}
|
|
11500
11500
|
internalData.hoverRow = row;
|
|
11501
11501
|
if ($xeGanttView && $xeGanttView.handleUpdateHoverRow) {
|
|
@@ -11506,7 +11506,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
11506
11506
|
const $xeGanttView = internalData.xeGanttView;
|
|
11507
11507
|
const el = refElem.value;
|
|
11508
11508
|
if (el) {
|
|
11509
|
-
|
|
11509
|
+
XEUtils.arrayEach(el.querySelectorAll(".vxe-body--row.row--hover"), (elem) => dom.removeClass(elem, "row--hover"));
|
|
11510
11510
|
}
|
|
11511
11511
|
internalData.hoverRow = null;
|
|
11512
11512
|
if ($xeGanttView && $xeGanttView.handleUpdateHoverRow) {
|
|
@@ -11521,7 +11521,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
11521
11521
|
return tableMethods.getCellElement(row, column);
|
|
11522
11522
|
},
|
|
11523
11523
|
findRowIndexOf(list, row) {
|
|
11524
|
-
return row ?
|
|
11524
|
+
return row ? XEUtils.findIndexOf(list, (item) => $xeTable.eqRow(item, row)) : -1;
|
|
11525
11525
|
},
|
|
11526
11526
|
eqRow(row1, row2) {
|
|
11527
11527
|
if (row1 && row2) {
|
|
@@ -11551,8 +11551,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
11551
11551
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts;
|
|
11552
11552
|
const isFixedLeft = fixedType === "left";
|
|
11553
11553
|
const fixedColumn = isFixedLeft ? columnStore.leftList : columnStore.rightList;
|
|
11554
|
-
const osXBehavior =
|
|
11555
|
-
const osYBehavior =
|
|
11554
|
+
const osXBehavior = XEUtils.eqNull(overscrollXBehavior) ? scrollbarOpts.overscrollBehavior : overscrollXBehavior;
|
|
11555
|
+
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
|
|
11556
11556
|
return vue.h("div", {
|
|
11557
11557
|
ref: isFixedLeft ? refLeftContainer : refRightContainer,
|
|
11558
11558
|
class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
|
|
@@ -11718,7 +11718,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
11718
11718
|
cellStyle.height = `${expandHeight}px`;
|
|
11719
11719
|
}
|
|
11720
11720
|
if (isRowGroupStatus || treeConfig) {
|
|
11721
|
-
cellStyle.paddingLeft = `${rowLevel * (
|
|
11721
|
+
cellStyle.paddingLeft = `${rowLevel * (XEUtils.isNumber(indent) ? indent : treeOpts.indent) + 30}px`;
|
|
11722
11722
|
}
|
|
11723
11723
|
let columnIndex = -1;
|
|
11724
11724
|
let $columnIndex = -1;
|
|
@@ -11844,8 +11844,8 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
11844
11844
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts;
|
|
11845
11845
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts;
|
|
11846
11846
|
const { leftList, rightList } = columnStore;
|
|
11847
|
-
const osXBehavior =
|
|
11848
|
-
const osYBehavior =
|
|
11847
|
+
const osXBehavior = XEUtils.eqNull(overscrollXBehavior) ? scrollbarOpts.overscrollBehavior : overscrollXBehavior;
|
|
11848
|
+
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
|
|
11849
11849
|
return vue.h("div", {
|
|
11850
11850
|
ref: refTableViewportElem,
|
|
11851
11851
|
class: ["vxe-table--viewport-wrapper", {
|
|
@@ -12249,7 +12249,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
12249
12249
|
staticColumnFlag.value++;
|
|
12250
12250
|
});
|
|
12251
12251
|
vue.watch(staticColumnFlag, () => {
|
|
12252
|
-
vue.nextTick(() => handleInitColumn(
|
|
12252
|
+
vue.nextTick(() => handleInitColumn(XEUtils.clone(reactData.staticColumns)));
|
|
12253
12253
|
});
|
|
12254
12254
|
const tableColumnFlag = vue.ref(0);
|
|
12255
12255
|
vue.watch(() => reactData.tableColumn.length, () => {
|
|
@@ -12397,7 +12397,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
12397
12397
|
const { setupTable } = options;
|
|
12398
12398
|
if (setupTable) {
|
|
12399
12399
|
const hookRest = setupTable($xeTable);
|
|
12400
|
-
if (hookRest &&
|
|
12400
|
+
if (hookRest && XEUtils.isObject(hookRest)) {
|
|
12401
12401
|
Object.assign($xeTable, hookRest);
|
|
12402
12402
|
}
|
|
12403
12403
|
}
|
|
@@ -12496,11 +12496,11 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
12496
12496
|
if (props$1.aggregateConfig && props$1.rowGroupConfig) {
|
|
12497
12497
|
log.warnLog("vxe.error.notSupportProp", ["aggregate-config", "row-group-config", "row-group-config=null"]);
|
|
12498
12498
|
}
|
|
12499
|
-
if (importConfig && importOpts.types && !importOpts.importMethod && !
|
|
12500
|
-
log.warnLog("vxe.error.errProp", [`export-config.types=${importOpts.types.join(",")}`, importOpts.types.filter((type) =>
|
|
12499
|
+
if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
|
|
12500
|
+
log.warnLog("vxe.error.errProp", [`export-config.types=${importOpts.types.join(",")}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(",") || XEUtils.keys(importOpts._typeMaps).join(",")]);
|
|
12501
12501
|
}
|
|
12502
|
-
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !
|
|
12503
|
-
log.warnLog("vxe.error.errProp", [`export-config.types=${exportOpts.types.join(",")}`, exportOpts.types.filter((type) =>
|
|
12502
|
+
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
12503
|
+
log.warnLog("vxe.error.errProp", [`export-config.types=${exportOpts.types.join(",")}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(",") || XEUtils.keys(exportOpts._typeMaps).join(",")]);
|
|
12504
12504
|
}
|
|
12505
12505
|
if (!props$1.id) {
|
|
12506
12506
|
if ((props$1.customConfig ? utils.isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
@@ -12587,7 +12587,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
12587
12587
|
log.warnLog("vxe.error.reqSupportProp", ["edit-config & edit-rules", "min-height"]);
|
|
12588
12588
|
}
|
|
12589
12589
|
if (treeConfig) {
|
|
12590
|
-
|
|
12590
|
+
XEUtils.arrayEach(["rowField", "parentField", "childrenField", "hasChildField", "mapChildrenField"], (key) => {
|
|
12591
12591
|
const val = treeOpts[key];
|
|
12592
12592
|
if (val && val.indexOf(".") > -1) {
|
|
12593
12593
|
log.errLog("vxe.error.errProp", [`${key}=${val}`, `${key}=${val.split(".")[0]}`]);
|
|
@@ -12675,7 +12675,7 @@ const VxeTableComponent = comp.defineVxeComponent({
|
|
|
12675
12675
|
});
|
|
12676
12676
|
vue.onUnmounted(() => {
|
|
12677
12677
|
tablePrivateMethods.preventEvent(null, "unmounted", { $table: $xeTable });
|
|
12678
|
-
|
|
12678
|
+
XEUtils.assign(internalData, util.createInternalData());
|
|
12679
12679
|
});
|
|
12680
12680
|
vue.nextTick(() => {
|
|
12681
12681
|
if (props$1.loading) {
|