vxe-gantt 3.1.1 → 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/es/gantt/src/gantt-body.js +24 -2
- package/es/gantt/src/gantt-chart.js +13 -3
- package/es/gantt/src/gantt.js +22 -23
- package/es/ui/index.js +29 -2
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-body.js +6 -0
- package/lib/gantt/src/gantt-body.min.js +1 -1
- package/lib/gantt/src/gantt-chart.js +8 -4
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt.js +24 -31
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +68 -38
- package/lib/index.umd.min.js +1 -1
- package/lib/ui/index.js +29 -2
- 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-body.ts +24 -2
- package/packages/gantt/src/gantt-chart.ts +13 -3
- package/packages/gantt/src/gantt.ts +22 -26
- package/packages/ui/index.ts +29 -1
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.
|
|
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: {
|
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,
|
|
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.
|
|
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);
|
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.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.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.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "A vue based gantt component",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"vue": "~2.6.14",
|
|
65
65
|
"vue-i18n": "^8.15.1",
|
|
66
66
|
"vue-router": "^3.5.1",
|
|
67
|
-
"vxe-pc-ui": "^3.10.
|
|
67
|
+
"vxe-pc-ui": "^3.10.45",
|
|
68
68
|
"vxe-table": "^3.19.26"
|
|
69
69
|
},
|
|
70
70
|
"vetur": {
|
|
@@ -51,6 +51,7 @@ export default defineVxeComponent({
|
|
|
51
51
|
const { todayDateMaps } = internalData
|
|
52
52
|
const taskViewOpts = $xeGantt.computeTaskViewOpts
|
|
53
53
|
const { showNowLine, viewStyle } = taskViewOpts
|
|
54
|
+
const scaleUnit = $xeGantt.computeScaleUnit
|
|
54
55
|
const { scaleItem } = headerGroups[headerGroups.length - 1] || {}
|
|
55
56
|
const { field, dateObj } = column
|
|
56
57
|
const { cellClassName, cellStyle } = viewStyle || {}
|
|
@@ -99,7 +100,18 @@ export default defineVxeComponent({
|
|
|
99
100
|
})
|
|
100
101
|
)
|
|
101
102
|
}
|
|
102
|
-
const ctParams = {
|
|
103
|
+
const ctParams = {
|
|
104
|
+
$gantt: $xeGantt,
|
|
105
|
+
source: sourceType,
|
|
106
|
+
type: viewType,
|
|
107
|
+
scaleType: scaleUnit,
|
|
108
|
+
dateObj,
|
|
109
|
+
row,
|
|
110
|
+
column,
|
|
111
|
+
$rowIndex,
|
|
112
|
+
rowIndex,
|
|
113
|
+
_rowIndex
|
|
114
|
+
}
|
|
103
115
|
return h('td', {
|
|
104
116
|
key: $columnIndex,
|
|
105
117
|
class: [
|
|
@@ -149,6 +161,7 @@ export default defineVxeComponent({
|
|
|
149
161
|
const { transform } = treeOpts
|
|
150
162
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
151
163
|
|
|
164
|
+
const scaleUnit = $xeGantt.computeScaleUnit
|
|
152
165
|
const taskViewOpts = $xeGantt.computeTaskViewOpts
|
|
153
166
|
const { viewStyle } = taskViewOpts
|
|
154
167
|
const { rowClassName, rowStyle } = viewStyle || {}
|
|
@@ -186,7 +199,16 @@ export default defineVxeComponent({
|
|
|
186
199
|
trOns.dragend = $xeTable.handleRowDragDragendEvent
|
|
187
200
|
trOns.dragover = $xeTable.handleRowDragDragoverEvent
|
|
188
201
|
}
|
|
189
|
-
const rowParams = {
|
|
202
|
+
const rowParams = {
|
|
203
|
+
$gantt: $xeGantt,
|
|
204
|
+
source: sourceType,
|
|
205
|
+
type: viewType,
|
|
206
|
+
scaleType: scaleUnit,
|
|
207
|
+
row,
|
|
208
|
+
rowIndex,
|
|
209
|
+
$rowIndex,
|
|
210
|
+
_rowIndex
|
|
211
|
+
}
|
|
190
212
|
trVNs.push(
|
|
191
213
|
h('tr', {
|
|
192
214
|
key: treeConfig ? rowid : $rowIndex,
|
|
@@ -58,7 +58,8 @@ export default defineVxeComponent({
|
|
|
58
58
|
const titleField = $xeGantt.computeTitleField
|
|
59
59
|
const progressField = $xeGantt.computeProgressField
|
|
60
60
|
const taskBarOpts = $xeGantt.computeTaskBarOpts
|
|
61
|
-
const
|
|
61
|
+
const scaleUnit = $xeGantt.computeScaleUnit
|
|
62
|
+
const barParams = { $gantt: $xeGantt, row, scaleType: scaleUnit }
|
|
62
63
|
const { showProgress, showContent, contentMethod, barStyle, drag, showTooltip } = taskBarOpts
|
|
63
64
|
const isBarRowStyle = XEUtils.isFunction(barStyle)
|
|
64
65
|
const barStyObj = (barStyle ? (isBarRowStyle ? barStyle(barParams) : barStyle) : {}) || {}
|
|
@@ -87,10 +88,19 @@ export default defineVxeComponent({
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
if (contentMethod) {
|
|
90
|
-
title = getStringValue(contentMethod({ row, title }))
|
|
91
|
+
title = getStringValue(contentMethod({ row, title, scaleType: scaleUnit }))
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
const ctParams = {
|
|
94
|
+
const ctParams = {
|
|
95
|
+
$gantt: $xeGantt,
|
|
96
|
+
source: sourceType,
|
|
97
|
+
type: viewType,
|
|
98
|
+
scaleType: scaleUnit,
|
|
99
|
+
row,
|
|
100
|
+
$rowIndex,
|
|
101
|
+
rowIndex,
|
|
102
|
+
_rowIndex
|
|
103
|
+
}
|
|
94
104
|
const ons: {
|
|
95
105
|
click: any
|
|
96
106
|
dblclick: any
|
|
@@ -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
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
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 () {
|
|
@@ -1901,7 +1894,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1901
1894
|
const { row } = params
|
|
1902
1895
|
let content = formatText(XEUtils.get(row, titleField))
|
|
1903
1896
|
if (contentMethod) {
|
|
1904
|
-
|
|
1897
|
+
const customContnet = contentMethod(params)
|
|
1898
|
+
if (!XEUtils.eqNull(customContnet)) {
|
|
1899
|
+
content = `${customContnet}`
|
|
1900
|
+
}
|
|
1905
1901
|
}
|
|
1906
1902
|
$xeGantt.handleTargetEnterEvent(barTipStore.row !== row)
|
|
1907
1903
|
const tipContent = formatText(content)
|
package/packages/ui/index.ts
CHANGED
|
@@ -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: {
|