vxe-gantt 4.1.9 → 4.1.10
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.js +14 -42
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt.js +16 -62
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +26 -72
- 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 +3 -3
- package/packages/gantt/src/gantt.ts +15 -45
|
@@ -5,7 +5,6 @@ import { getLastZIndex, nextZIndex, isEnableConf, formatText } from '../../ui/sr
|
|
|
5
5
|
import { getOffsetHeight, getPaddingTopBottomSize, getDomNode, toCssUnit, addClass, removeClass } from '../../ui/src/dom'
|
|
6
6
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
7
7
|
import { VxeUI } from '@vxe-ui/core'
|
|
8
|
-
import { getTaskLinkKey } from './util'
|
|
9
8
|
import { ganttEmits } from './emits'
|
|
10
9
|
import { tableEmits } from './table-emits'
|
|
11
10
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
@@ -67,6 +66,7 @@ export default defineVxeComponent({
|
|
|
67
66
|
seqConfig: PropType<VxeTablePropTypes.SeqConfig>
|
|
68
67
|
editConfig: PropType<VxeTablePropTypes.EditConfig>
|
|
69
68
|
sortConfig: PropType<VxeTablePropTypes.SortConfig>
|
|
69
|
+
treeConfig: PropType<VxeTablePropTypes.TreeConfig>
|
|
70
70
|
filterConfig: PropType<VxeTablePropTypes.FilterConfig>
|
|
71
71
|
expandConfig: PropType<VxeTablePropTypes.ExpandConfig>
|
|
72
72
|
aggregateConfig: PropType<VxeTablePropTypes.AggregateConfig>
|
|
@@ -933,45 +933,6 @@ export default defineVxeComponent({
|
|
|
933
933
|
reactData.showRightView = !reactData.showRightView
|
|
934
934
|
}
|
|
935
935
|
|
|
936
|
-
const handleTableLinks = () => {
|
|
937
|
-
const { linkList } = reactData
|
|
938
|
-
reactData.tableLinks = linkList.slice(0)
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
const handleTaskAddLink = (item: VxeGanttPropTypes.Link, linkConfs: VxeGanttDefines.LinkConfObj[], fromConfMaps: Record<string, VxeGanttDefines.LinkConfObj[]>, fromKeyMaps: Record<string, VxeGanttDefines.LinkConfObj>, uniqueMaps: Record<string, VxeGanttDefines.LinkConfObj>) => {
|
|
942
|
-
if (item) {
|
|
943
|
-
const { type, from, to, lineStatus, lineColor, lineType, lineWidth, showArrow } = item
|
|
944
|
-
const tlKey = getTaskLinkKey(from, to)
|
|
945
|
-
if (from && to && !uniqueMaps[tlKey]) {
|
|
946
|
-
let confs = fromConfMaps[from]
|
|
947
|
-
if (!confs) {
|
|
948
|
-
confs = fromConfMaps[from] = []
|
|
949
|
-
}
|
|
950
|
-
const confObj: VxeGanttDefines.LinkConfObj = { type, from, to, lineStatus, lineColor, lineType, lineWidth, showArrow }
|
|
951
|
-
confs.push(confObj)
|
|
952
|
-
linkConfs.push(confObj)
|
|
953
|
-
fromKeyMaps[from] = confObj
|
|
954
|
-
uniqueMaps[tlKey] = confObj
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
const handleTaskUpdateLinks = (links: VxeGanttPropTypes.Links) => {
|
|
960
|
-
const linkConfs: VxeGanttDefines.LinkConfObj[] = []
|
|
961
|
-
const fromConfMaps: Record<string, VxeGanttDefines.LinkConfObj[]> = {}
|
|
962
|
-
const fromKeyMaps: Record<string, VxeGanttDefines.LinkConfObj> = {}
|
|
963
|
-
const uniqueMaps: Record<string, VxeGanttDefines.LinkConfObj> = {}
|
|
964
|
-
XEUtils.each(links || [], item => {
|
|
965
|
-
handleTaskAddLink(item, linkConfs, fromConfMaps, fromKeyMaps, uniqueMaps)
|
|
966
|
-
})
|
|
967
|
-
reactData.linkList = linkConfs
|
|
968
|
-
internalData.linkFromConfMaps = fromConfMaps
|
|
969
|
-
internalData.linkFromKeyMaps = fromKeyMaps
|
|
970
|
-
internalData.linkUniqueMaps = uniqueMaps
|
|
971
|
-
$xeGantt.handleTableLinks()
|
|
972
|
-
return nextTick()
|
|
973
|
-
}
|
|
974
|
-
|
|
975
936
|
const tableCompEvents: VxeTableEventProps = {}
|
|
976
937
|
tableEmits.forEach(name => {
|
|
977
938
|
const type = XEUtils.camelCase(`on-${name}`) as keyof VxeTableEventProps
|
|
@@ -1852,9 +1813,6 @@ export default defineVxeComponent({
|
|
|
1852
1813
|
$xeGantt.closeTaskBarTooltip()
|
|
1853
1814
|
}
|
|
1854
1815
|
},
|
|
1855
|
-
handleTableLinks,
|
|
1856
|
-
handleTaskAddLink,
|
|
1857
|
-
handleTaskUpdateLinks,
|
|
1858
1816
|
handleTaskHeaderContextmenuEvent (evnt, params) {
|
|
1859
1817
|
const $xeTable = refTable.value
|
|
1860
1818
|
if ($xeTable) {
|
|
@@ -2466,8 +2424,10 @@ export default defineVxeComponent({
|
|
|
2466
2424
|
}
|
|
2467
2425
|
})
|
|
2468
2426
|
|
|
2469
|
-
if (
|
|
2470
|
-
|
|
2427
|
+
if ($xeGantt.handleTaskUpdateLinks) {
|
|
2428
|
+
if (props.links) {
|
|
2429
|
+
$xeGantt.handleTaskUpdateLinks(props.links)
|
|
2430
|
+
}
|
|
2471
2431
|
}
|
|
2472
2432
|
handleTaskScaleConfig()
|
|
2473
2433
|
initPages()
|
|
@@ -2495,6 +2455,16 @@ export default defineVxeComponent({
|
|
|
2495
2455
|
errLog('vxe.error.reqComp', ['vxe-pager'])
|
|
2496
2456
|
}
|
|
2497
2457
|
}
|
|
2458
|
+
if (props.treeConfig && props.links) {
|
|
2459
|
+
const $xeTable = refTable.value
|
|
2460
|
+
if ($xeTable) {
|
|
2461
|
+
const { computeTreeOpts } = $xeTable.getComputeMaps()
|
|
2462
|
+
const treeOpts = computeTreeOpts.value
|
|
2463
|
+
if (!treeOpts.transform) {
|
|
2464
|
+
errLog('vxe.error.notSupportProp', ['links', 'tree-config.transform=false', 'tree-config.transform=true'])
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2498
2468
|
|
|
2499
2469
|
// const { data, columns, proxyConfig } = props
|
|
2500
2470
|
// const formOpts = computeFormOpts.value
|