vxe-gantt 3.6.7 → 3.6.9

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/lib/ui/index.js CHANGED
@@ -13,7 +13,7 @@ exports.default = void 0;
13
13
  var _core = require("@vxe-ui/core");
14
14
  var setConfig = _core.VxeUI.setConfig,
15
15
  setIcon = _core.VxeUI.setIcon;
16
- _core.VxeUI.ganttVersion = "3.6.7";
16
+ _core.VxeUI.ganttVersion = "3.6.9";
17
17
  var ymdFormat = 'yyyy-MM-dd';
18
18
  var ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
19
19
  setConfig({
@@ -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"),setConfig=_core.VxeUI.setConfig,setIcon=_core.VxeUI.setIcon,ymdFormat=(_core.VxeUI.ganttVersion="3.6.7","yyyy-MM-dd"),ymdhmsFormat="yyyy-MM-dd HH:mm:ss",iconPrefix=(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"}},taskBarTooltipConfig:{enterable:!0},taskLinkConfig:{enabled:!0,isHover:!0,showArrow:!0},taskViewScaleConfig:{year:{valueFormat:ymdFormat},quarter:{valueFormat:ymdFormat},month:{valueFormat:ymdFormat},week:{startDay:1,valueFormat:ymdFormat},day:{valueFormat:ymdFormat},date:{valueFormat:ymdFormat},hour:{valueFormat:ymdhmsFormat},minute:{valueFormat:ymdhmsFormat},second:{valueFormat:ymdhmsFormat}},taskViewConfig:{showNowLine:!0,gridding:{leftSpacing:1,rightSpacing:1}},taskSplitConfig:{enabled:!0,resize:!0,autoHideCollapseButton:!0,showCollapseTableButton:!0,showCollapseTaskButton:!0},taskBarSubviewConfig:{}}}),"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",GANTT_VIEW_TASK_MILESTONE:iconPrefix+"square-fill rotate45"}),exports.default=_core.VxeUI);
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"),setConfig=_core.VxeUI.setConfig,setIcon=_core.VxeUI.setIcon,ymdFormat=(_core.VxeUI.ganttVersion="3.6.9","yyyy-MM-dd"),ymdhmsFormat="yyyy-MM-dd HH:mm:ss",iconPrefix=(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"}},taskBarTooltipConfig:{enterable:!0},taskLinkConfig:{enabled:!0,isHover:!0,showArrow:!0},taskViewScaleConfig:{year:{valueFormat:ymdFormat},quarter:{valueFormat:ymdFormat},month:{valueFormat:ymdFormat},week:{startDay:1,valueFormat:ymdFormat},day:{valueFormat:ymdFormat},date:{valueFormat:ymdFormat},hour:{valueFormat:ymdhmsFormat},minute:{valueFormat:ymdhmsFormat},second:{valueFormat:ymdhmsFormat}},taskViewConfig:{showNowLine:!0,gridding:{leftSpacing:1,rightSpacing:1}},taskSplitConfig:{enabled:!0,resize:!0,autoHideCollapseButton:!0,showCollapseTableButton:!0,showCollapseTaskButton:!0},taskBarSubviewConfig:{}}}),"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",GANTT_VIEW_TASK_MILESTONE:iconPrefix+"square-fill rotate45"}),exports.default=_core.VxeUI);
package/lib/ui/src/log.js CHANGED
@@ -7,7 +7,7 @@ exports.createComponentLog = createComponentLog;
7
7
  exports.warnLog = exports.errLog = void 0;
8
8
  var _core = require("@vxe-ui/core");
9
9
  var log = _core.VxeUI.log;
