vxe-gantt 3.6.6 → 3.6.7
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 +3 -1
- package/es/gantt/src/gantt-header.js +33 -7
- package/es/gantt/src/gantt-view.js +42 -17
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/gantt/src/gantt-body.js +5 -1
- package/lib/gantt/src/gantt-body.min.js +1 -1
- package/lib/gantt/src/gantt-header.js +25 -6
- package/lib/gantt/src/gantt-header.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +51 -18
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/index.umd.js +83 -27
- 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-body.ts +3 -1
- package/packages/gantt/src/gantt-header.ts +32 -7
- package/packages/gantt/src/gantt-view.ts +44 -17
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.
|
|
16
|
+
_core.VxeUI.ganttVersion = "3.6.7";
|
|
17
17
|
var ymdFormat = 'yyyy-MM-dd';
|
|
18
18
|
var ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
19
19
|
setConfig({
|
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"),setConfig=_core.VxeUI.setConfig,setIcon=_core.VxeUI.setIcon,ymdFormat=(_core.VxeUI.ganttVersion="3.6.
|
|
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);
|
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.
|
|
10
|
+
var ganttVersion = "gantt v".concat("3.6.7");
|
|
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) : '';
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -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.
|
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-gantt",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.7",
|
|
4
4
|
"description": "A vue based gantt component",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"vue": "~2.6.14",
|
|
61
61
|
"vue-i18n": "^8.15.1",
|
|
62
62
|
"vue-router": "^3.5.1",
|
|
63
|
-
"vxe-pc-ui": "3.16.
|
|
64
|
-
"vxe-table": "3.22.
|
|
63
|
+
"vxe-pc-ui": "3.16.28",
|
|
64
|
+
"vxe-table": "3.22.11"
|
|
65
65
|
},
|
|
66
66
|
"vetur": {
|
|
67
67
|
"tags": "helper/vetur/tags.json",
|
|
@@ -53,7 +53,7 @@ export default defineVxeComponent({
|
|
|
53
53
|
const { showNowLine, viewStyle } = taskViewOpts
|
|
54
54
|
const scaleUnit = $xeGantt.computeScaleUnit
|
|
55
55
|
const { scaleItem } = headerGroups[headerGroups.length - 1] || {}
|
|
56
|
-
const { field, dateObj } = column
|
|
56
|
+
const { field, dateObj, startDateObj, endDateObj } = column
|
|
57
57
|
const { cellClassName, cellStyle } = viewStyle || {}
|
|
58
58
|
const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null
|
|
59
59
|
|
|
@@ -104,6 +104,8 @@ export default defineVxeComponent({
|
|
|
104
104
|
type: viewType,
|
|
105
105
|
scaleType: scaleUnit,
|
|
106
106
|
dateObj,
|
|
107
|
+
startDateObj,
|
|
108
|
+
endDateObj,
|
|
107
109
|
row,
|
|
108
110
|
column,
|
|
109
111
|
$rowIndex,
|
|
@@ -41,6 +41,8 @@ export default defineVxeComponent({
|
|
|
41
41
|
const { headerGroups, viewCellWidth } = reactData
|
|
42
42
|
const { todayDateMaps, visibleColumn } = internalData
|
|
43
43
|
const taskViewOpts = $xeGantt.computeTaskViewOpts
|
|
44
|
+
const minScale = $xeGantt.computeMinScale
|
|
45
|
+
const scaleStep = $xeGantt.computeScaleStep
|
|
44
46
|
const { showNowLine } = taskViewOpts
|
|
45
47
|
return h('div', {
|
|
46
48
|
ref: 'refElem',
|
|
@@ -77,15 +79,28 @@ export default defineVxeComponent({
|
|
|
77
79
|
return h('tr', {
|
|
78
80
|
key: $rowIndex
|
|
79
81
|
}, columns.map((column, cIndex) => {
|
|
80
|
-
const { field, childCount, dateObj } = column
|
|
82
|
+
const { field, childCount, dateObj, startDateObj, endDateObj } = column
|
|
81
83
|
let label = `${column.title}`
|
|
82
|
-
if (
|
|
83
|
-
label = getI18n(`vxe.gantt.
|
|
84
|
+
if ((isLast || (minScale && (minScale.type === 'date' || minScale.type === 'day') && (type === 'date' || type === 'day'))) && scaleStep > 1) {
|
|
85
|
+
label = getI18n(`vxe.gantt.stepFormat.${type}`, {
|
|
86
|
+
start: startDateObj,
|
|
87
|
+
end: endDateObj,
|
|
88
|
+
eStartLabel: getI18n(`vxe.gantt.dayss.w${startDateObj.e}`),
|
|
89
|
+
eEndLabel: getI18n(`vxe.gantt.dayss.w${endDateObj.e}`)
|
|
90
|
+
})
|
|
84
91
|
} else {
|
|
85
|
-
if (
|
|
86
|
-
|
|
92
|
+
if (type === 'day') {
|
|
93
|
+
if ($rowIndex) {
|
|
94
|
+
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, {
|
|
95
|
+
eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
96
|
+
})
|
|
97
|
+
} else {
|
|
98
|
+
label = getI18n(`vxe.gantt.tFullFormat.${type}`, {
|
|
99
|
+
eLabel: getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
100
|
+
})
|
|
101
|
+
}
|
|
87
102
|
} else {
|
|
88
|
-
if (
|
|
103
|
+
if ($rowIndex) {
|
|
89
104
|
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj)
|
|
90
105
|
} else {
|
|
91
106
|
label = getI18n(`vxe.gantt.tFullFormat.${type}`, dateObj)
|
|
@@ -93,7 +108,17 @@ export default defineVxeComponent({
|
|
|
93
108
|
}
|
|
94
109
|
}
|
|
95
110
|
let cellVNs: string | VxeComponentSlotType[] = label
|
|
96
|
-
const ctParams = {
|
|
111
|
+
const ctParams = {
|
|
112
|
+
source: sourceType,
|
|
113
|
+
type: viewType,
|
|
114
|
+
column,
|
|
115
|
+
scaleObj: scaleItem,
|
|
116
|
+
title: label,
|
|
117
|
+
dateObj,
|
|
118
|
+
startDateObj,
|
|
119
|
+
endDateObj,
|
|
120
|
+
$rowIndex
|
|
121
|
+
}
|
|
97
122
|
if (titleSlot) {
|
|
98
123
|
cellVNs = $xeGantt.callSlot(titleSlot, ctParams, h)
|
|
99
124
|
} else if (titleMethod) {
|
|
@@ -136,6 +136,8 @@ function handleColumnHeader ($xeGanttView: VxeGanttViewConstructor & VxeGanttVie
|
|
|
136
136
|
const minScale = $xeGantt.computeMinScale
|
|
137
137
|
const weekScale = $xeGantt.computeWeekScale
|
|
138
138
|
const scaleDateList = $xeGanttView.computeScaleDateList
|
|
139
|
+
const scaleStep = $xeGantt.computeScaleStep
|
|
140
|
+
const weekStartDay = weekScale ? weekScale.startDay : undefined
|
|
139
141
|
const fullCols: VxeGanttDefines.ViewColumn[] = []
|
|
140
142
|
const groupCols: VxeGanttDefines.GroupColumn[] = []
|
|
141
143
|
|
|
@@ -184,68 +186,93 @@ function handleColumnHeader ($xeGanttView: VxeGanttViewConstructor & VxeGanttVie
|
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
188
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const e = itemDate.getDay()
|
|
189
|
+
const createDateObj = (date: Date) => {
|
|
190
|
+
let [yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss] = XEUtils.toDateString(date, 'yy-yyyy-M-MM-d-dd-H-HH-m-mm-s-ss').split('-')
|
|
191
|
+
const e = date.getDay()
|
|
191
192
|
const E = e + 1
|
|
192
|
-
const q = Math.ceil((
|
|
193
|
-
const W = `${XEUtils.getYearWeek(
|
|
193
|
+
const q = Math.ceil((date.getMonth() + 1) / 3)
|
|
194
|
+
const W = `${XEUtils.getYearWeek(date, weekScale ? weekScale.startDay : undefined)}`
|
|
194
195
|
const WW = XEUtils.padStart(W, 2, '0')
|
|
195
196
|
if (isMinWeek && checkWeekOfsetYear(W, M)) {
|
|
196
197
|
yyyy = `${Number(yyyy) + 1}`
|
|
197
198
|
M = '1'
|
|
198
199
|
MM = '0' + M
|
|
199
200
|
}
|
|
200
|
-
|
|
201
|
+
return { date, yy, yyyy, M, MM, d, dd, H, HH, m, mm, s, ss, q, W, WW, E, e }
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
for (let i = 0; i < scaleDateList.length; i++) {
|
|
205
|
+
const itemDate = scaleDateList[i]
|
|
206
|
+
const dateObj: VxeGanttDefines.ScaleDateObj = createDateObj(itemDate)
|
|
207
|
+
const { yyyy, MM, dd, HH, mm, ss, q, W, E } = dateObj
|
|
208
|
+
const startDateObj = dateObj
|
|
201
209
|
const colMaps: Record<VxeGanttDefines.ColumnScaleType, VxeGanttDefines.ViewColumn> = {
|
|
202
210
|
year: {
|
|
203
211
|
field: yyyy,
|
|
204
212
|
title: yyyy,
|
|
205
|
-
dateObj
|
|
213
|
+
dateObj,
|
|
214
|
+
startDateObj,
|
|
215
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatYear(itemDate, scaleStep - 1)) : startDateObj
|
|
206
216
|
},
|
|
207
217
|
quarter: {
|
|
208
218
|
field: `${yyyy}_q${q}`,
|
|
209
219
|
title: `${q}`,
|
|
210
|
-
dateObj
|
|
220
|
+
dateObj,
|
|
221
|
+
startDateObj,
|
|
222
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatQuarter(itemDate, scaleStep - 1)) : startDateObj
|
|
211
223
|
},
|
|
212
224
|
month: {
|
|
213
225
|
field: `${yyyy}_${MM}`,
|
|
214
226
|
title: MM,
|
|
215
|
-
dateObj
|
|
227
|
+
dateObj,
|
|
228
|
+
startDateObj,
|
|
229
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatMonth(itemDate, scaleStep - 1)) : startDateObj
|
|
216
230
|
},
|
|
217
231
|
week: {
|
|
218
232
|
field: `${yyyy}_W${W}`,
|
|
219
233
|
title: `${W}`,
|
|
220
|
-
dateObj
|
|
234
|
+
dateObj,
|
|
235
|
+
startDateObj,
|
|
236
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatWeek(itemDate, scaleStep - 1, weekStartDay, weekStartDay)) : startDateObj
|
|
221
237
|
},
|
|
222
238
|
day: {
|
|
223
239
|
field: `${yyyy}_${MM}_${dd}_E${E}`,
|
|
224
240
|
title: `${E}`,
|
|
225
|
-
dateObj
|
|
241
|
+
dateObj,
|
|
242
|
+
startDateObj,
|
|
243
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
|
|
226
244
|
},
|
|
227
245
|
date: {
|
|
228
246
|
field: `${yyyy}_${MM}_${dd}`,
|
|
229
247
|
title: dd,
|
|
230
|
-
dateObj
|
|
248
|
+
dateObj,
|
|
249
|
+
startDateObj,
|
|
250
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatDay(itemDate, scaleStep - 1)) : startDateObj
|
|
231
251
|
},
|
|
232
252
|
hour: {
|
|
233
253
|
field: `${yyyy}_${MM}_${dd}_${HH}`,
|
|
234
254
|
title: HH,
|
|
235
|
-
dateObj
|
|
255
|
+
dateObj,
|
|
256
|
+
startDateObj,
|
|
257
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatHours(itemDate, scaleStep - 1)) : startDateObj
|
|
236
258
|
},
|
|
237
259
|
minute: {
|
|
238
260
|
field: `${yyyy}_${MM}_${dd}_${HH}_${mm}`,
|
|
239
261
|
title: mm,
|
|
240
|
-
dateObj
|
|
262
|
+
dateObj,
|
|
263
|
+
startDateObj,
|
|
264
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatMinutes(itemDate, scaleStep - 1)) : startDateObj
|
|
241
265
|
},
|
|
242
266
|
second: {
|
|
243
267
|
field: `${yyyy}_${MM}_${dd}_${HH}_${mm}_${ss}`,
|
|
244
268
|
title: ss,
|
|
245
|
-
dateObj
|
|
269
|
+
dateObj,
|
|
270
|
+
startDateObj,
|
|
271
|
+
endDateObj: scaleStep > 1 ? createDateObj(XEUtils.getWhatSeconds(itemDate, scaleStep - 1)) : startDateObj
|
|
246
272
|
}
|
|
247
273
|
}
|
|
248
274
|
const minCol = colMaps[minScale.type]
|
|
275
|
+
|
|
249
276
|
if (minScale.level < 19) {
|
|
250
277
|
handleData('year', colMaps, minCol)
|
|
251
278
|
}
|
|
@@ -1625,7 +1652,7 @@ export default defineVxeComponent({
|
|
|
1625
1652
|
let rightSize = ganttReactData.currRightSpacing + XEUtils.toNumber(gridding ? gridding.rightSpacing || 0 : 0)
|
|
1626
1653
|
if (scaleStep > 0) {
|
|
1627
1654
|
leftSize *= scaleStep
|
|
1628
|
-
rightSize *=
|
|
1655
|
+
rightSize *= scaleStep
|
|
1629
1656
|
}
|
|
1630
1657
|
switch (type) {
|
|
1631
1658
|
case 'year': {
|