vxe-gantt 3.0.0-beta.3 → 3.0.0-beta.4
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 +63 -62
- package/es/gantt/src/gantt.js +7 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-view.js +63 -62
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +7 -5
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +72 -69
- 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 +1 -1
- package/packages/gantt/src/gantt-view.ts +71 -69
- package/packages/gantt/src/gantt.ts +11 -5
package/lib/ui/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var _log = require("./src/log");
|
|
|
15
15
|
var setConfig = _core.VxeUI.setConfig,
|
|
16
16
|
setIcon = _core.VxeUI.setIcon,
|
|
17
17
|
checkVersion = _core.VxeUI.checkVersion;
|
|
18
|
-
_core.VxeUI.ganttVersion = "3.0.0-beta.
|
|
18
|
+
_core.VxeUI.ganttVersion = "3.0.0-beta.4";
|
|
19
19
|
setConfig({
|
|
20
20
|
gantt: {
|
|
21
21
|
// size: null,
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.default=void 0;var _core=require("@vxe-ui/core"),_log=require("./src/log"),setConfig=_core.VxeUI.setConfig,setIcon=_core.VxeUI.setIcon,checkVersion=_core.VxeUI.checkVersion,iconPrefix=(_core.VxeUI.ganttVersion="3.0.0-beta.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.default=void 0;var _core=require("@vxe-ui/core"),_log=require("./src/log"),setConfig=_core.VxeUI.setConfig,setIcon=_core.VxeUI.setIcon,checkVersion=_core.VxeUI.checkVersion,iconPrefix=(_core.VxeUI.ganttVersion="3.0.0-beta.4",setConfig({gantt:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showLoading:!0,showResponseMsg:!0,showActionMsg:!0,response:{list:null,result:"result",total:"page.total",message:"message"}},taskSplitConfig:{enabled:!0,resize:!0,showCollapseTableButton:!0,showCollapseTaskButton:!0}}}),"vxe-icon-"),_default=(setIcon({GANTT_VIEW_LEFT_OPEN:iconPrefix+"arrow-left",GANTT_VIEW_LEFT_CLOSE:iconPrefix+"arrow-right",GANTT_VIEW_RIGHT_OPEN:iconPrefix+"arrow-right",GANTT_VIEW_RIGHT_CLOSE:iconPrefix+"arrow-left"}),checkVersion(_core.VxeUI.tableVersion,3,18)||(0,_log.errLog)("vxe.error.errorVersion",["vxe-table@".concat(_core.VxeUI.tableVersion||"?"),"vxe-table v3.18+"]),exports.default=_core.VxeUI);
|
package/lib/ui/src/log.js
CHANGED
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.warnLog = exports.errLog = void 0;
|
|
7
7
|
var _core = require("@vxe-ui/core");
|
|
8
8
|
var log = _core.VxeUI.log;
|
|
9
|
-
var version = "gantt v".concat("3.0.0-beta.
|
|
9
|
+
var version = "gantt v".concat("3.0.0-beta.4");
|
|
10
10
|
var warnLog = exports.warnLog = log.create('warn', version);
|
|
11
11
|
var errLog = exports.errLog = log.create('error', version);
|
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"),log=_core.VxeUI.log,version="gantt v".concat("3.0.0-beta.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),log=_core.VxeUI.log,version="gantt v".concat("3.0.0-beta.4"),warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -42,7 +42,7 @@ function createInternalData (): GanttViewInternalData {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
const maxYHeight = 5e6
|
|
45
|
-
const maxXWidth = 5e6
|
|
45
|
+
// const maxXWidth = 5e6
|
|
46
46
|
|
|
47
47
|
function handleParseColumn ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
48
48
|
const $xeGantt = $xeGanttView.$xeGantt
|
|
@@ -361,61 +361,61 @@ function handleLazyRecalculate ($xeGanttView: VxeGanttViewConstructor & VxeGantt
|
|
|
361
361
|
return $xeGanttView.$nextTick()
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
function updateScrollXSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
364
|
+
// function updateScrollXSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
365
|
+
// const reactData = $xeGanttView.reactData
|
|
366
|
+
// const internalData = $xeGanttView.internalData
|
|
367
|
+
|
|
368
|
+
// const { scrollXLoad, scrollXWidth } = reactData
|
|
369
|
+
// const { elemStore } = internalData
|
|
370
|
+
// const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
371
|
+
// const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
372
|
+
|
|
373
|
+
// let xSpaceLeft = 0
|
|
374
|
+
|
|
375
|
+
// let clientWidth = 0
|
|
376
|
+
// if (bodyScrollElem) {
|
|
377
|
+
// clientWidth = bodyScrollElem.clientWidth
|
|
378
|
+
// }
|
|
379
|
+
// // 虚拟渲染
|
|
380
|
+
// let isScrollXBig = false
|
|
381
|
+
// let ySpaceWidth = scrollXWidth
|
|
382
|
+
// if (scrollXWidth > maxXWidth) {
|
|
383
|
+
// // 触右
|
|
384
|
+
// if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollLeft + clientWidth >= maxXWidth) {
|
|
385
|
+
// xSpaceLeft = maxXWidth - bodyTableElem.clientWidth
|
|
386
|
+
// } else {
|
|
387
|
+
// xSpaceLeft = (maxXWidth - clientWidth) * (xSpaceLeft / (scrollXWidth - clientWidth))
|
|
388
|
+
// }
|
|
389
|
+
// ySpaceWidth = maxXWidth
|
|
390
|
+
// isScrollXBig = true
|
|
391
|
+
// }
|
|
392
|
+
|
|
393
|
+
// if (bodyTableElem) {
|
|
394
|
+
// bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`
|
|
395
|
+
// }
|
|
396
|
+
|
|
397
|
+
// const layoutList = ['header', 'body', 'footer']
|
|
398
|
+
// layoutList.forEach(layout => {
|
|
399
|
+
// const xSpaceElem = getRefElem(elemStore[`main-${layout}-xSpace`])
|
|
400
|
+
// if (xSpaceElem) {
|
|
401
|
+
// xSpaceElem.style.width = scrollXLoad ? `${ySpaceWidth}px` : ''
|
|
402
|
+
// }
|
|
403
|
+
// })
|
|
404
|
+
|
|
405
|
+
// reactData.scrollXLeft = xSpaceLeft
|
|
406
|
+
// reactData.scrollXWidth = ySpaceWidth
|
|
407
|
+
// reactData.isScrollXBig = isScrollXBig
|
|
408
|
+
|
|
409
|
+
// const scrollXSpaceEl = $xeGanttView.$refs.refScrollXSpaceElem as HTMLDivElement
|
|
410
|
+
// if (scrollXSpaceEl) {
|
|
411
|
+
// scrollXSpaceEl.style.width = `${ySpaceWidth}px`
|
|
412
|
+
// }
|
|
413
|
+
|
|
414
|
+
// calcScrollbar($xeGanttView)
|
|
415
|
+
// return $xeGanttView.$nextTick().then(() => {
|
|
416
|
+
// updateStyle($xeGanttView)
|
|
417
|
+
// })
|
|
418
|
+
// }
|
|
419
419
|
|
|
420
420
|
function updateScrollYSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttViewPrivateMethods) {
|
|
421
421
|
const reactData = $xeGanttView.reactData
|
|
@@ -457,17 +457,18 @@ function updateScrollYSpace ($xeGanttView: VxeGanttViewConstructor & VxeGanttVie
|
|
|
457
457
|
scrollYTop = 0
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
+
const bodyChartWrapperElem = getRefElem(elemStore['main-chart-wrapper'])
|
|
460
461
|
if (bodyTableElem) {
|
|
461
462
|
bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`
|
|
462
463
|
}
|
|
464
|
+
if (bodyChartWrapperElem) {
|
|
465
|
+
bodyChartWrapperElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`
|
|
466
|
+
}
|
|
463
467
|
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
ySpaceElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
469
|
-
}
|
|
470
|
-
})
|
|
468
|
+
const bodyYSpaceElem = getRefElem(elemStore['main-body-ySpace'])
|
|
469
|
+
if (bodyYSpaceElem) {
|
|
470
|
+
bodyYSpaceElem.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
471
|
+
}
|
|
471
472
|
|
|
472
473
|
const scrollYSpaceEl = $xeGanttView.$refs.refScrollYSpaceElem as HTMLDivElement
|
|
473
474
|
if (scrollYSpaceEl) {
|
|
@@ -552,9 +553,9 @@ export default defineVxeComponent({
|
|
|
552
553
|
// 是否启用了纵向 Y 可视渲染方式加载
|
|
553
554
|
scrollYLoad: false,
|
|
554
555
|
// 是否存在纵向滚动条
|
|
555
|
-
overflowY:
|
|
556
|
+
overflowY: true,
|
|
556
557
|
// 是否存在横向滚动条
|
|
557
|
-
overflowX:
|
|
558
|
+
overflowX: true,
|
|
558
559
|
// 纵向滚动条的宽度
|
|
559
560
|
scrollbarWidth: 0,
|
|
560
561
|
// 横向滚动条的高度
|
|
@@ -789,15 +790,16 @@ export default defineVxeComponent({
|
|
|
789
790
|
handleScrollEvent($xeGanttView, evnt, isRollY, isRollX, currTopNum, wrapperEl.scrollLeft)
|
|
790
791
|
}
|
|
791
792
|
},
|
|
792
|
-
|
|
793
|
+
updateScrollYSpace () {
|
|
793
794
|
const $xeGanttView = this
|
|
794
795
|
|
|
795
|
-
return
|
|
796
|
+
return updateScrollYSpace($xeGanttView)
|
|
796
797
|
},
|
|
797
|
-
|
|
798
|
+
updateScrollYStatus (sYLoad: boolean) {
|
|
798
799
|
const $xeGanttView = this
|
|
800
|
+
const reactData = $xeGanttView.reactData
|
|
799
801
|
|
|
800
|
-
|
|
802
|
+
reactData.scrollYLoad = sYLoad
|
|
801
803
|
},
|
|
802
804
|
handleGlobalResizeEvent () {
|
|
803
805
|
const $xeGanttView = this
|
|
@@ -11,7 +11,7 @@ import { VxeTable as VxeTableComponent } from 'vxe-table'
|
|
|
11
11
|
|
|
12
12
|
import type { ValueOf, VxeFormInstance, VxeFormItemProps, VxePagerInstance, VxePagerDefines, VxeComponentStyleType, VxeComponentSizeType, VxeFormDefines, VxeFormItemPropTypes } from 'vxe-pc-ui'
|
|
13
13
|
import type { VxeTableMethods, VxeToolbarPropTypes, VxeTableProps, VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, VxeToolbarInstance, TableInternalData, VxeTablePropTypes, VxeGridPropTypes } from 'vxe-table'
|
|
14
|
-
import type { VxeGanttEmits, GanttReactData, GanttInternalData, VxeGanttPropTypes, VxeGanttViewInstance, VxeGanttDefines } from '../../../types'
|
|
14
|
+
import type { VxeGanttEmits, GanttReactData, GanttInternalData, VxeGanttPropTypes, VxeGanttViewInstance, VxeGanttDefines, VxeGanttConstructor } from '../../../types'
|
|
15
15
|
|
|
16
16
|
const { getConfig, getIcon, getI18n, commands, globalMixins, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI
|
|
17
17
|
|
|
@@ -22,12 +22,18 @@ const propKeys = Object.keys(tableProps) as (keyof VxeTableProps)[]
|
|
|
22
22
|
|
|
23
23
|
const defaultLayouts: VxeGanttPropTypes.Layouts = [['Form'], ['Toolbar', 'Top', 'Gantt', 'Bottom', 'Pager']]
|
|
24
24
|
|
|
25
|
-
function getTableOns (
|
|
26
|
-
const
|
|
25
|
+
function getTableOns ($xeGantt: VxeGanttConstructor) {
|
|
26
|
+
const _vm = $xeGantt as any
|
|
27
|
+
const $listeners = _vm.$listeners
|
|
28
|
+
|
|
29
|
+
const props = $xeGantt
|
|
30
|
+
|
|
31
|
+
const { proxyConfig } = props
|
|
32
|
+
const proxyOpts = $xeGantt.computeProxyOpts
|
|
27
33
|
const ons: any = {}
|
|
28
34
|
XEUtils.each($listeners, (cb: any, type: any) => {
|
|
29
35
|
ons[type] = (...args: any[]) => {
|
|
30
|
-
|
|
36
|
+
$xeGantt.$emit(type, ...args)
|
|
31
37
|
}
|
|
32
38
|
})
|
|
33
39
|
if (proxyConfig) {
|
|
@@ -1797,7 +1803,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1797
1803
|
h(VxeTableComponent as Component, {
|
|
1798
1804
|
key: 'table',
|
|
1799
1805
|
props: tableProps,
|
|
1800
|
-
on: getTableOns($xeGantt),
|
|
1806
|
+
on: getTableOns($xeGantt as VxeGanttConstructor),
|
|
1801
1807
|
scopedSlots: slots,
|
|
1802
1808
|
ref: 'refTable'
|
|
1803
1809
|
})
|