vxe-table 3.18.0-beta.0 → 3.18.0-beta.1

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.
Files changed (77) hide show
  1. package/es/grid/src/grid.js +3 -1
  2. package/es/style.css +1 -1
  3. package/es/table/module/custom/mixin.js +4 -2
  4. package/es/table/module/custom/panel.js +4 -0
  5. package/es/table/module/export/export-panel.js +3 -0
  6. package/es/table/module/export/import-panel.js +3 -0
  7. package/es/table/module/export/mixin.js +41 -22
  8. package/es/table/module/menu/mixin.js +5 -3
  9. package/es/table/src/body.js +6 -1
  10. package/es/table/src/column.js +2 -1
  11. package/es/table/src/columnInfo.js +6 -2
  12. package/es/table/src/footer.js +2 -0
  13. package/es/table/src/group.js +2 -1
  14. package/es/table/src/header.js +2 -0
  15. package/es/table/src/methods.js +35 -16
  16. package/es/table/src/table.js +10 -5
  17. package/es/ui/index.js +1 -1
  18. package/es/ui/src/log.js +1 -1
  19. package/lib/grid/src/grid.js +3 -1
  20. package/lib/grid/src/grid.min.js +1 -1
  21. package/lib/index.umd.js +154 -54
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/table/module/custom/mixin.js +4 -2
  25. package/lib/table/module/custom/mixin.min.js +1 -1
  26. package/lib/table/module/custom/panel.js +4 -0
  27. package/lib/table/module/custom/panel.min.js +1 -1
  28. package/lib/table/module/export/export-panel.js +3 -0
  29. package/lib/table/module/export/export-panel.min.js +1 -1
  30. package/lib/table/module/export/import-panel.js +3 -0
  31. package/lib/table/module/export/import-panel.min.js +1 -1
  32. package/lib/table/module/export/mixin.js +49 -18
  33. package/lib/table/module/export/mixin.min.js +1 -1
  34. package/lib/table/module/menu/mixin.js +8 -3
  35. package/lib/table/module/menu/mixin.min.js +1 -1
  36. package/lib/table/src/body.js +7 -1
  37. package/lib/table/src/body.min.js +1 -1
  38. package/lib/table/src/column.js +2 -1
  39. package/lib/table/src/column.min.js +1 -1
  40. package/lib/table/src/columnInfo.js +11 -5
  41. package/lib/table/src/columnInfo.min.js +1 -1
  42. package/lib/table/src/footer.js +2 -0
  43. package/lib/table/src/footer.min.js +1 -1
  44. package/lib/table/src/group.js +2 -1
  45. package/lib/table/src/group.min.js +1 -1
  46. package/lib/table/src/header.js +2 -0
  47. package/lib/table/src/header.min.js +1 -1
  48. package/lib/table/src/methods.js +40 -17
  49. package/lib/table/src/methods.min.js +1 -1
  50. package/lib/table/src/table.js +12 -3
  51. package/lib/table/src/table.min.js +1 -1
  52. package/lib/ui/index.js +1 -1
  53. package/lib/ui/index.min.js +1 -1
  54. package/lib/ui/src/log.js +1 -1
  55. package/lib/ui/src/log.min.js +1 -1
  56. package/package.json +1 -1
  57. package/packages/grid/src/grid.ts +3 -1
  58. package/packages/table/module/custom/mixin.ts +7 -5
  59. package/packages/table/module/custom/panel.ts +4 -0
  60. package/packages/table/module/export/export-panel.ts +3 -0
  61. package/packages/table/module/export/import-panel.ts +3 -0
  62. package/packages/table/module/export/mixin.ts +43 -22
  63. package/packages/table/module/menu/mixin.ts +8 -6
  64. package/packages/table/src/body.ts +6 -1
  65. package/packages/table/src/column.ts +2 -1
  66. package/packages/table/src/columnInfo.ts +8 -4
  67. package/packages/table/src/footer.ts +2 -0
  68. package/packages/table/src/group.ts +2 -1
  69. package/packages/table/src/header.ts +5 -1
  70. package/packages/table/src/methods.ts +46 -27
  71. package/packages/table/src/table.ts +10 -5
  72. /package/es/{iconfont.1755178463571.ttf → iconfont.1755232583063.ttf} +0 -0
  73. /package/es/{iconfont.1755178463571.woff → iconfont.1755232583063.woff} +0 -0
  74. /package/es/{iconfont.1755178463571.woff2 → iconfont.1755232583063.woff2} +0 -0
  75. /package/lib/{iconfont.1755178463571.ttf → iconfont.1755232583063.ttf} +0 -0
  76. /package/lib/{iconfont.1755178463571.woff → iconfont.1755232583063.woff} +0 -0
  77. /package/lib/{iconfont.1755178463571.woff2 → iconfont.1755232583063.woff2} +0 -0
@@ -13,7 +13,8 @@ function calcMaxHeight($xeTable) {
13
13
  }
