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.
- package/es/grid/src/grid.js +3 -1
- package/es/style.css +1 -1
- package/es/table/module/custom/mixin.js +4 -2
- package/es/table/module/custom/panel.js +4 -0
- package/es/table/module/export/export-panel.js +3 -0
- package/es/table/module/export/import-panel.js +3 -0
- package/es/table/module/export/mixin.js +41 -22
- package/es/table/module/menu/mixin.js +5 -3
- package/es/table/src/body.js +6 -1
- package/es/table/src/column.js +2 -1
- package/es/table/src/columnInfo.js +6 -2
- package/es/table/src/footer.js +2 -0
- package/es/table/src/group.js +2 -1
- package/es/table/src/header.js +2 -0
- package/es/table/src/methods.js +35 -16
- package/es/table/src/table.js +10 -5
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +3 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +154 -54
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +4 -2
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +4 -0
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +3 -0
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +3 -0
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +49 -18
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +8 -3
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/src/body.js +7 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/column.js +2 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +11 -5
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +2 -0
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +2 -1
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +2 -0
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +40 -17
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +12 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +3 -1
- package/packages/table/module/custom/mixin.ts +7 -5
- package/packages/table/module/custom/panel.ts +4 -0
- package/packages/table/module/export/export-panel.ts +3 -0
- package/packages/table/module/export/import-panel.ts +3 -0
- package/packages/table/module/export/mixin.ts +43 -22
- package/packages/table/module/menu/mixin.ts +8 -6
- package/packages/table/src/body.ts +6 -1
- package/packages/table/src/column.ts +2 -1
- package/packages/table/src/columnInfo.ts +8 -4
- package/packages/table/src/footer.ts +2 -0
- package/packages/table/src/group.ts +2 -1
- package/packages/table/src/header.ts +5 -1
- package/packages/table/src/methods.ts +46 -27
- package/packages/table/src/table.ts +10 -5
- /package/es/{iconfont.1755178463571.ttf → iconfont.1755232583063.ttf} +0 -0
- /package/es/{iconfont.1755178463571.woff → iconfont.1755232583063.woff} +0 -0
- /package/es/{iconfont.1755178463571.woff2 → iconfont.1755232583063.woff2} +0 -0
- /package/lib/{iconfont.1755178463571.ttf → iconfont.1755232583063.ttf} +0 -0
- /package/lib/{iconfont.1755178463571.woff → iconfont.1755232583063.woff} +0 -0
- /package/lib/{iconfont.1755178463571.woff2 → iconfont.1755232583063.woff2} +0 -0
|
@@ -212,10 +212,13 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
function getExportData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions) {
|
|
215
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
216
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
217
|
+
|
|
215
218
|
const { columns, dataFilterMethod } = opts
|
|
216
219
|
let datas = opts.data
|
|
217
220
|
if (dataFilterMethod) {
|
|
218
|
-
datas = datas.filter((row, index) => dataFilterMethod({ $table: $xeTable, row, $rowIndex: index }))
|
|
221
|
+
datas = datas.filter((row, index) => dataFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, row, $rowIndex: index }))
|
|
219
222
|
}
|
|
220
223
|
return getBodyLabelData($xeTable, opts, columns, datas)
|
|
221
224
|
}
|
|
@@ -255,8 +258,11 @@ function getFooterCellValue ($xeTable: any, opts: VxeTablePropTypes.ExportHandle
|
|
|
255
258
|
}
|
|
256
259
|
|
|
257
260
|
function getFooterData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions, footerTableData: any[]) {
|
|
261
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
262
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
263
|
+
|
|
258
264
|
const { footerFilterMethod } = opts
|
|
259
|
-
return footerFilterMethod ? footerTableData.filter((items: any, index: any) => footerFilterMethod({ $table: $xeTable, items, $rowIndex: index })) : footerTableData
|
|
265
|
+
return footerFilterMethod ? footerTableData.filter((items: any, index: any) => footerFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, items, $rowIndex: index })) : footerTableData
|
|
260
266
|
}
|
|
261
267
|
|
|
262
268
|
function getCsvCellTypeLabel (column: any, cellValue: any) {
|
|
@@ -599,11 +605,12 @@ function clearColumnConvert (columns: any) {
|
|
|
599
605
|
|
|
600
606
|
function handleExport ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions) {
|
|
601
607
|
const $xeGrid = $xeTable.$xeGrid
|
|
608
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
602
609
|
|
|
603
610
|
const { remote, columns, colgroups, exportMethod, afterExportMethod } = opts
|
|
604
611
|
return new Promise(resolve => {
|
|
605
612
|
if (remote) {
|
|
606
|
-
const params = { options: opts, $table: $xeTable, $grid: $xeGrid }
|
|
613
|
+
const params = { options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }
|
|
607
614
|
resolve(exportMethod ? exportMethod(params) : params)
|
|
608
615
|
} else {
|
|
609
616
|
const datas = getExportData($xeTable, opts)
|
|
@@ -617,7 +624,7 @@ function handleExport ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, o
|
|
|
617
624
|
clearColumnConvert(columns)
|
|
618
625
|
if (!opts.print) {
|
|
619
626
|
if (afterExportMethod) {
|
|
620
|
-
afterExportMethod({ status: true, options: opts, $table: $xeTable, $grid: $xeGrid })
|
|
627
|
+
afterExportMethod({ status: true, options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
621
628
|
}
|
|
622
629
|
}
|
|
623
630
|
return Object.assign({ status: true }, params)
|
|
@@ -625,7 +632,7 @@ function handleExport ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, o
|
|
|
625
632
|
clearColumnConvert(columns)
|
|
626
633
|
if (!opts.print) {
|
|
627
634
|
if (afterExportMethod) {
|
|
628
|
-
afterExportMethod({ status: false, options: opts, $table: $xeTable, $grid: $xeGrid })
|
|
635
|
+
afterExportMethod({ status: false, options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
629
636
|
}
|
|
630
637
|
}
|
|
631
638
|
const params = { status: false }
|
|
@@ -995,6 +1002,8 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
995
1002
|
const reactData = $xeTable as unknown as TableReactData
|
|
996
1003
|
const internalData = $xeTable as unknown as TableInternalData
|
|
997
1004
|
const $xeGrid = $xeTable.$xeGrid
|
|
1005
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
1006
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
998
1007
|
|
|
999
1008
|
const { treeConfig, showHeader, showFooter } = props
|
|
1000
1009
|
const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData
|
|
@@ -1003,7 +1012,7 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1003
1012
|
const hasTree = treeConfig
|
|
1004
1013
|
const customOpts = $xeTable.computeCustomOpts
|
|
1005
1014
|
const selectRecords = $xeTable.getCheckboxRecords()
|
|
1006
|
-
const proxyOpts = $
|
|
1015
|
+
const proxyOpts = $xeGGWrapper ? $xeGGWrapper.computeProxyOpts : {}
|
|
1007
1016
|
const hasFooter = !!footerTableData.length
|
|
1008
1017
|
const hasMerge = !!(mergeBodyList.length || mergeFooterList.length)
|
|
1009
1018
|
const defOpts = Object.assign({
|
|
@@ -1078,7 +1087,8 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1078
1087
|
exportParams.filename = filename({
|
|
1079
1088
|
options: defOpts,
|
|
1080
1089
|
$table: $xeTable,
|
|
1081
|
-
$grid: $xeGrid
|
|
1090
|
+
$grid: $xeGrid,
|
|
1091
|
+
$gantt: $xeGantt
|
|
1082
1092
|
})
|
|
1083
1093
|
} else {
|
|
1084
1094
|
exportParams.filename = `${filename}`
|
|
@@ -1089,7 +1099,8 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1089
1099
|
exportParams.sheetName = sheetName({
|
|
1090
1100
|
options: defOpts,
|
|
1091
1101
|
$table: $xeTable,
|
|
1092
|
-
$grid: $xeGrid
|
|
1102
|
+
$grid: $xeGrid,
|
|
1103
|
+
$gantt: $xeGantt
|
|
1093
1104
|
})
|
|
1094
1105
|
} else {
|
|
1095
1106
|
exportParams.sheetName = `${sheetName}`
|
|
@@ -1178,13 +1189,14 @@ export default {
|
|
|
1178
1189
|
const internalData = $xeTable as unknown as TableInternalData
|
|
1179
1190
|
const $xeGrid = $xeTable.$xeGrid
|
|
1180
1191
|
const $xeGantt = $xeTable.$xeGantt
|
|
1192
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
1181
1193
|
|
|
1182
1194
|
const { treeConfig, showHeader, showFooter } = props
|
|
1183
1195
|
const { isGroup } = reactData
|
|
1184
1196
|
const { tableFullColumn, afterFullData, afterTreeFullData, collectColumn, mergeBodyList, mergeFooterList } = internalData
|
|
1185
1197
|
const exportOpts = $xeTable.computeExportOpts
|
|
1186
1198
|
const treeOpts = $xeTable.computeTreeOpts
|
|
1187
|
-
const proxyOpts = $
|
|
1199
|
+
const proxyOpts = $xeGGWrapper ? $xeGGWrapper.computeProxyOpts : {}
|
|
1188
1200
|
const hasMerge = !!(mergeBodyList.length || mergeFooterList.length)
|
|
1189
1201
|
const opts = Object.assign({
|
|
1190
1202
|
message: true,
|
|
@@ -1285,7 +1297,7 @@ export default {
|
|
|
1285
1297
|
children: 'childNodes',
|
|
1286
1298
|
mapChildren: '_children'
|
|
1287
1299
|
}),
|
|
1288
|
-
(column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, column: column as any, $columnIndex: index })),
|
|
1300
|
+
(column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column: column as any, $columnIndex: index })),
|
|
1289
1301
|
{
|
|
1290
1302
|
children: '_children',
|
|
1291
1303
|
mapChildren: 'childNodes',
|
|
@@ -1293,7 +1305,7 @@ export default {
|
|
|
1293
1305
|
}
|
|
1294
1306
|
)
|
|
1295
1307
|
} else {
|
|
1296
|
-
groups = XEUtils.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, column, $columnIndex: index })), { children: 'children', mapChildren: 'childNodes', original: true })
|
|
1308
|
+
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 })
|
|
1297
1309
|
}
|
|
1298
1310
|
// 获取所有列
|
|
1299
1311
|
const cols: VxeTableDefines.ColumnInfo[] = []
|
|
@@ -1311,7 +1323,8 @@ export default {
|
|
|
1311
1323
|
handleOptions.filename = filename({
|
|
1312
1324
|
options: opts,
|
|
1313
1325
|
$table: $xeTable,
|
|
1314
|
-
$grid: $xeGrid
|
|
1326
|
+
$grid: $xeGrid,
|
|
1327
|
+
$gantt: $xeGantt
|
|
1315
1328
|
})
|
|
1316
1329
|
} else {
|
|
1317
1330
|
handleOptions.filename = `${filename}`
|
|
@@ -1326,7 +1339,8 @@ export default {
|
|
|
1326
1339
|
handleOptions.sheetName = sheetName({
|
|
1327
1340
|
options: opts,
|
|
1328
1341
|
$table: $xeTable,
|
|
1329
|
-
$grid: $xeGrid
|
|
1342
|
+
$grid: $xeGrid,
|
|
1343
|
+
$gantt: $xeGantt
|
|
1330
1344
|
})
|
|
1331
1345
|
} else {
|
|
1332
1346
|
handleOptions.sheetName = `${sheetName}`
|
|
@@ -1348,7 +1362,7 @@ export default {
|
|
|
1348
1362
|
|
|
1349
1363
|
if (!handleOptions.print) {
|
|
1350
1364
|
if (beforeExportMethod) {
|
|
1351
|
-
beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid })
|
|
1365
|
+
beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
|
|
1352
1366
|
}
|
|
1353
1367
|
}
|
|
1354
1368
|
|
|
@@ -1361,13 +1375,13 @@ export default {
|
|
|
1361
1375
|
handleOptions.data = selectRecords
|
|
1362
1376
|
}
|
|
1363
1377
|
} else if (mode === 'all') {
|
|
1364
|
-
if (!$
|
|
1378
|
+
if (!$xeGGWrapper) {
|
|
1365
1379
|
errLog('vxe.error.errProp', ['all', 'mode=current,selected'])
|
|
1366
1380
|
}
|
|
1367
1381
|
|
|
1368
|
-
if ($
|
|
1369
|
-
const gridReactData = $
|
|
1370
|
-
const proxyOpts = $
|
|
1382
|
+
if ($xeGGWrapper && !handleOptions.remote) {
|
|
1383
|
+
const gridReactData = $xeGGWrapper as unknown as GridReactData
|
|
1384
|
+
const proxyOpts = $xeGGWrapper.computeProxyOpts
|
|
1371
1385
|
const { sortData } = gridReactData
|
|
1372
1386
|
const { beforeQueryAll, afterQueryAll, ajax = {} } = proxyOpts
|
|
1373
1387
|
const resConfigs = proxyOpts.response || proxyOpts.props || {}
|
|
@@ -1467,11 +1481,13 @@ export default {
|
|
|
1467
1481
|
_print (options?: VxeTablePropTypes.PrintConfig) {
|
|
1468
1482
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1469
1483
|
const $xeGrid = $xeTable.$xeGrid
|
|
1484
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
1470
1485
|
|
|
1486
|
+
const printOpts = $xeTable.computePrintOpts
|
|
1471
1487
|
const opts = Object.assign({
|
|
1472
1488
|
original: false
|
|
1473
1489
|
// beforePrintMethod
|
|
1474
|
-
},
|
|
1490
|
+
}, printOpts, options, {
|
|
1475
1491
|
type: 'html',
|
|
1476
1492
|
download: false,
|
|
1477
1493
|
remote: false,
|
|
@@ -1485,7 +1501,8 @@ export default {
|
|
|
1485
1501
|
printTitle = sheetName({
|
|
1486
1502
|
options: opts,
|
|
1487
1503
|
$table: $xeTable,
|
|
1488
|
-
$grid: $xeGrid
|
|
1504
|
+
$grid: $xeGrid,
|
|
1505
|
+
$gantt: $xeGantt
|
|
1489
1506
|
})
|
|
1490
1507
|
} else {
|
|
1491
1508
|
printTitle = `${sheetName}`
|
|
@@ -1511,7 +1528,9 @@ export default {
|
|
|
1511
1528
|
html,
|
|
1512
1529
|
content: html,
|
|
1513
1530
|
options: opts,
|
|
1514
|
-
$table: $xeTable
|
|
1531
|
+
$table: $xeTable,
|
|
1532
|
+
$grid: $xeGrid,
|
|
1533
|
+
$gantt: $xeGantt
|
|
1515
1534
|
})
|
|
1516
1535
|
}
|
|
1517
1536
|
: undefined
|
|
@@ -1530,7 +1549,9 @@ export default {
|
|
|
1530
1549
|
html,
|
|
1531
1550
|
content: html,
|
|
1532
1551
|
options: opts,
|
|
1533
|
-
$table: $xeTable
|
|
1552
|
+
$table: $xeTable,
|
|
1553
|
+
$grid: $xeGrid,
|
|
1554
|
+
$gantt: $xeGantt
|
|
1534
1555
|
})
|
|
1535
1556
|
}
|
|
1536
1557
|
: undefined
|
|
@@ -4,7 +4,7 @@ import { getDomNode, getAbsolutePos, getEventTargetNode } from '../../../ui/src/
|
|
|
4
4
|
import { isEnableConf, hasChildrenList } from '../../../ui/src/utils'
|
|
5
5
|
import { warnLog } from '../../../ui/src/log'
|
|
6
6
|
|
|
7
|
-
import type { VxeTableConstructor, VxeTablePrivateMethods,
|
|
7
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods, TableInternalData } from '../../../../types'
|
|
8
8
|
|
|
9
9
|
const { menus, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI
|
|
10
10
|
|
|
@@ -60,7 +60,8 @@ export default {
|
|
|
60
60
|
*/
|
|
61
61
|
handleGlobalContextmenuEvent (evnt: any) {
|
|
62
62
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
63
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
63
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
64
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
64
65
|
const internalData = $xeTable as unknown as TableInternalData
|
|
65
66
|
|
|
66
67
|
const { $refs, tId, editStore, menuConfig, contextMenu, ctxMenuStore, ctxMenuOpts, mouseConfig, mouseOpts } = this
|
|
@@ -74,7 +75,7 @@ export default {
|
|
|
74
75
|
}
|
|
75
76
|
if (internalData._keyCtx) {
|
|
76
77
|
const type = 'body'
|
|
77
|
-
const params: any = { type, $grid: $xeGrid, $
|
|
78
|
+
const params: any = { type, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, keyboard: true, columns: this.visibleColumn.slice(0), $event: evnt }
|
|
78
79
|
// 如果开启单元格区域
|
|
79
80
|
if (mouseConfig && mouseOpts.area) {
|
|
80
81
|
const activeArea = this.getActiveCellArea()
|
|
@@ -101,7 +102,7 @@ export default {
|
|
|
101
102
|
// target=td|th,直接向上找 table 去匹配即可
|
|
102
103
|
return target.parentNode.parentNode.parentNode.getAttribute('xid') === tId
|
|
103
104
|
})
|
|
104
|
-
const params: any = { type: layout, $grid: $xeGrid, $
|
|
105
|
+
const params: any = { type: layout, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, columns: this.visibleColumn.slice(0), $event: evnt }
|
|
105
106
|
if (columnTargetNode.flag) {
|
|
106
107
|
const cell = columnTargetNode.targetElem
|
|
107
108
|
const column = this.getColumnNode(cell).item
|
|
@@ -257,12 +258,13 @@ export default {
|
|
|
257
258
|
*/
|
|
258
259
|
ctxMenuLinkEvent (evnt: any, menu: any) {
|
|
259
260
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
260
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
261
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
262
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
261
263
|
|
|
262
264
|
// 如果一级菜单有配置 code 则允许点击,否则不能点击
|
|
263
265
|
if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
|
|
264
266
|
const gMenuOpts = menus.get(menu.code)
|
|
265
|
-
const params = Object.assign({ menu, $grid: $xeGrid, $
|
|
267
|
+
const params = Object.assign({ menu, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt }, this.ctxMenuStore.args)
|
|
266
268
|
if (gMenuOpts && gMenuOpts.menuMethod) {
|
|
267
269
|
gMenuOpts.menuMethod(params, evnt)
|
|
268
270
|
}
|
|
@@ -86,6 +86,7 @@ function renderTdColumn (
|
|
|
86
86
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
87
87
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
88
88
|
const $xeGrid = $xeTable.$xeGrid
|
|
89
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
89
90
|
|
|
90
91
|
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
91
92
|
const { tableData, tableColumn, dragRow, overflowX, overflowY, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
@@ -145,6 +146,7 @@ function renderTdColumn (
|
|
|
145
146
|
} = {
|
|
146
147
|
$table: $xeTable,
|
|
147
148
|
$grid: $xeGrid,
|
|
149
|
+
$gantt: $xeGantt,
|
|
148
150
|
isEdit: false,
|
|
149
151
|
seq,
|
|
150
152
|
rowid,
|
|
@@ -462,6 +464,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
462
464
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
463
465
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
464
466
|
const $xeGrid = $xeTable.$xeGrid
|
|
467
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
465
468
|
|
|
466
469
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
467
470
|
const { hasFixedColumn, treeExpandedFlag, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
|
|
@@ -610,6 +613,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
610
613
|
const expandParams: VxeTableDefines.CellRenderDataParams = {
|
|
611
614
|
$grid: $xeGrid,
|
|
612
615
|
$table: $xeTable,
|
|
616
|
+
$gantt: $xeGantt,
|
|
613
617
|
seq,
|
|
614
618
|
column: expandColumn as VxeTableDefines.ColumnInfo,
|
|
615
619
|
columnIndex,
|
|
@@ -719,6 +723,7 @@ export default {
|
|
|
719
723
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
720
724
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
721
725
|
const $xeGrid = $xeTable.$xeGrid
|
|
726
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
722
727
|
const slots = $xeTable.$scopedSlots
|
|
723
728
|
|
|
724
729
|
const { xID } = $xeTable
|
|
@@ -803,7 +808,7 @@ export default {
|
|
|
803
808
|
|
|
804
809
|
let emptyContent
|
|
805
810
|
const emptySlot = slots ? slots.empty : null
|
|
806
|
-
const emptyParams = { $table: $xeTable, $grid: $xeGrid }
|
|
811
|
+
const emptyParams = { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }
|
|
807
812
|
if (emptySlot) {
|
|
808
813
|
emptyContent = emptySlot.call($xeTable, emptyParams)
|
|
809
814
|
} else {
|
|
@@ -4,7 +4,7 @@ import { toFilters } from './util'
|
|
|
4
4
|
import { getFuncText } from '../../ui/src/utils'
|
|
5
5
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
6
6
|
|
|
7
|
-
import type { VxeTableConstructor, VxeTablePrivateMethods
|
|
7
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
8
8
|
|
|
9
9
|
const { getI18n, formats } = VxeUI
|
|
10
10
|
|
|
@@ -12,7 +12,9 @@ export class ColumnInfo {
|
|
|
12
12
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
13
13
|
constructor ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, _vm: any, { renderHeader, renderCell, renderFooter, renderData }: any = {}) {
|
|
14
14
|
const tableProps = $xeTable
|
|
15
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
15
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
16
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
17
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
16
18
|
|
|
17
19
|
const { field, editRender } = _vm
|
|
18
20
|
|
|
@@ -174,8 +176,10 @@ export class ColumnInfo {
|
|
|
174
176
|
// 单元格插槽,只对 grid 有效
|
|
175
177
|
slots: _vm.slots
|
|
176
178
|
})
|
|
177
|
-
if (
|
|
178
|
-
proxyOpts.beforeColumn
|
|
179
|
+
if ($xeGGWrapper) {
|
|
180
|
+
if (proxyOpts && proxyOpts.beforeColumn) {
|
|
181
|
+
proxyOpts.beforeColumn({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column: this })
|
|
182
|
+
}
|
|
179
183
|
}
|
|
180
184
|
}
|
|
181
185
|
|
|
@@ -18,6 +18,7 @@ function renderRows (h: CreateElement, _vm: any, isOptimizeMode: boolean, tableC
|
|
|
18
18
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
19
19
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
20
20
|
const $xeGrid = $xeTable.$xeGrid
|
|
21
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
21
22
|
|
|
22
23
|
const { fixedType } = props
|
|
23
24
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
@@ -59,6 +60,7 @@ function renderRows (h: CreateElement, _vm: any, isOptimizeMode: boolean, tableC
|
|
|
59
60
|
} = {
|
|
60
61
|
$table: $xeTable,
|
|
61
62
|
$grid: $xeGrid,
|
|
63
|
+
$gantt: $xeGantt,
|
|
62
64
|
row,
|
|
63
65
|
rowIndex: _rowIndex,
|
|
64
66
|
_rowIndex,
|
|
@@ -14,6 +14,7 @@ const renderRows = (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMode
|
|
|
14
14
|
const props = _vm
|
|
15
15
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
16
16
|
const $xeGrid = $xeTable.$xeGrid
|
|
17
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
17
18
|
const tableProps = $xeTable
|
|
18
19
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
19
20
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
@@ -54,9 +55,12 @@ const renderRows = (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMode
|
|
|
54
55
|
}
|
|
55
56
|
const columnIndex = colRest.index
|
|
56
57
|
const _columnIndex = colRest._index
|
|
57
|
-
const cellParams
|
|
58
|
+
const cellParams: VxeTableDefines.CellRenderHeaderParams & {
|
|
59
|
+
$table: VxeTableConstructor & VxeTablePrivateMethods
|
|
60
|
+
} = {
|
|
58
61
|
$table: $xeTable,
|
|
59
62
|
$grid: $xeGrid,
|
|
63
|
+
$gantt: $xeGantt,
|
|
60
64
|
$rowIndex,
|
|
61
65
|
column,
|
|
62
66
|
columnIndex,
|
|
@@ -8,7 +8,7 @@ import { getSlotVNs } from '../../ui/src/vn'
|
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from './anime'
|
|
9
9
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
10
10
|
|
|
11
|
-
import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, VxeToolbarInstance, TableInternalData, VxeGridConstructor,
|
|
11
|
+
import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, VxeToolbarInstance, TableInternalData, VxeGridConstructor, VxeTablePrivateMethods, VxeTooltipInstance, VxeTablePropTypes, VxeGridPrivateMethods } from '../../../types'
|
|
12
12
|
|
|
13
13
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI
|
|
14
14
|
|
|
@@ -3910,11 +3910,13 @@ const Methods = {
|
|
|
3910
3910
|
callSlot (slotFunc: any, params: any, h: any, vNodes: any) {
|
|
3911
3911
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
3912
3912
|
// const slots = $xeTable.$scopedSlots
|
|
3913
|
-
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor &
|
|
3913
|
+
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & VxeGridPrivateMethods
|
|
3914
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
3915
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
3914
3916
|
|
|
3915
3917
|
if (slotFunc) {
|
|
3916
|
-
if ($
|
|
3917
|
-
return $
|
|
3918
|
+
if ($xeGGWrapper) {
|
|
3919
|
+
return $xeGGWrapper.callSlot(slotFunc, params, h, vNodes)
|
|
3918
3920
|
}
|
|
3919
3921
|
// if (XEUtils.isString(slotFunc)) {
|
|
3920
3922
|
// slotFunc = slots[slotFunc] || null
|
|
@@ -3935,17 +3937,21 @@ const Methods = {
|
|
|
3935
3937
|
*/
|
|
3936
3938
|
getParentElem () {
|
|
3937
3939
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
3938
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
3940
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
3941
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
3942
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
3939
3943
|
|
|
3940
3944
|
const { $el } = this
|
|
3941
|
-
return $
|
|
3945
|
+
return $xeGGWrapper ? $xeGGWrapper.$el.parentNode : $el.parentNode
|
|
3942
3946
|
},
|
|
3943
3947
|
/**
|
|
3944
3948
|
* 获取父容器的高度
|
|
3945
3949
|
*/
|
|
3946
3950
|
getParentHeight () {
|
|
3947
3951
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
3948
|
-
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor &
|
|
3952
|
+
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & VxeGridPrivateMethods
|
|
3953
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
3954
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
3949
3955
|
const props = $xeTable
|
|
3950
3956
|
|
|
3951
3957
|
const { height } = props
|
|
@@ -3955,8 +3961,8 @@ const Methods = {
|
|
|
3955
3961
|
const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
|
|
3956
3962
|
let parentWrapperHeight = 0
|
|
3957
3963
|
if (parentElem) {
|
|
3958
|
-
if ($
|
|
3959
|
-
parentWrapperHeight = $
|
|
3964
|
+
if ($xeGGWrapper && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
|
|
3965
|
+
parentWrapperHeight = $xeGGWrapper.getParentHeight()
|
|
3960
3966
|
} else {
|
|
3961
3967
|
parentWrapperHeight = parentElem.clientHeight
|
|
3962
3968
|
}
|
|
@@ -3972,9 +3978,11 @@ const Methods = {
|
|
|
3972
3978
|
*/
|
|
3973
3979
|
getExcludeHeight () {
|
|
3974
3980
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
3975
|
-
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor &
|
|
3981
|
+
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & VxeGridPrivateMethods
|
|
3982
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
3983
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
3976
3984
|
|
|
3977
|
-
return $
|
|
3985
|
+
return $xeGGWrapper ? $xeGGWrapper.getExcludeHeight() : 0
|
|
3978
3986
|
},
|
|
3979
3987
|
/**
|
|
3980
3988
|
* 重置表格的一切数据状态
|
|
@@ -6221,7 +6229,8 @@ const Methods = {
|
|
|
6221
6229
|
},
|
|
6222
6230
|
preventEvent (evnt: any, type: any, args: any, next: any, end: any) {
|
|
6223
6231
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6224
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
6232
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
6233
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
6225
6234
|
|
|
6226
6235
|
let evntList = interceptor.get(type)
|
|
6227
6236
|
|
|
@@ -6238,7 +6247,7 @@ const Methods = {
|
|
|
6238
6247
|
let isStop = false
|
|
6239
6248
|
for (let i = 0; i < evntList.length; i++) {
|
|
6240
6249
|
const func = evntList[i]
|
|
6241
|
-
const fnRest = func(Object.assign({ $grid: $xeGrid, $
|
|
6250
|
+
const fnRest = func(Object.assign({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt }, args))
|
|
6242
6251
|
if (fnRest === false) {
|
|
6243
6252
|
isStop = true
|
|
6244
6253
|
break
|
|
@@ -6263,7 +6272,9 @@ const Methods = {
|
|
|
6263
6272
|
*/
|
|
6264
6273
|
handleGlobalMousedownEvent (evnt: any) {
|
|
6265
6274
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6266
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
6275
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
6276
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
6277
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
6267
6278
|
|
|
6268
6279
|
const { $el, $refs, $toolbar, mouseConfig, editStore, ctxMenuStore, editRules, editOpts, validOpts, areaOpts, filterStore, customStore, getRowNode } = this
|
|
6269
6280
|
const { actived } = editStore
|
|
@@ -6352,7 +6363,7 @@ const Methods = {
|
|
|
6352
6363
|
}
|
|
6353
6364
|
}
|
|
6354
6365
|
} else if (mouseConfig) {
|
|
6355
|
-
if (!getEventTargetNode(evnt, $el).flag && !($
|
|
6366
|
+
if (!getEventTargetNode(evnt, $el).flag && !($xeGGWrapper && getEventTargetNode(evnt, $xeGGWrapper.$el).flag) && !(tableMenu && getEventTargetNode(evnt, tableMenu.$el).flag) && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
|
|
6356
6367
|
if (this.clearSelected) {
|
|
6357
6368
|
this.clearSelected()
|
|
6358
6369
|
}
|
|
@@ -6374,7 +6385,7 @@ const Methods = {
|
|
|
6374
6385
|
if (ctxMenuStore.visible && tableMenu && !getEventTargetNode(evnt, tableMenu.$el).flag) {
|
|
6375
6386
|
this.closeMenu()
|
|
6376
6387
|
}
|
|
6377
|
-
const isActivated = getEventTargetNode(evnt, ($
|
|
6388
|
+
const isActivated = getEventTargetNode(evnt, ($xeGGWrapper || $xeTable).$el).flag
|
|
6378
6389
|
// 如果存在校验,点击了表格之外则清除
|
|
6379
6390
|
if (!isActivated && editRules && validOpts.autoClear) {
|
|
6380
6391
|
this.validErrorMaps = {}
|
|
@@ -6439,7 +6450,8 @@ const Methods = {
|
|
|
6439
6450
|
const props = $xeTable
|
|
6440
6451
|
const internalData = $xeTable as unknown as TableInternalData
|
|
6441
6452
|
const reactData = $xeTable as unknown as TableReactData
|
|
6442
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
6453
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
6454
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
6443
6455
|
|
|
6444
6456
|
// 该行为只对当前激活的表格有效
|
|
6445
6457
|
if (internalData.isActivated) {
|
|
@@ -6640,7 +6652,8 @@ const Methods = {
|
|
|
6640
6652
|
column: selected.column,
|
|
6641
6653
|
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
6642
6654
|
$table: $xeTable,
|
|
6643
|
-
$grid: $xeGrid
|
|
6655
|
+
$grid: $xeGrid,
|
|
6656
|
+
$gantt: $xeGantt
|
|
6644
6657
|
}
|
|
6645
6658
|
// 是否被禁用
|
|
6646
6659
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
@@ -6665,7 +6678,8 @@ const Methods = {
|
|
|
6665
6678
|
column: selected.column,
|
|
6666
6679
|
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
6667
6680
|
$table: $xeTable,
|
|
6668
|
-
$grid: $xeGrid
|
|
6681
|
+
$grid: $xeGrid,
|
|
6682
|
+
$gantt: $xeGantt
|
|
6669
6683
|
}
|
|
6670
6684
|
// 是否被禁用
|
|
6671
6685
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
@@ -6692,7 +6706,8 @@ const Methods = {
|
|
|
6692
6706
|
rowIndex: $xeTable.getRowIndex(parentRow),
|
|
6693
6707
|
$rowIndex: $xeTable.getVMRowIndex(parentRow),
|
|
6694
6708
|
$table: $xeTable,
|
|
6695
|
-
$grid: $xeGrid
|
|
6709
|
+
$grid: $xeGrid,
|
|
6710
|
+
$gantt: $xeGantt
|
|
6696
6711
|
}
|
|
6697
6712
|
$xeTable.setTreeExpand(parentRow, false)
|
|
6698
6713
|
.then(() => $xeTable.scrollToRow(parentRow))
|
|
@@ -6713,7 +6728,8 @@ const Methods = {
|
|
|
6713
6728
|
column: selected.column,
|
|
6714
6729
|
columnIndex: $xeTable.getColumnIndex(selected.column),
|
|
6715
6730
|
$table: $xeTable,
|
|
6716
|
-
$grid: $xeGrid
|
|
6731
|
+
$grid: $xeGrid,
|
|
6732
|
+
$gantt: $xeGantt
|
|
6717
6733
|
}
|
|
6718
6734
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
6719
6735
|
if (editMethod) {
|
|
@@ -11097,7 +11113,8 @@ const Methods = {
|
|
|
11097
11113
|
const props = $xeTable
|
|
11098
11114
|
const reactData = $xeTable as unknown as TableReactData
|
|
11099
11115
|
const internalData = $xeTable as unknown as TableInternalData
|
|
11100
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
11116
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
11117
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
11101
11118
|
|
|
11102
11119
|
const { showFooter, footerData, footerMethod } = props
|
|
11103
11120
|
const { visibleColumn, afterFullData } = internalData
|
|
@@ -11105,7 +11122,7 @@ const Methods = {
|
|
|
11105
11122
|
if (showFooter && footerData && footerData.length) {
|
|
11106
11123
|
footData = footerData.slice(0)
|
|
11107
11124
|
} else if (showFooter && footerMethod) {
|
|
11108
|
-
footData = visibleColumn.length ? footerMethod({ columns: visibleColumn, data: afterFullData, $table: $xeTable, $grid: $xeGrid }) : []
|
|
11125
|
+
footData = visibleColumn.length ? footerMethod({ columns: visibleColumn, data: afterFullData, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : []
|
|
11109
11126
|
}
|
|
11110
11127
|
reactData.footerTableData = footData
|
|
11111
11128
|
$xeTable.handleUpdateFooterMerge()
|
|
@@ -11274,16 +11291,18 @@ const Methods = {
|
|
|
11274
11291
|
},
|
|
11275
11292
|
dispatchEvent (type: ValueOf<VxeTableEmits>, params: Record<string, any>, evnt: Event | null) {
|
|
11276
11293
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11277
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
11294
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
11295
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
11278
11296
|
|
|
11279
|
-
$xeTable.$emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid }, params))
|
|
11297
|
+
$xeTable.$emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }, params))
|
|
11280
11298
|
},
|
|
11281
11299
|
// 已废弃,使用 dispatchEvent
|
|
11282
11300
|
emitEvent (type: any, params: any, evnt: any) {
|
|
11283
11301
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11284
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
11302
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
11303
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
11285
11304
|
|
|
11286
|
-
|
|
11305
|
+
$xeTable.$emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt }))
|
|
11287
11306
|
},
|
|
11288
11307
|
focus () {
|
|
11289
11308
|
this.isActivated = true
|