10
- var ganttVersion = "gantt v".concat("3.6.7");
10
+ var ganttVersion = "gantt v".concat("3.6.9");
11
11
  function createComponentLog(name) {
12
12
  var uiVersion = _core.VxeUI.uiVersion ? "ui v".concat(_core.VxeUI.uiVersion) : '';
13
13
  var tableVersion = _core.VxeUI.tableVersion ? "table v".concat(_core.VxeUI.tableVersion) : '';
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.createComponentLog=createComponentLog,exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),log=_core.VxeUI.log,ganttVersion="gantt v".concat("3.6.7");function createComponentLog(e){var r=_core.VxeUI.uiVersion?"ui v".concat(_core.VxeUI.uiVersion):"",o=_core.VxeUI.tableVersion?"table v".concat(_core.VxeUI.tableVersion):"",n=_core.VxeUI.designVersion?"design v".concat(_core.VxeUI.designVersion):"",r=[r,o,ganttVersion,n].filter(function(e){return e}).join(" ");return{warnLog:log.create("warn",r+"] ["+e),errLog:log.create("error",r+"] ["+e)}}var warnLog=exports.warnLog=log.create("warn",ganttVersion),errLog=exports.errLog=log.create("error",ganttVersion);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.createComponentLog=createComponentLog,exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core"),log=_core.VxeUI.log,ganttVersion="gantt v".concat("3.6.9");function createComponentLog(e){var r=_core.VxeUI.uiVersion?"ui v".concat(_core.VxeUI.uiVersion):"",o=_core.VxeUI.tableVersion?"table v".concat(_core.VxeUI.tableVersion):"",n=_core.VxeUI.designVersion?"design v".concat(_core.VxeUI.designVersion):"",r=[r,o,ganttVersion,n].filter(function(e){return e}).join(" ");return{warnLog:log.create("warn",r+"] ["+e),errLog:log.create("error",r+"] ["+e)}}var warnLog=exports.warnLog=log.create("warn",ganttVersion),errLog=exports.errLog=log.create("error",ganttVersion);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-gantt",
3
- "version": "3.6.7",
3
+ "version": "3.6.9",
4
4
  "description": "A vue based gantt component",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -61,7 +61,7 @@
61
61
  "vue-i18n": "^8.15.1",
62
62
  "vue-router": "^3.5.1",
63
63
  "vxe-pc-ui": "3.16.28",
64
- "vxe-table": "3.22.11"
64
+ "vxe-table": "3.22.12"
65
65
  },
66
66
  "vetur": {
67
67
  "tags": "helper/vetur/tags.json",
@@ -2,7 +2,7 @@ import { VNode, CreateElement } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import { VxeUI } from '@vxe-ui/core'
4
4
  import { setScrollTop, setScrollLeft, removeClass, addClass, hasClass } from '../../ui/src/dom'
5
- import { getRefElem, getStandardGapTime, getTaskBarLeft, getTaskBarWidth, hasMilestoneTask, getTaskType, hasSubviewTask } from './util'
5
+ import { getRefElem, getTaskBarLeft, getTaskBarWidth, hasMilestoneTask, getTaskType, hasSubviewTask } from './util'
6
6
  import XEUtils from 'xe-utils'
7
7
  import GanttViewHeaderComponent from './gantt-header'
8
8
  import GanttViewBodyComponent from './gantt-body'
@@ -380,7 +380,7 @@ function createChartRender ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
380
380
  let currStep = scaleStep - 1
381
381
  while (currStep) {
382
382
  const currStr = XEUtils.toDateString(XEUtils.getWhatYear(dateObj.date, scaleStep - currStep), renderFormat)
383
- indexMaps[currStr] = i + currRatio
383
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio)
384
384
  currStep--
385
385
  }
386
386
  }
@@ -426,7 +426,7 @@ function createChartRender ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
426
426
  let currStep = scaleStep - 1
427
427
  while (currStep) {
428
428
  const currStr = XEUtils.toDateString(XEUtils.getWhatQuarter(dateObj.date, scaleStep - currStep), renderFormat)
429
- indexMaps[currStr] = i + currRatio
429
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio)
430
430
  currStep--
431
431
  }
432
432
  }
@@ -472,7 +472,7 @@ function createChartRender ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
472
472
  let currStep = scaleStep - 1
473
473
  while (currStep) {
474
474
  const currStr = XEUtils.toDateString(XEUtils.getWhatMonth(dateObj.date, scaleStep - currStep), renderFormat)
475
- indexMaps[currStr] = i + currRatio
475
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio)
476
476
  currStep--
477
477
  }
478
478
  }
@@ -524,7 +524,7 @@ function createChartRender ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
524
524
  yyyy = `${Number(yyyy) + 1}`
525
525
  }
526
526
  const currStr = `${yyyy}-${W}`
527
- indexMaps[currStr] = i + currRatio
527
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio)
528
528
  currStep--
529
529
  }
530
530
  }
@@ -571,7 +571,7 @@ function createChartRender ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
571
571
  let currStep = scaleStep - 1
572
572
  while (currStep) {
573
573
  const currStr = XEUtils.toDateString(XEUtils.getWhatDay(dateObj.date, scaleStep - currStep), renderFormat)
574
- indexMaps[currStr] = i + currRatio
574
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio)
575
575
  currStep--
