vxe-gantt 4.0.7 → 4.0.8
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/gantt/src/gantt-view.js +33 -13
- package/es/gantt/src/gantt.js +0 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-view.js +43 -13
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +0 -3
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +45 -18
- package/lib/index.umd.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/gantt/src/gantt-view.ts +31 -13
- package/packages/gantt/src/gantt.ts +0 -3
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="gantt v4.0.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="gantt v4.0.8",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-gantt",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "A vue based gantt component",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"typescript": "~4.9.5",
|
|
64
64
|
"vue": "3.4.27",
|
|
65
65
|
"vue-router": "~4.5.1",
|
|
66
|
-
"vxe-pc-ui": "^4.
|
|
66
|
+
"vxe-pc-ui": "^4.9.0",
|
|
67
67
|
"vxe-table": "^4.16.0"
|
|
68
68
|
},
|
|
69
69
|
"vetur": {
|
|
@@ -132,12 +132,9 @@ export default defineVxeComponent({
|
|
|
132
132
|
const { treeConfig } = ganttProps
|
|
133
133
|
const { taskScaleList } = ganttReactData
|
|
134
134
|
const { minViewDate, maxViewDate } = reactData
|
|
135
|
-
const { scrollXStore } = internalData
|
|
136
135
|
const minScale = XEUtils.last(taskScaleList)
|
|
137
136
|
const fullCols: VxeGanttDefines.ViewColumn[] = []
|
|
138
137
|
const groupCols: VxeGanttDefines.GroupColumn[] = []
|
|
139
|
-
scrollXStore.startIndex = 0
|
|
140
|
-
scrollXStore.endIndex = 1
|
|
141
138
|
if (minScale && minViewDate && maxViewDate) {
|
|
142
139
|
const minSType = minScale.type
|
|
143
140
|
const weekScale = taskScaleList.find(item => item.type === 'week')
|
|
@@ -344,9 +341,12 @@ export default defineVxeComponent({
|
|
|
344
341
|
if ($xeTable) {
|
|
345
342
|
const startField = computeStartField.value
|
|
346
343
|
const endField = computeEndField.value
|
|
347
|
-
const { computeTreeOpts } = $xeTable.getComputeMaps()
|
|
344
|
+
const { computeAggregateOpts, computeTreeOpts } = $xeTable.getComputeMaps()
|
|
345
|
+
const tableReactData = $xeTable.reactData
|
|
346
|
+
const { isRowGroupStatus } = tableReactData
|
|
348
347
|
const tableInternalData = $xeTable.internalData
|
|
349
|
-
const { afterFullData, afterTreeFullData } = tableInternalData
|
|
348
|
+
const { afterFullData, afterTreeFullData, afterGroupFullData } = tableInternalData
|
|
349
|
+
const aggregateOpts = computeAggregateOpts.value
|
|
350
350
|
const treeOpts = computeTreeOpts.value
|
|
351
351
|
const { transform } = treeOpts
|
|
352
352
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -370,7 +370,14 @@ export default defineVxeComponent({
|
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
-
if (
|
|
373
|
+
if (isRowGroupStatus) {
|
|
374
|
+
// 行分组
|
|
375
|
+
const mapChildrenField = aggregateOpts.mapChildrenField
|
|
376
|
+
if (mapChildrenField) {
|
|
377
|
+
XEUtils.eachTree(afterGroupFullData, handleParseRender, { children: mapChildrenField })
|
|
378
|
+
}
|
|
379
|
+
} else if (treeConfig) {
|
|
380
|
+
// 树结构
|
|
374
381
|
XEUtils.eachTree(afterTreeFullData, handleParseRender, { children: transform ? treeOpts.mapChildrenField : childrenField })
|
|
375
382
|
} else {
|
|
376
383
|
afterFullData.forEach(handleParseRender)
|
|
@@ -387,6 +394,7 @@ export default defineVxeComponent({
|
|
|
387
394
|
const handleUpdateData = () => {
|
|
388
395
|
const ganttProps = $xeGantt.props
|
|
389
396
|
const { treeConfig } = ganttProps
|
|
397
|
+
const { scrollXStore } = internalData
|
|
390
398
|
const $xeTable = internalData.xeTable
|
|
391
399
|
const sdMaps: Record<string, any> = {}
|
|
392
400
|
const edMaps: Record<string, any> = {}
|
|
@@ -395,9 +403,12 @@ export default defineVxeComponent({
|
|
|
395
403
|
if ($xeTable) {
|
|
396
404
|
const startField = computeStartField.value
|
|
397
405
|
const endField = computeEndField.value
|
|
398
|
-
const { computeTreeOpts } = $xeTable.getComputeMaps()
|
|
406
|
+
const { computeAggregateOpts, computeTreeOpts } = $xeTable.getComputeMaps()
|
|
407
|
+
const tableReactData = $xeTable.reactData
|
|
408
|
+
const { isRowGroupStatus } = tableReactData
|
|
399
409
|
const tableInternalData = $xeTable.internalData
|
|
400
|
-
const { afterFullData, afterTreeFullData } = tableInternalData
|
|
410
|
+
const { afterFullData, afterTreeFullData, afterGroupFullData } = tableInternalData
|
|
411
|
+
const aggregateOpts = computeAggregateOpts.value
|
|
401
412
|
const treeOpts = computeTreeOpts.value
|
|
402
413
|
const { transform } = treeOpts
|
|
403
414
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -417,12 +428,21 @@ export default defineVxeComponent({
|
|
|
417
428
|
}
|
|
418
429
|
}
|
|
419
430
|
|
|
420
|
-
if (
|
|
431
|
+
if (isRowGroupStatus) {
|
|
432
|
+
// 行分组
|
|
433
|
+
const mapChildrenField = aggregateOpts.mapChildrenField
|
|
434
|
+
if (mapChildrenField) {
|
|
435
|
+
XEUtils.eachTree(afterGroupFullData, handleMinMaxData, { children: mapChildrenField })
|
|
436
|
+
}
|
|
437
|
+
} else if (treeConfig) {
|
|
438
|
+
// 树结构
|
|
421
439
|
XEUtils.eachTree(afterTreeFullData, handleMinMaxData, { children: transform ? treeOpts.mapChildrenField : childrenField })
|
|
422
440
|
} else {
|
|
423
441
|
afterFullData.forEach(handleMinMaxData)
|
|
424
442
|
}
|
|
425
443
|
}
|
|
444
|
+
scrollXStore.startIndex = 0
|
|
445
|
+
scrollXStore.endIndex = Math.max(1, scrollXStore.visibleSize)
|
|
426
446
|
reactData.minViewDate = minDate
|
|
427
447
|
reactData.maxViewDate = maxDate
|
|
428
448
|
internalData.startMaps = sdMaps
|
|
@@ -467,10 +487,8 @@ export default defineVxeComponent({
|
|
|
467
487
|
}
|
|
468
488
|
const rowid = rowEl.getAttribute('rowid')
|
|
469
489
|
const rowRest = rowid ? chartMaps[rowid] : null
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
barEl.style.width = `${viewCellWidth * rowRest.oWidthSize}px`
|
|
473
|
-
}
|
|
490
|
+
barEl.style.left = `${rowRest ? viewCellWidth * rowRest.oLeftSize : 0}px`
|
|
491
|
+
barEl.style.width = `${rowRest ? viewCellWidth * rowRest.oWidthSize : 0}px`
|
|
474
492
|
})
|
|
475
493
|
}
|
|
476
494
|
return nextTick()
|
|
@@ -2085,9 +2085,6 @@ export default defineVxeComponent({
|
|
|
2085
2085
|
if (props.expandConfig) {
|
|
2086
2086
|
warnLog('vxe.error.notProp', ['expand-config'])
|
|
2087
2087
|
}
|
|
2088
|
-
if (props.aggregateConfig) {
|
|
2089
|
-
warnLog('vxe.error.notProp', ['aggregate-config'])
|
|
2090
|
-
}
|
|
2091
2088
|
|
|
2092
2089
|
if (columns && columns.length) {
|
|
2093
2090
|
$xeGantt.loadColumn(columns)
|