vxe-gantt 3.1.2 → 3.1.3

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
@@ -15,7 +15,9 @@ 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.1.2";
18
+ _core.VxeUI.ganttVersion = "3.1.3";
19
+ var ymdFormat = 'yyyy-MM-dd';
20
+ var ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
19
21
  setConfig({
20
22
  gantt: {
21
23
  // size: null,
@@ -58,8 +60,33 @@ setConfig({
58
60
  enterable: true
59
61
  },
60
62
  taskViewScaleConfig: {
63
+ year: {
64
+ valueFormat: ymdFormat
65
+ },
66
+ quarter: {
67
+ valueFormat: ymdFormat
68
+ },
69
+ month: {
70
+ valueFormat: ymdFormat
71
+ },
61
72
  week: {
62
- startDay: 1
73
+ startDay: 1,
74
+ valueFormat: ymdFormat
75
+ },
76
+ day: {
77
+ valueFormat: ymdFormat
78
+ },
79
+ date: {
80
+ valueFormat: ymdFormat
81
+ },
82
+ hour: {
83
+ valueFormat: ymdhmsFormat
84
+ },
85
+ minute: {
86
+ valueFormat: ymdhmsFormat
87
+ },
88
+ second: {
89
+ valueFormat: ymdhmsFormat
63
90
  }
64
91
  },
65
92
  taskViewConfig: {
@@ -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.1.2",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},taskViewScaleConfig:{week:{startDay:1}},taskViewConfig:{showNowLine:!0},taskSplitConfig:{enabled:!0,resize:!0,showCollapseTableButton:!0,showCollapseTaskButton:!0}}}),"vxe-icon-"),pVersion=(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"}),3),sVersion=18,_default=(checkVersion?checkVersion(_core.VxeUI.tableVersion,pVersion,sVersion)||(0,_log.errLog)("vxe.error.errorVersion",["vxe-table@".concat(_core.VxeUI.tableVersion||"?"),"vxe-table v".concat(pVersion,".").concat(sVersion,"+")]):(0,_log.errLog)("Requires vxe-table v".concat(pVersion,".").concat(sVersion,"+")),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"),_log=require("./src/log"),setConfig=_core.VxeUI.setConfig,setIcon=_core.VxeUI.setIcon,checkVersion=_core.VxeUI.checkVersion,ymdFormat=(_core.VxeUI.ganttVersion="3.1.3","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},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},taskSplitConfig:{enabled:!0,resize:!0,showCollapseTableButton:!0,showCollapseTaskButton:!0}}}),"vxe-icon-"),pVersion=(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"}),3),sVersion=18,_default=(checkVersion?checkVersion(_core.VxeUI.tableVersion,pVersion,sVersion)||(0,_log.errLog)("vxe.error.errorVersion",["vxe-table@".concat(_core.VxeUI.tableVersion||"?"),"vxe-table v".concat(pVersion,".").concat(sVersion,"+")]):(0,_log.errLog)("Requires vxe-table v".concat(pVersion,".").concat(sVersion,"+")),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.1.2");
9
+ var version = "gantt v".concat("3.1.3");
10
10
  var warnLog = exports.warnLog = log.create('warn', version);
11
11
  var errLog = exports.errLog = log.create('error', version);
@@ -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.1.2"),warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
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.1.3"),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": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "A vue based gantt component",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -593,31 +593,24 @@ export default /* define-vxe-component start */ defineVxeComponent({
593
593
  const taskScaleConfs = $xeGantt.computeTaskViewScales
594
594
  const taskViewScaleOpts = $xeGantt.computeTaskViewScaleOpts
595
595
  const scaleConfs: VxeGanttDefines.ColumnScaleObj[] = []
596
- if (taskScaleConfs) {
597
- const keyMaps: Record<string, boolean> = {}
598
- taskScaleConfs.forEach(conf => {
599
- const sConf = !conf || XEUtils.isString(conf) ? { type: conf } : conf
600
- const { type } = sConf
601
- if (!type || !viewTypeLevelMaps[type]) {
602
- errLog('vxe.error.errProp', [`type=${type}`, XEUtils.keys(viewTypeLevelMaps).join(',')])
603
- return
604
- }
605
- if (keyMaps[type]) {
606
- errLog('vxe.error.repeatProp', ['type', type])
607
- return
608
- }
609
- keyMaps[type] = true
610
- scaleConfs.push(Object.assign({}, type ? taskViewScaleOpts[type] || {} : {}, sConf, {
611
- level: getViewTypeLevel(type)
612
- }))
613
- })
614
- }
615
- if (!scaleConfs.length) {
616
- scaleConfs.push(
617
- { type: 'month', level: viewTypeLevelMaps.month },
618
- { type: 'date', level: viewTypeLevelMaps.date }
619
- )
620
- }
596
+ const keyMaps: Record<string, boolean> = {}
597
+ const scaleList = (taskScaleConfs && taskScaleConfs.length ? taskScaleConfs : ['month', 'date'] as VxeGanttDefines.ColumnScaleType[])
598
+ scaleList.forEach(conf => {
599
+ const sConf = !conf || XEUtils.isString(conf) ? { type: conf } : conf
600
+ const { type } = sConf
601
+ if (!type || !viewTypeLevelMaps[type]) {
602
+ errLog('vxe.error.errProp', [`type=${type}`, XEUtils.keys(viewTypeLevelMaps).join(',')])
603
+ return
604
+ }
605
+ if (keyMaps[type]) {
606
+ errLog('vxe.error.repeatProp', ['type', type])
607
+ return
608
+ }
609
+ keyMaps[type] = true
610
+ scaleConfs.push(Object.assign({}, type ? taskViewScaleOpts[type] || {} : {}, sConf, {
611
+ level: getViewTypeLevel(type)
612
+ }))
613
+ })
621
614
  reactData.taskScaleList = XEUtils.orderBy(scaleConfs, { field: 'level', order: 'desc' })
622
615
  },
623
616
  initToolbar () {
@@ -5,6 +5,9 @@ const { setConfig, setIcon, checkVersion } = VxeUI
5
5
 
6
6
  VxeUI.ganttVersion = process.env.VUE_APP_VXE_VERSION as string
7
7
 
8
+ const ymdFormat = 'yyyy-MM-dd'
9
+ const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss'
10
+
8
11
  setConfig({
9
12
  gantt: {
10
13
  // size: null,
@@ -47,8 +50,33 @@ setConfig({
47
50
  enterable: true
48
51
  },
49
52
  taskViewScaleConfig: {
53
+ year: {
54
+ valueFormat: ymdFormat
55
+ },
56
+ quarter: {
57
+ valueFormat: ymdFormat
58
+ },
59
+ month: {
60
+ valueFormat: ymdFormat
61
+ },
50
62
  week: {
51
- startDay: 1
63
+ startDay: 1,
64
+ valueFormat: ymdFormat
65
+ },
66
+ day: {
67
+ valueFormat: ymdFormat
68
+ },
69
+ date: {
70
+ valueFormat: ymdFormat
71
+ },
72
+ hour: {
73
+ valueFormat: ymdhmsFormat
74
+ },
75
+ minute: {
76
+ valueFormat: ymdhmsFormat
77
+ },
78
+ second: {
79
+ valueFormat: ymdhmsFormat
52
80
  }
53
81
  },
54
82
  taskViewConfig: {