576
576
  }
577
577
  }
@@ -614,7 +614,7 @@ function createChartRender ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
614
614
  let currStep = scaleStep - 1
615
615
  while (currStep) {
616
616
  const currStr = XEUtils.toDateString(XEUtils.getWhatHours(dateObj.date, scaleStep - currStep), renderFormat)
617
- indexMaps[currStr] = i + currRatio
617
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio)
618
618
  currStep--
619
619
  }
620
620
  }
@@ -657,7 +657,7 @@ function createChartRender ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
657
657
  let currStep = scaleStep - 1
658
658
  while (currStep) {
659
659
  const currStr = XEUtils.toDateString(XEUtils.getWhatMinutes(dateObj.date, scaleStep - currStep), renderFormat)
660
- indexMaps[currStr] = i + currRatio
660
+ indexMaps[currStr] = i + ((scaleStep - currStep) * currRatio)
661
661
  currStep--
662
662
  }
663
663
  }
@@ -700,7 +700,7 @@ function createChartRender ($xeGanttView: VxeGanttViewConstructor & VxeGanttView
700
700
  let currStep = scaleStep - 1
701
701
  while (currStep) {
702
702
  const yyyyMM = XEUtils.toDateString(XEUtils.getWhatSeconds(dateObj.date, scaleStep - currStep), renderFormat)
703
- indexMaps[yyyyMM] = i + currRatio
703
+ indexMaps[yyyyMM] = i + ((scaleStep - currStep) * currRatio)
704
704
  currStep--
705
705
  }
706
706
  }
@@ -1706,16 +1706,33 @@ export default defineVxeComponent({
1706
1706
  }
1707
1707
  break
1708
1708
  }
1709
- case 'hour':
1710
- case 'minute':
1709
+ case 'hour': {
1710
+ let currDate = XEUtils.getWhatHours(minViewDate, leftSize, 'first')
1711
+ const endDate = XEUtils.getWhatHours(maxViewDate, rightSize, 'first')
1712
+ while (currDate <= endDate) {
1713
+ const itemDate = currDate
1714
+ dateList.push(itemDate)
1715
+ currDate = XEUtils.getWhatHours(currDate, scaleStep)
1716
+ }
1717
+ break
1718
+ }
1719
+ case 'minute': {
1720
+ let currDate = XEUtils.getWhatMinutes(minViewDate, leftSize, 'first')
1721
+ const endDate = XEUtils.getWhatMinutes(maxViewDate, rightSize, 'first')
1722
+ while (currDate <= endDate) {
1723
+ const itemDate = currDate
1724
+ dateList.push(itemDate)
1725
+ currDate = XEUtils.getWhatMinutes(currDate, scaleStep)
1726
+ }
1727
+ break
1728
+ }
1711
1729
  case 'second': {
1712
- const gapTime = getStandardGapTime(minScale.type) * scaleStep
1713
- let currTime = minViewDate.getTime() + (leftSize * gapTime)
1714
- const endTime = maxViewDate.getTime() + (rightSize * gapTime)
1715
- while (currTime <= endTime) {
1716
- const itemDate = new Date(currTime)
1730
+ let currDate = XEUtils.getWhatSeconds(minViewDate, leftSize, 'first')
1731
+ const endDate = XEUtils.getWhatSeconds(maxViewDate, rightSize, 'first')
1732
+ while (currDate <= endDate) {
1733
+ const itemDate = currDate
1717
1734
  dateList.push(itemDate)
1718
- currTime += gapTime
1735
+ currDate = XEUtils.getWhatSeconds(currDate, scaleStep)
1719
1736
  }
1720
1737
  break
1721
1738
  }
@@ -12,18 +12,6 @@ export function getCellRestHeight (rowRest: VxeTableDefines.RowCacheItem, cellOp
12
12
  return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
13
13
  }
14
14
 
15
- export function getStandardGapTime (type: VxeGanttDefines.ColumnScaleType) {
16
- switch (type) {
17
- case 'hour':
18
- return 1000 * 60 * 60
19
- case 'minute':
20
- return 1000 * 60
21
- case 'second':
22
- return 1000
23
- }
24
- return 1000 * 60 * 60 * 24
25
- }
26
-
27
15
  export function getTaskBarLeft (chartRest: VxeGanttDefines.RowCacheItem | null, viewCellWidth: number) {
28
16
  return chartRest ? viewCellWidth * chartRest.oLeftSize : 0
29
17
  }