14
14
  function emitCustomEvent($xeTable, type, evnt) {
15
15
  const $xeGrid = $xeTable.$xeGrid;
16
- const comp = $xeGrid || $xeTable;
16
+ const $xeGantt = $xeTable.$xeGantt;
17
+ const comp = $xeGrid || $xeGantt || $xeTable;
17
18
  comp.dispatchEvent('custom', { type }, evnt);
18
19
  }
19
20
  export default {
@@ -262,7 +263,8 @@ export default {
262
263
  emitCustomEvent(type, evnt) {
263
264
  const $xeTable = this;
264
265
  const $xeGrid = $xeTable.$xeGrid;
265
- const comp = $xeGrid || $xeTable;
266
+ const $xeGantt = $xeTable.$xeGantt;
267
+ const comp = $xeGrid || $xeGantt || $xeTable;
266
268
  comp.dispatchEvent('custom', { type }, evnt);
267
269
  },
268
270
  triggerCustomEvent(evnt) {
@@ -110,6 +110,7 @@ const renderSimplePanel = (h, _vm) => {
110
110
  const tableProps = $xeTable;
111
111
  const tableReactData = $xeTable;
112
112
  const $xeGrid = $xeTable.$xeGrid;
113
+ const $xeGantt = $xeTable.$xeGantt;
113
114
  const { customStore } = props;
114
115
  const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
115
116
  const { isCustomStatus, customColumnList } = tableReactData;
@@ -138,6 +139,7 @@ const renderSimplePanel = (h, _vm) => {
138
139
  const params = {
139
140
  $table: $xeTable,
140
141
  $grid: $xeGrid,
142
+ $gantt: $xeGantt,
141
143
  columns: customColumnList,
142
144
  isAllChecked,
143
145
  isAllIndeterminate,
@@ -430,6 +432,7 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
430
432
  const tableProps = $xeTable;
431
433
  const tableReactData = $xeTable;
432
434
  const $xeGrid = $xeTable.$xeGrid;
435
+ const $xeGantt = $xeTable.$xeGantt;
433
436
  const { customStore } = props;
434
437
  const { treeConfig, rowGroupConfig, aggregateConfig, resizable: allResizable } = tableProps;
435
438
  const { isCustomStatus, customColumnList } = tableReactData;
@@ -457,6 +460,7 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
457
460
  const params = {
458
461
  $table: $xeTable,
459
462
  $grid: $xeGrid,
463
+ $gantt: $xeGantt,
460
464
  columns: customColumnList,
461
465
  isAllChecked,
462
466
  isAllIndeterminate,
@@ -79,6 +79,7 @@ export default {
79
79
  render(h) {
80
80
  const $xeTable = this.$xeTable;
81
81
  const $xeGrid = $xeTable.$xeGrid;
82
+ const $xeGantt = $xeTable.$xeGantt;
82
83
  const { _e, checkedAll, isAll: isAllChecked, isIndeterminate: isAllIndeterminate, showSheet, supportMerge, supportStyle, defaultOptions, storeData } = this;
83
84
  const { hasTree, hasMerge, isPrint, hasColgroup, columns } = storeData;
84
85
  const { isHeader } = defaultOptions;
@@ -160,6 +161,7 @@ export default {
160
161
  const params = {
161
162
  $table: $xeTable,
162
163
  $grid: $xeGrid,
164
+ $gantt: $xeGantt,
163
165
  options: defaultOptions,
164
166
  columns,
165
167
  params: defaultOptions.params
@@ -443,6 +445,7 @@ export default {
443
445
  const params = {
444
446
  $table: $xeTable,
445
447
  $grid: $xeGrid,
448
+ $gantt: $xeGantt,
446
449
  options: defaultOptions,
447
450
  columns,
448
451
  params: defaultOptions.params
@@ -63,6 +63,7 @@ export default {
63
63
  render(h) {
64
64
  const $xeTable = this.$parent;
65
65
  const $xeGrid = $xeTable.$xeGrid;
66
+ const $xeGantt = $xeTable.$xeGantt;
66
67
  const { hasFile, loading, parseTypeLabel, defaultOptions, storeData, selectName } = this;
67
68
  const slots = defaultOptions.slots || {};
68
69
  const topSlot = slots.top;
@@ -98,6 +99,7 @@ export default {
98
99
  const params = {
99
100
  $table: $xeTable,
100
101
  $grid: $xeGrid,
102
+ $gantt: $xeGantt,
101
103
  options: defaultOptions,
102
104
  params: defaultOptions.params
103
105
  };
@@ -187,6 +189,7 @@ export default {
187
189
  const params = {
188
190
  $table: $xeTable,
189
191
  $grid: $xeGrid,
192
+ $gantt: $xeGantt,
190
193
  options: defaultOptions,
191
194
  params: defaultOptions.params
192
195
  };
@@ -204,10 +204,12 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
204
204
  });
205
205
  }
206
206
  function getExportData($xeTable, opts) {
207
+ const $xeGrid = $xeTable.$xeGrid;
208
+ const $xeGantt = $xeTable.$xeGantt;
207
209
  const { columns, dataFilterMethod } = opts;
208
210
  let datas = opts.data;
209
211
  if (dataFilterMethod) {
210
- datas = datas.filter((row, index) => dataFilterMethod({ $table: $xeTable, row, $rowIndex: index }));
212
+ datas = datas.filter((row, index) => dataFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, row, $rowIndex: index }));
211
213
  }
212
214
  return getBodyLabelData($xeTable, opts, columns, datas);
213
215
  }
@@ -243,8 +245,10 @@ function getFooterCellValue($xeTable, opts, row, column) {
243
245
  return XEUtils.get(row, column.field);
244
246
  }
245
247
  function getFooterData($xeTable, opts, footerTableData) {
248
+ const $xeGrid = $xeTable.$xeGrid;
249
+ const $xeGantt = $xeTable.$xeGantt;
246
250
  const { footerFilterMethod } = opts;
247
- return footerFilterMethod ? footerTableData.filter((items, index) => footerFilterMethod({ $table: $xeTable, items, $rowIndex: index })) : footerTableData;
251
+ return footerFilterMethod ? footerTableData.filter((items, index) => footerFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, items, $rowIndex: index })) : footerTableData;
248
252
  }
249
253
  function getCsvCellTypeLabel(column, cellValue) {
250
254
  if (cellValue) {
@@ -566,10 +570,11 @@ function clearColumnConvert(columns) {
566
570
  }
567
571
  function handleExport($xeTable, opts) {
568
572
  const $xeGrid = $xeTable.$xeGrid;
573
+ const $xeGantt = $xeTable.$xeGantt;
569
574
  const { remote, columns, colgroups, exportMethod, afterExportMethod } = opts;
570
575
  return new Promise(resolve => {
571
576
  if (remote) {
572
- const params = { options: opts, $table: $xeTable, $grid: $xeGrid };
577
+ const params = { options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt };
573
578
  resolve(exportMethod ? exportMethod(params) : params);
574
579
  }
575
580
  else {
@@ -582,7 +587,7 @@ function handleExport($xeTable, opts) {
582
587
  clearColumnConvert(columns);
583
588
  if (!opts.print) {
584
589
  if (afterExportMethod) {
585
- afterExportMethod({ status: true, options: opts, $table: $xeTable, $grid: $xeGrid });
590
+ afterExportMethod({ status: true, options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
586
591
  }
587
592
  }
588
593
  return Object.assign({ status: true }, params);
@@ -590,7 +595,7 @@ function handleExport($xeTable, opts) {
590
595
  clearColumnConvert(columns);
591
596
  if (!opts.print) {
592
597
  if (afterExportMethod) {
593
- afterExportMethod({ status: false, options: opts, $table: $xeTable, $grid: $xeGrid });
598
+ afterExportMethod({ status: false, options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
594
599
  }
595
600
  }
596
601
  const params = { status: false };
@@ -930,6 +935,8 @@ function handleExportAndPrint($xeTable, options, isPrint) {
930
935
  const reactData = $xeTable;
931
936
  const internalData = $xeTable;
932
937
  const $xeGrid = $xeTable.$xeGrid;
938
+ const $xeGantt = $xeTable.$xeGantt;
939
+ const $xeGGWrapper = $xeGrid || $xeGantt;
933
940
  const { treeConfig, showHeader, showFooter } = props;
934
941
  const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData;
935
942
  const { collectColumn, mergeBodyList, mergeFooterList } = internalData;
@@ -937,7 +944,7 @@ function handleExportAndPrint($xeTable, options, isPrint) {
937
944
  const hasTree = treeConfig;
938
945
  const customOpts = $xeTable.computeCustomOpts;
939
946
  const selectRecords = $xeTable.getCheckboxRecords();
940
- const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : {};
947
+ const proxyOpts = $xeGGWrapper ? $xeGGWrapper.computeProxyOpts : {};
941
948
  const hasFooter = !!footerTableData.length;
942
949
  const hasMerge = !!(mergeBodyList.length || mergeFooterList.length);
943
950
  const defOpts = Object.assign({
@@ -1014,7 +1021,8 @@ function handleExportAndPrint($xeTable, options, isPrint) {
1014
1021
  exportParams.filename = filename({
1015
1022
  options: defOpts,
1016
1023
  $table: $xeTable,
1017
- $grid: $xeGrid
1024
+ $grid: $xeGrid,
1025
+ $gantt: $xeGantt
1018
1026
  });
1019
1027
  }
1020
1028
  else {
@@ -1026,7 +1034,8 @@ function handleExportAndPrint($xeTable, options, isPrint) {
1026
1034
  exportParams.sheetName = sheetName({
1027
1035
  options: defOpts,
1028
1036
  $table: $xeTable,
1029
- $grid: $xeGrid
1037
+ $grid: $xeGrid,
1038
+ $gantt: $xeGantt
1030
1039
  });
1031
1040
  }
1032
1041
  else {
@@ -1111,12 +1120,13 @@ export default {
1111
1120
  const internalData = $xeTable;
1112
1121
  const $xeGrid = $xeTable.$xeGrid;
1113
1122
  const $xeGantt = $xeTable.$xeGantt;
1123
+ const $xeGGWrapper = $xeGrid || $xeGantt;
1114
1124
  const { treeConfig, showHeader, showFooter } = props;
1115
1125
  const { isGroup } = reactData;
1116
1126
  const { tableFullColumn, afterFullData, afterTreeFullData, collectColumn, mergeBodyList, mergeFooterList } = internalData;
1117
1127
  const exportOpts = $xeTable.computeExportOpts;
1118
1128
  const treeOpts = $xeTable.computeTreeOpts;
1119
- const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : {};
1129
+ const proxyOpts = $xeGGWrapper ? $xeGGWrapper.computeProxyOpts : {};
1120
1130
  const hasMerge = !!(mergeBodyList.length || mergeFooterList.length);
1121
1131
  const opts = Object.assign({
1122
1132
  message: true,
@@ -1223,14 +1233,14 @@ export default {
1223
1233
  }, {
1224
1234
  children: 'childNodes',
1225
1235
  mapChildren: '_children'
1226
- }), (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, column: column, $columnIndex: index })), {
1236
+ }), (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column: column, $columnIndex: index })), {
1227
1237
  children: '_children',
1228
1238
  mapChildren: 'childNodes',
1229
1239
  original: true
1230
1240
  });
1231
1241
  }
1232
1242
  else {
1233
- groups = XEUtils.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, column, $columnIndex: index })), { children: 'children', mapChildren: 'childNodes', original: true });
1243
+ groups = XEUtils.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column, $columnIndex: index })), { children: 'children', mapChildren: 'childNodes', original: true });
1234
1244
  }
1235
1245
  // 获取所有列
1236
1246
  const cols = [];
@@ -1248,7 +1258,8 @@ export default {
1248
1258
  handleOptions.filename = filename({
1249
1259
  options: opts,
1250
1260
  $table: $xeTable,
1251
- $grid: $xeGrid
1261
+ $grid: $xeGrid,
1262
+ $gantt: $xeGantt
1252
1263
  });
1253
1264
  }
1254
1265
  else {
@@ -1263,7 +1274,8 @@ export default {
1263
1274
  handleOptions.sheetName = sheetName({
1264
1275
  options: opts,
1265
1276
  $table: $xeTable,
1266
- $grid: $xeGrid
1277
+ $grid: $xeGrid,
1278
+ $gantt: $xeGantt
1267
1279
  });
1268
1280
  }
1269
1281
  else {
@@ -1284,7 +1296,7 @@ export default {
1284
1296
  }
1285
1297
  if (!handleOptions.print) {
1286
1298
  if (beforeExportMethod) {
1287
- beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid });
1299
+ beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
1288
1300
  }
1289
1301
  }
1290
1302
  if (!handleOptions.data) {
@@ -1298,12 +1310,12 @@ export default {
1298
1310
  }
1299
1311
  }
1300
1312
  else if (mode === 'all') {
1301
- if (!$xeGrid) {
1313
+ if (!$xeGGWrapper) {
1302
1314
  errLog('vxe.error.errProp', ['all', 'mode=current,selected']);
1303
1315
  }
1304
- if ($xeGrid && !handleOptions.remote) {
1305
- const gridReactData = $xeGrid;
1306
- const proxyOpts = $xeGrid.computeProxyOpts;
1316
+ if ($xeGGWrapper && !handleOptions.remote) {
1317
+ const gridReactData = $xeGGWrapper;
1318
+ const proxyOpts = $xeGGWrapper.computeProxyOpts;
1307
1319
  const { sortData } = gridReactData;
1308
1320
  const { beforeQueryAll, afterQueryAll, ajax = {} } = proxyOpts;
1309
1321
  const resConfigs = proxyOpts.response || proxyOpts.props || {};
@@ -1393,10 +1405,12 @@ export default {
1393
1405
  _print(options) {
1394
1406
  const $xeTable = this;
1395
1407
  const $xeGrid = $xeTable.$xeGrid;
1408
+ const $xeGantt = $xeTable.$xeGantt;
1409
+ const printOpts = $xeTable.computePrintOpts;
1396
1410
  const opts = Object.assign({
1397
1411
  original: false
1398
1412
  // beforePrintMethod
1399
- }, this.printOpts, options, {
1413
+ }, printOpts, options, {
1400
1414
  type: 'html',
1401
1415
  download: false,
1402
1416
  remote: false,
@@ -1409,7 +1423,8 @@ export default {
1409
1423
  printTitle = sheetName({
1410
1424
  options: opts,
1411
1425
  $table: $xeTable,
1412
- $grid: $xeGrid
1426
+ $grid: $xeGrid,
1427
+ $gantt: $xeGantt
1413
1428
  });
1414
1429
  }
1415
1430
  else {
@@ -1434,7 +1449,9 @@ export default {
1434
1449
  html,
1435
1450
  content: html,
1436
1451
  options: opts,
1437
- $table: $xeTable
1452
+ $table: $xeTable,
1453
+ $grid: $xeGrid,
1454
+ $gantt: $xeGantt
1438
1455
  });
1439
1456
  }
1440
1457
  : undefined
@@ -1452,7 +1469,9 @@ export default {
1452
1469
  html,
1453
1470
  content: html,
1454
1471
  options: opts,
1455
- $table: $xeTable
1472
+ $table: $xeTable,
1473
+ $grid: $xeGrid,
1474
+ $gantt: $xeGantt
1456
1475
  });
1457
1476
  }
1458
1477
  : undefined
@@ -60,6 +60,7 @@ export default {
60
60
  handleGlobalContextmenuEvent(evnt) {
61
61
  const $xeTable = this;
62
62
  const $xeGrid = $xeTable.$xeGrid;
63
+ const $xeGantt = $xeTable.$xeGantt;
63
64
  const internalData = $xeTable;
64
65
  const { $refs, tId, editStore, menuConfig, contextMenu, ctxMenuStore, ctxMenuOpts, mouseConfig, mouseOpts } = this;
65
66
  const { selected } = editStore;
@@ -72,7 +73,7 @@ export default {
72
73
  }
73
74
  if (internalData._keyCtx) {
74
75
  const type = 'body';
75
- const params = { type, $grid: $xeGrid, $table: this, keyboard: true, columns: this.visibleColumn.slice(0), $event: evnt };
76
+ const params = { type, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, keyboard: true, columns: this.visibleColumn.slice(0), $event: evnt };
76
77
  // 如果开启单元格区域
77
78
  if (mouseConfig && mouseOpts.area) {
78
79
  const activeArea = this.getActiveCellArea();
@@ -100,7 +101,7 @@ export default {
100
101
  // target=td|th,直接向上找 table 去匹配即可
101
102
  return target.parentNode.parentNode.parentNode.getAttribute('xid') === tId;
102
103
  });
103
- const params = { type: layout, $grid: $xeGrid, $table: this, columns: this.visibleColumn.slice(0), $event: evnt };
104
+ const params = { type: layout, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, columns: this.visibleColumn.slice(0), $event: evnt };
104
105
  if (columnTargetNode.flag) {
105
106
  const cell = columnTargetNode.targetElem;
106
107
  const column = this.getColumnNode(cell).item;
@@ -263,10 +264,11 @@ export default {
263
264
  ctxMenuLinkEvent(evnt, menu) {
264
265
  const $xeTable = this;
265
266
  const $xeGrid = $xeTable.$xeGrid;
267
+ const $xeGantt = $xeTable.$xeGantt;
266
268
  // 如果一级菜单有配置 code 则允许点击,否则不能点击
267
269
  if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
268
270
  const gMenuOpts = menus.get(menu.code);
269
- const params = Object.assign({ menu, $grid: $xeGrid, $table: this, $event: evnt }, this.ctxMenuStore.args);
271
+ const params = Object.assign({ menu, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt }, this.ctxMenuStore.args);
270
272
  if (gMenuOpts && gMenuOpts.menuMethod) {
271
273
  gMenuOpts.menuMethod(params, evnt);
272
274
  }
@@ -60,6 +60,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
60
60
  const tableReactData = $xeTable;
61
61
  const tableInternalData = $xeTable;
62
62
  const $xeGrid = $xeTable.$xeGrid;
63
+ const $xeGantt = $xeTable.$xeGantt;
63
64
  const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
64
65
  const { tableData, tableColumn, dragRow, overflowX, overflowY, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData;
65
66
  const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore } = tableInternalData;
@@ -116,6 +117,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
116
117
  const cellParams = {
117
118
  $table: $xeTable,
118
119
  $grid: $xeGrid,
120
+ $gantt: $xeGantt,
119
121
  isEdit: false,
120
122
  seq,
121
123
  rowid,
@@ -417,6 +419,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
417
419
  const tableReactData = $xeTable;
418
420
  const tableInternalData = $xeTable;
419
421
  const $xeGrid = $xeTable.$xeGrid;
422
+ const $xeGantt = $xeTable.$xeGantt;
420
423
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
421
424
  const { hasFixedColumn, treeExpandedFlag, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData;
422
425
  const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData;
@@ -562,6 +565,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
562
565
  const expandParams = {
563
566
  $grid: $xeGrid,
564
567
  $table: $xeTable,
568
+ $gantt: $xeGantt,
565
569
  seq,
566
570
  column: expandColumn,
567
571
  columnIndex,
@@ -666,6 +670,7 @@ export default {
666
670
  const tableReactData = $xeTable;
667
671
  const tableInternalData = $xeTable;
668
672
  const $xeGrid = $xeTable.$xeGrid;
673
+ const $xeGantt = $xeTable.$xeGantt;
669
674
  const slots = $xeTable.$scopedSlots;
670
675
  const { xID } = $xeTable;
671
676
  const { fixedColumn, fixedType, tableColumn } = props;
@@ -745,7 +750,7 @@ export default {
745
750
  }
746
751
  let emptyContent;
747
752
  const emptySlot = slots ? slots.empty : null;
748
- const emptyParams = { $table: $xeTable, $grid: $xeGrid };
753
+ const emptyParams = { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt };
749
754
  if (emptySlot) {
750
755
  emptyContent = emptySlot.call($xeTable, emptyParams);
751
756
  }
@@ -154,7 +154,8 @@ export default {
154
154
  provide() {
155
155
  return {
156
156
  $xeColumn: this,
157
- $xeGrid: null
157
+ $xeGrid: null,
158
+ $xeGantt: null
158
159
  };
159
160
  },
160
161
  inject: {
@@ -9,6 +9,8 @@ export class ColumnInfo {
9
9
  constructor($xeTable, _vm, { renderHeader, renderCell, renderFooter, renderData } = {}) {
10
10
  const tableProps = $xeTable;
11
11
  const $xeGrid = $xeTable.$xeGrid;
12
+ const $xeGantt = $xeTable.$xeGantt;
13
+ const $xeGGWrapper = $xeGrid || $xeGantt;
12
14
  const { field, editRender } = _vm;
13
15
  const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : null;
14
16
  const formatter = _vm.formatter;
@@ -158,8 +160,10 @@ export class ColumnInfo {
158
160
  // 单元格插槽,只对 grid 有效
159
161
  slots: _vm.slots
160
162
  });
161
- if (proxyOpts && proxyOpts.beforeColumn) {
162
- proxyOpts.beforeColumn({ $grid: $xeGrid, column: this });
163
+ if ($xeGGWrapper) {
164
+ if (proxyOpts && proxyOpts.beforeColumn) {
165
+ proxyOpts.beforeColumn({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column: this });
166
+ }
163
167
  }
164
168
  }
165
169
  getTitle() {
@@ -12,6 +12,7 @@ function renderRows(h, _vm, isOptimizeMode, tableColumn, footerTableData, row, $
12
12
  const tableReactData = $xeTable;
13
13
  const tableInternalData = $xeTable;
14
14
  const $xeGrid = $xeTable.$xeGrid;
15
+ const $xeGantt = $xeTable.$xeGantt;
15
16
  const { fixedType } = props;
16
17
  const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps;
17
18
  const { scrollXLoad, scrollYLoad, overflowX, currentColumn, mergeFootFlag } = tableReactData;
@@ -49,6 +50,7 @@ function renderRows(h, _vm, isOptimizeMode, tableColumn, footerTableData, row, $
49
50
  const cellParams = {
50
51
  $table: $xeTable,
51
52
  $grid: $xeGrid,
53
+ $gantt: $xeGantt,
52
54
  row,
53
55
  rowIndex: _rowIndex,
54
56
  _rowIndex,
@@ -8,7 +8,8 @@ export default {
8
8
  provide() {
9
9
  return {
10
10
  $xeColumn: this,
11
- $xeGrid: null
11
+ $xeGrid: null,
12
+ $xeGantt: null
12
13
  };
13
14
  },
14
15
  inject: {
@@ -8,6 +8,7 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
8
8
  const props = _vm;
9
9
  const $xeTable = _vm.$parent;
10
10
  const $xeGrid = $xeTable.$xeGrid;
11
+ const $xeGantt = $xeTable.$xeGantt;
11
12
  const tableProps = $xeTable;
12
13
  const tableReactData = $xeTable;
13
14
  const tableInternalData = $xeTable;
@@ -50,6 +51,7 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
50
51
  const cellParams = {
51
52
  $table: $xeTable,
52
53
  $grid: $xeGrid,
54
+ $gantt: $xeGantt,
53
55
  $rowIndex,
54
56
  column,
55
57
  columnIndex,
@@ -3748,9 +3748,11 @@ const Methods = {
3748
3748
  const $xeTable = this;
3749
3749
  // const slots = $xeTable.$scopedSlots
3750
3750
  const $xeGrid = $xeTable.$xeGrid;
3751
+ const $xeGantt = $xeTable.$xeGantt;
3752
+ const $xeGGWrapper = $xeGrid || $xeGantt;
3751
3753
  if (slotFunc) {
3752
- if ($xeGrid) {
3753
- return $xeGrid.callSlot(slotFunc, params, h, vNodes);
3754
+ if ($xeGGWrapper) {
3755
+ return $xeGGWrapper.callSlot(slotFunc, params, h, vNodes);
3754
3756
  }
3755
3757
  // if (XEUtils.isString(slotFunc)) {
3756
3758
  // slotFunc = slots[slotFunc] || null
@@ -3771,8 +3773,10 @@ const Methods = {
3771
3773
  getParentElem() {
3772
3774
  const $xeTable = this;
3773
3775
  const $xeGrid = $xeTable.$xeGrid;
3776
+ const $xeGantt = $xeTable.$xeGantt;
3777
+ const $xeGGWrapper = $xeGrid || $xeGantt;
3774
3778
  const { $el } = this;
3775
- return $xeGrid ? $xeGrid.$el.parentNode : $el.parentNode;
3779
+ return $xeGGWrapper ? $xeGGWrapper.$el.parentNode : $el.parentNode;
3776
3780
  },
3777
3781
  /**
3778
3782
  * 获取父容器的高度
@@ -3780,6 +3784,8 @@ const Methods = {
3780
3784
  getParentHeight() {
3781
3785
  const $xeTable = this;
3782
3786
  const $xeGrid = $xeTable.$xeGrid;
3787
+ const $xeGantt = $xeTable.$xeGantt;
3788
+ const $xeGGWrapper = $xeGrid || $xeGantt;
3783
3789
  const props = $xeTable;
3784
3790
  const { height } = props;
3785
3791
  const el = $xeTable.$refs.refElem;
@@ -3788,8 +3794,8 @@ const Methods = {
3788
3794
  const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
3789
3795
  let parentWrapperHeight = 0;
3790
3796
  if (parentElem) {
3791
- if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
3792
- parentWrapperHeight = $xeGrid.getParentHeight();
3797
+ if ($xeGGWrapper && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
3798
+ parentWrapperHeight = $xeGGWrapper.getParentHeight();
3793
3799
  }
3794
3800
  else {
3795
3801
  parentWrapperHeight = parentElem.clientHeight;
@@ -3807,7 +3813,9 @@ const Methods = {
3807
3813
  getExcludeHeight() {
3808
3814
  const $xeTable = this;
3809
3815
  const $xeGrid = $xeTable.$xeGrid;
3810
- return $xeGrid ? $xeGrid.getExcludeHeight() : 0;
3816
+ const $xeGantt = $xeTable.$xeGantt;
3817
+ const $xeGGWrapper = $xeGrid || $xeGantt;
3818
+ return $xeGGWrapper ? $xeGGWrapper.getExcludeHeight() : 0;
3811
3819
  },
3812
3820
  /**
3813
3821
  * 重置表格的一切数据状态
@@ -5985,6 +5993,7 @@ const Methods = {
5985
5993
  preventEvent(evnt, type, args, next, end) {
5986
5994
  const $xeTable = this;
5987
5995
  const $xeGrid = $xeTable.$xeGrid;
5996
+ const $xeGantt = $xeTable.$xeGantt;
5988
5997
  let evntList = interceptor.get(type);
5989
5998
  // 兼容老版本
5990
5999
  if (!evntList.length && type === 'event.clearEdit') {
@@ -5998,7 +6007,7 @@ const Methods = {
5998
6007
  let isStop = false;
5999
6008
  for (let i = 0; i < evntList.length; i++) {
6000
6009
  const func = evntList[i];
6001
- const fnRest = func(Object.assign({ $grid: $xeGrid, $table: $xeTable, $event: evnt }, args));
6010
+ const fnRest = func(Object.assign({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt }, args));
6002
6011
  if (fnRest === false) {
6003
6012
  isStop = true;
6004
6013
  break;
@@ -6025,6 +6034,8 @@ const Methods = {
6025
6034
  handleGlobalMousedownEvent(evnt) {
6026
6035
  const $xeTable = this;
6027
6036
  const $xeGrid = $xeTable.$xeGrid;
6037
+ const $xeGantt = $xeTable.$xeGantt;
6038
+ const $xeGGWrapper = $xeGrid || $xeGantt;
6028
6039
  const { $el, $refs, $toolbar, mouseConfig, editStore, ctxMenuStore, editRules, editOpts, validOpts, areaOpts, filterStore, customStore, getRowNode } = this;
6029
6040
  const { actived } = editStore;
6030
6041
  const tableFilter = $refs.refTableFilter;
@@ -6116,7 +6127,7 @@ const Methods = {
6116
6127
  }
6117
6128
  }
6118
6129
  else if (mouseConfig) {
6119
- if (!getEventTargetNode(evnt, $el).flag && !($xeGrid && getEventTargetNode(evnt, $xeGrid.$el).flag) && !(tableMenu && getEventTargetNode(evnt, tableMenu.$el).flag) && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
6130
+ if (!getEventTargetNode(evnt, $el).flag && !($xeGGWrapper && getEventTargetNode(evnt, $xeGGWrapper.$el).flag) && !(tableMenu && getEventTargetNode(evnt, tableMenu.$el).flag) && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
6120
6131
  if (this.clearSelected) {
6121
6132
  this.clearSelected();
6122
6133
  }
@@ -6138,7 +6149,7 @@ const Methods = {
6138
6149
  if (ctxMenuStore.visible && tableMenu && !getEventTargetNode(evnt, tableMenu.$el).flag) {
6139
6150
  this.closeMenu();
6140
6151
  }
6141
- const isActivated = getEventTargetNode(evnt, ($xeGrid || this).$el).flag;
6152
+ const isActivated = getEventTargetNode(evnt, ($xeGGWrapper || $xeTable).$el).flag;
6142
6153
  // 如果存在校验,点击了表格之外则清除
6143
6154
  if (!isActivated && editRules && validOpts.autoClear) {
6144
6155
  this.validErrorMaps = {};
@@ -6205,6 +6216,7 @@ const Methods = {
6205
6216
  const internalData = $xeTable;
6206
6217
  const reactData = $xeTable;
6207
6218
  const $xeGrid = $xeTable.$xeGrid;
6219
+ const $xeGantt = $xeTable.$xeGantt;
6208
6220
  // 该行为只对当前激活的表格有效
6209
6221
  if (internalData.isActivated) {
6210
6222
  $xeTable.preventEvent(evnt, 'event.keydown', null, () => {
@@ -6422,7 +6434,8 @@ const Methods = {
6422
6434
  column: selected.column,
6423
6435
  columnIndex: $xeTable.getColumnIndex(selected.column),
6424
6436
  $table: $xeTable,
6425
- $grid: $xeGrid
6437
+ $grid: $xeGrid,
6438
+ $gantt: $xeGantt
6426
6439
  };
6427
6440
  // 是否被禁用
6428
6441
  if (!beforeEditMethod || beforeEditMethod(params)) {
@@ -6449,7 +6462,8 @@ const Methods = {
6449
6462
  column: selected.column,
6450
6463
  columnIndex: $xeTable.getColumnIndex(selected.column),
6451
6464
  $table: $xeTable,
6452
- $grid: $xeGrid
6465
+ $grid: $xeGrid,
6466
+ $gantt: $xeGantt
6453
6467
  };
6454
6468
  // 是否被禁用
6455
6469
  if (!beforeEditMethod || beforeEditMethod(params)) {
@@ -6478,7 +6492,8 @@ const Methods = {
6478
6492
  rowIndex: $xeTable.getRowIndex(parentRow),
6479
6493
  $rowIndex: $xeTable.getVMRowIndex(parentRow),
6480
6494
  $table: $xeTable,
6481
- $grid: $xeGrid
6495
+ $grid: $xeGrid,
6496
+ $gantt: $xeGantt
6482
6497
  };
6483
6498
  $xeTable.setTreeExpand(parentRow, false)
6484
6499
  .then(() => $xeTable.scrollToRow(parentRow))
@@ -6500,7 +6515,8 @@ const Methods = {
6500
6515
  column: selected.column,
6501
6516
  columnIndex: $xeTable.getColumnIndex(selected.column),
6502
6517
  $table: $xeTable,
6503
- $grid: $xeGrid
6518
+ $grid: $xeGrid,
6519
+ $gantt: $xeGantt
6504
6520
  };
6505
6521
  if (!beforeEditMethod || beforeEditMethod(params)) {
6506
6522
  if (editMethod) {
@@ -10732,6 +10748,7 @@ const Methods = {
10732
10748
  const reactData = $xeTable;
10733
10749
  const internalData = $xeTable;
10734
10750
  const $xeGrid = $xeTable.$xeGrid;
10751
+ const $xeGantt = $xeTable.$xeGantt;
10735
10752
  const { showFooter, footerData, footerMethod } = props;
10736
10753
  const { visibleColumn, afterFullData } = internalData;
10737
10754
  let footData = [];
@@ -10739,7 +10756,7 @@ const Methods = {
10739
10756
  footData = footerData.slice(0);
10740
10757
  }
10741
10758
  else if (showFooter && footerMethod) {
10742
- footData = visibleColumn.length ? footerMethod({ columns: visibleColumn, data: afterFullData, $table: $xeTable, $grid: $xeGrid }) : [];
10759
+ footData = visibleColumn.length ? footerMethod({ columns: visibleColumn, data: afterFullData, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : [];
10743
10760
  }
10744
10761
  reactData.footerTableData = footData;
10745
10762
  $xeTable.handleUpdateFooterMerge();
@@ -10899,13 +10916,15 @@ const Methods = {
10899
10916
  dispatchEvent(type, params, evnt) {
10900
10917
  const $xeTable = this;
10901
10918
  const $xeGrid = $xeTable.$xeGrid;
10902
- $xeTable.$emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid }, params));
10919
+ const $xeGantt = $xeTable.$xeGantt;
10920
+ $xeTable.$emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }, params));
10903
10921
  },
10904
10922
  // 已废弃,使用 dispatchEvent
10905
10923
  emitEvent(type, params, evnt) {
10906
10924
  const $xeTable = this;
10907
10925
  const $xeGrid = $xeTable.$xeGrid;
10908
- this.$emit(type, Object.assign({ $table: $xeTable, $grid: $xeGrid, $event: evnt }, params));
10926
+ const $xeGantt = $xeTable.$xeGantt;
10927
+ $xeTable.$emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt }));
10909
10928
  },
10910
10929
  focus() {
10911
10930
  this.isActivated = true;