vxe-gantt 3.0.27 → 3.1.1
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-chart.js +24 -15
- package/es/gantt/src/gantt-header.js +18 -6
- package/es/gantt/src/gantt-view.js +311 -47
- package/es/gantt/src/gantt.js +170 -7
- package/es/gantt/src/util.js +11 -0
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +6 -0
- package/lib/gantt/src/gantt-chart.js +30 -15
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt-header.js +15 -5
- package/lib/gantt/src/gantt-header.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +346 -51
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +168 -5
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/src/util.js +12 -0
- package/lib/gantt/src/util.min.js +1 -1
- package/lib/index.umd.js +588 -83
- package/lib/index.umd.min.js +1 -1
- package/lib/ui/index.js +4 -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/lib/ui/src/utils.js +8 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/package.json +3 -3
- package/packages/gantt/src/gantt-chart.ts +30 -15
- package/packages/gantt/src/gantt-header.ts +15 -6
- package/packages/gantt/src/gantt-view.ts +321 -49
- package/packages/gantt/src/gantt.ts +179 -7
- package/packages/gantt/src/util.ts +13 -0
- package/packages/ui/index.ts +3 -0
- package/packages/ui/src/utils.ts +8 -0
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.
|
|
18
|
+
_core.VxeUI.ganttVersion = "3.1.1";
|
|
19
19
|
setConfig({
|
|
20
20
|
gantt: {
|
|
21
21
|
// size: null,
|
|
@@ -54,6 +54,9 @@ setConfig({
|
|
|
54
54
|
// beforeSave: null,
|
|
55
55
|
// afterSave: null
|
|
56
56
|
},
|
|
57
|
+
taskBarTooltipConfig: {
|
|
58
|
+
enterable: true
|
|
59
|
+
},
|
|
57
60
|
taskViewScaleConfig: {
|
|
58
61
|
week: {
|
|
59
62
|
startDay: 1
|
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.
|
|
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.1",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);
|
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.
|
|
9
|
+
var version = "gantt v".concat("3.1.1");
|
|
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
|
+
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"),warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/lib/ui/src/utils.js
CHANGED
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.eqEmptyValue = eqEmptyValue;
|
|
7
|
+
exports.formatText = formatText;
|
|
7
8
|
exports.getClass = getClass;
|
|
8
9
|
exports.getFuncText = getFuncText;
|
|
9
10
|
exports.getGlobalDefaultConfig = getGlobalDefaultConfig;
|
|
10
11
|
exports.getLastZIndex = getLastZIndex;
|
|
11
12
|
exports.getStringValue = getStringValue;
|
|
12
13
|
exports.getSubLastZIndex = getSubLastZIndex;
|
|
14
|
+
exports.isEmptyValue = isEmptyValue;
|
|
13
15
|
exports.isEnableConf = isEnableConf;
|
|
14
16
|
exports.nextSubZIndex = nextSubZIndex;
|
|
15
17
|
exports.nextZIndex = nextZIndex;
|
|
@@ -21,6 +23,9 @@ var getConfig = _core.VxeUI.getConfig;
|
|
|
21
23
|
function isEnableConf(conf) {
|
|
22
24
|
return conf && conf.enabled !== false;
|
|
23
25
|
}
|
|
26
|
+
function isEmptyValue(cellValue) {
|
|
27
|
+
return cellValue === null || cellValue === undefined || cellValue === '';
|
|
28
|
+
}
|
|
24
29
|
function nextZIndex() {
|
|
25
30
|
return _domZindex.default.getNext();
|
|
26
31
|
}
|
|
@@ -46,6 +51,9 @@ function getFuncText(content, args) {
|
|
|
46
51
|
}
|
|
47
52
|
return '';
|
|
48
53
|
}
|
|
54
|
+
function formatText(value, placeholder) {
|
|
55
|
+
return '' + (isEmptyValue(value) ? placeholder ? _core.VxeUI.getConfig().emptyCell : '' : value);
|
|
56
|
+
}
|
|
49
57
|
/**
|
|
50
58
|
* 判断值为:'' | null | undefined 时都属于空值
|
|
51
59
|
*/
|
package/lib/ui/src/utils.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.eqEmptyValue=eqEmptyValue,exports.getClass=getClass,exports.getFuncText=getFuncText,exports.getGlobalDefaultConfig=getGlobalDefaultConfig,exports.getLastZIndex=getLastZIndex,exports.getStringValue=getStringValue,exports.getSubLastZIndex=getSubLastZIndex,exports.isEnableConf=isEnableConf,exports.nextSubZIndex=nextSubZIndex,exports.nextZIndex=nextZIndex;var _xeUtils=_interopRequireDefault(require("xe-utils")),_core=require("@vxe-ui/core"),_domZindex=_interopRequireDefault(require("dom-zindex"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var getConfig=_core.VxeUI.getConfig;function isEnableConf(e){return e&&!1!==e.enabled}function nextZIndex(){return _domZindex.default.getNext()}function getLastZIndex(){return _domZindex.default.getCurrent()}function nextSubZIndex(){return _domZindex.default.getSubNext()}function getSubLastZIndex(){return _domZindex.default.getSubCurrent()}function getGlobalDefaultConfig(e,t){return _xeUtils.default.eqNull(e)?t:e}function getFuncText(e,t){var n;return e?(n=getConfig().translate,_xeUtils.default.toValueString(n?n(""+e,t):e)):""}function eqEmptyValue(e){return null==e||""===e}function getStringValue(e){return eqEmptyValue(e)?"":e}function getClass(e,t){return e?_xeUtils.default.isFunction(e)?e(t):e:""}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.eqEmptyValue=eqEmptyValue,exports.formatText=formatText,exports.getClass=getClass,exports.getFuncText=getFuncText,exports.getGlobalDefaultConfig=getGlobalDefaultConfig,exports.getLastZIndex=getLastZIndex,exports.getStringValue=getStringValue,exports.getSubLastZIndex=getSubLastZIndex,exports.isEmptyValue=isEmptyValue,exports.isEnableConf=isEnableConf,exports.nextSubZIndex=nextSubZIndex,exports.nextZIndex=nextZIndex;var _xeUtils=_interopRequireDefault(require("xe-utils")),_core=require("@vxe-ui/core"),_domZindex=_interopRequireDefault(require("dom-zindex"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var getConfig=_core.VxeUI.getConfig;function isEnableConf(e){return e&&!1!==e.enabled}function isEmptyValue(e){return null==e||""===e}function nextZIndex(){return _domZindex.default.getNext()}function getLastZIndex(){return _domZindex.default.getCurrent()}function nextSubZIndex(){return _domZindex.default.getSubNext()}function getSubLastZIndex(){return _domZindex.default.getSubCurrent()}function getGlobalDefaultConfig(e,t){return _xeUtils.default.eqNull(e)?t:e}function getFuncText(e,t){var n;return e?(n=getConfig().translate,_xeUtils.default.toValueString(n?n(""+e,t):e)):""}function formatText(e,t){return""+(isEmptyValue(e)?t?_core.VxeUI.getConfig().emptyCell:"":e)}function eqEmptyValue(e){return null==e||""===e}function getStringValue(e){return eqEmptyValue(e)?"":e}function getClass(e,t){return e?_xeUtils.default.isFunction(e)?e(t):e:""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-gantt",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "A vue based gantt component",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -64,8 +64,8 @@
|
|
|
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.
|
|
68
|
-
"vxe-table": "^3.19.
|
|
67
|
+
"vxe-pc-ui": "^3.10.44",
|
|
68
|
+
"vxe-table": "^3.19.26"
|
|
69
69
|
},
|
|
70
70
|
"vetur": {
|
|
71
71
|
"tags": "helper/vetur/tags.json",
|
|
@@ -59,7 +59,7 @@ export default defineVxeComponent({
|
|
|
59
59
|
const progressField = $xeGantt.computeProgressField
|
|
60
60
|
const taskBarOpts = $xeGantt.computeTaskBarOpts
|
|
61
61
|
const barParams = { $gantt: $xeGantt, row }
|
|
62
|
-
const { showProgress, showContent, contentMethod, barStyle, drag } = taskBarOpts
|
|
62
|
+
const { showProgress, showContent, contentMethod, barStyle, drag, showTooltip } = taskBarOpts
|
|
63
63
|
const isBarRowStyle = XEUtils.isFunction(barStyle)
|
|
64
64
|
const barStyObj = (barStyle ? (isBarRowStyle ? barStyle(barParams) : barStyle) : {}) || {}
|
|
65
65
|
const { round } = barStyObj
|
|
@@ -90,7 +90,34 @@ export default defineVxeComponent({
|
|
|
90
90
|
title = getStringValue(contentMethod({ row, title }))
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
const ctParams = { source: sourceType, type: viewType, row, $rowIndex, rowIndex, _rowIndex }
|
|
93
|
+
const ctParams = { source: sourceType, type: viewType, row, $rowIndex, rowIndex, _rowIndex, $gantt: $xeGantt }
|
|
94
|
+
const ons: {
|
|
95
|
+
click: any
|
|
96
|
+
dblclick: any
|
|
97
|
+
mousedown: any
|
|
98
|
+
mouseover?: any
|
|
99
|
+
mouseleave?: any
|
|
100
|
+
} = {
|
|
101
|
+
click (evnt: MouseEvent) {
|
|
102
|
+
$xeGantt.handleTaskBarClickEvent(evnt, barParams)
|
|
103
|
+
},
|
|
104
|
+
dblclick (evnt: MouseEvent) {
|
|
105
|
+
$xeGantt.handleTaskBarDblclickEvent(evnt, barParams)
|
|
106
|
+
},
|
|
107
|
+
mousedown (evnt: MouseEvent) {
|
|
108
|
+
if ($xeGantt.handleTaskBarMousedownEvent) {
|
|
109
|
+
$xeGantt.handleTaskBarMousedownEvent(evnt, barParams)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (showTooltip) {
|
|
114
|
+
ons.mouseover = (evnt: MouseEvent) => {
|
|
115
|
+
$xeGantt.triggerTaskBarTooltipEvent(evnt, Object.assign({ $event: evnt }, ctParams))
|
|
116
|
+
}
|
|
117
|
+
ons.mouseleave = (evnt: MouseEvent) => {
|
|
118
|
+
$xeGantt.handleTaskBarTooltipLeaveEvent(evnt, Object.assign({ $event: evnt }, ctParams))
|
|
119
|
+
}
|
|
120
|
+
}
|
|
94
121
|
return h('div', {
|
|
95
122
|
key: treeConfig ? rowid : $rowIndex,
|
|
96
123
|
attrs: {
|
|
@@ -116,19 +143,7 @@ export default defineVxeComponent({
|
|
|
116
143
|
attrs: {
|
|
117
144
|
rowid
|
|
118
145
|
},
|
|
119
|
-
on:
|
|
120
|
-
click (evnt: MouseEvent) {
|
|
121
|
-
$xeGantt.handleTaskBarClickEvent(evnt, barParams)
|
|
122
|
-
},
|
|
123
|
-
dblclick (evnt: MouseEvent) {
|
|
124
|
-
$xeGantt.handleTaskBarDblclickEvent(evnt, barParams)
|
|
125
|
-
},
|
|
126
|
-
mousedown (evnt: MouseEvent) {
|
|
127
|
-
if ($xeGantt.handleTaskBarMousedownEvent) {
|
|
128
|
-
$xeGantt.handleTaskBarMousedownEvent(evnt, barParams)
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
146
|
+
on: ons
|
|
132
147
|
}, taskBarSlot
|
|
133
148
|
? $xeGantt.callSlot(taskBarSlot, barParams, h)
|
|
134
149
|
: [
|
|
@@ -70,19 +70,26 @@ export default defineVxeComponent({
|
|
|
70
70
|
})
|
|
71
71
|
})),
|
|
72
72
|
h('thead', {}, headerGroups.map(({ scaleItem, columns }, $rowIndex) => {
|
|
73
|
-
const { type, titleMethod, headerCellStyle, slots } = scaleItem
|
|
73
|
+
const { type, titleFormat, titleMethod, headerCellStyle, slots } = scaleItem
|
|
74
74
|
const titleSlot = slots ? slots.title : null
|
|
75
|
-
const
|
|
75
|
+
const isLast = $rowIndex === headerGroups.length - 1
|
|
76
|
+
const todayValue = isLast && showNowLine ? todayDateMaps[type] : null
|
|
76
77
|
return h('tr', {
|
|
77
78
|
key: $rowIndex
|
|
78
79
|
}, columns.map((column, cIndex) => {
|
|
79
80
|
const { field, childCount, dateObj } = column
|
|
80
81
|
let label = `${column.title}`
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
if (scaleItem.type === 'day') {
|
|
83
|
+
label = getI18n(`vxe.gantt.dayss.w${dateObj.e}`)
|
|
84
|
+
} else {
|
|
85
|
+
if ($rowIndex) {
|
|
86
|
+
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj)
|
|
84
87
|
} else {
|
|
85
|
-
|
|
88
|
+
if (isLast && scaleItem.type === 'week') {
|
|
89
|
+
label = getI18n(`vxe.gantt.tSimpleFormat.${type}`, dateObj)
|
|
90
|
+
} else {
|
|
91
|
+
label = getI18n(`vxe.gantt.tFullFormat.${type}`, dateObj)
|
|
92
|
+
}
|
|
86
93
|
}
|
|
87
94
|
}
|
|
88
95
|
let cellVNs: string | VxeComponentSlotType[] = label
|
|
@@ -91,6 +98,8 @@ export default defineVxeComponent({
|
|
|
91
98
|
cellVNs = $xeGantt.callSlot(titleSlot, ctParams, h)
|
|
92
99
|
} else if (titleMethod) {
|
|
93
100
|
cellVNs = `${titleMethod(ctParams)}`
|
|
101
|
+
} else if (titleFormat) {
|
|
102
|
+
cellVNs = XEUtils.toDateString(dateObj.date, titleFormat)
|
|
94
103
|
}
|
|
95
104
|
let cellStys = {}
|
|
96
105
|
if (headerCellStyle) {
|