vue-devui 1.0.0-rc.1 → 1.0.0-rc.4
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/README.md +132 -200
- package/auto-complete/index.es.js +150 -110
- package/auto-complete/index.umd.js +5 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +77 -81
- package/avatar/index.umd.js +1 -1
- package/button/index.es.js +23 -15
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/card/index.es.js +3 -6
- package/card/index.umd.js +1 -1
- package/checkbox/index.es.js +5 -11
- package/checkbox/index.umd.js +1 -1
- package/comment/index.es.js +4 -6
- package/comment/index.umd.js +1 -1
- package/countdown/index.es.js +3 -6
- package/countdown/index.umd.js +1 -1
- package/editable-select/index.es.js +120 -167
- package/editable-select/index.umd.js +1 -1
- package/grid/index.es.js +30 -36
- package/grid/index.umd.js +1 -1
- package/image-preview/index.es.js +19 -19
- package/image-preview/index.umd.js +1 -1
- package/input/index.es.js +2 -5
- package/input/index.umd.js +1 -1
- package/layout/index.es.js +9 -22
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +40 -25
- package/loading/index.umd.js +1 -1
- package/modal/index.es.js +55 -47
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +100 -10
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/commentProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/readTipProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tagInputProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/overlay/index.es.js +5 -5
- package/overlay/index.umd.js +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +14 -13
- package/pagination/index.umd.js +1 -1
- package/popover/index.es.js +7 -7
- package/popover/index.umd.js +12 -12
- package/progress/index.es.js +34 -36
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +8 -2
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +4 -7
- package/rate/index.umd.js +1 -1
- package/read-tip/index.es.js +34 -34
- package/read-tip/index.umd.js +1 -1
- package/read-tip/style.css +1 -1
- package/result/index.es.js +2 -5
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +43 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +11 -11
- package/search/index.umd.js +8 -8
- package/skeleton/index.es.js +9 -12
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +59 -62
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +176 -136
- package/splitter/index.umd.js +13 -13
- package/statistic/index.es.js +7 -18
- package/statistic/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +4 -7
- package/switch/index.umd.js +1 -1
- package/switch/style.css +1 -1
- package/tag/index.es.js +13 -17
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +3 -6
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.es.js +2 -5
- package/textarea/index.umd.js +1 -1
- package/timeline/index.es.js +10 -16
- package/timeline/index.umd.js +1 -1
- package/upload/index.es.js +160 -67
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +12182 -24718
- package/vue-devui.umd.js +24 -20
- package/accordion/index.d.ts +0 -7
- package/accordion/index.es.js +0 -723
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.d.ts +0 -7
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/package.json +0 -7
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/package.json +0 -7
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -128
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -314
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5971
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.es.js +0 -8196
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1154
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/drawer/index.d.ts +0 -7
- package/drawer/index.es.js +0 -234
- package/drawer/index.umd.js +0 -1
- package/drawer/package.json +0 -7
- package/drawer/style.css +0 -1
- package/dropdown/index.d.ts +0 -7
- package/dropdown/index.es.js +0 -693
- package/dropdown/index.umd.js +0 -1
- package/dropdown/package.json +0 -7
- package/dropdown/style.css +0 -1
- package/form/index.d.ts +0 -7
- package/form/index.es.js +0 -7876
- package/form/index.umd.js +0 -27
- package/form/package.json +0 -7
- package/form/style.css +0 -1
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -332
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/input-number/index.d.ts +0 -7
- package/input-number/index.es.js +0 -229
- package/input-number/index.umd.js +0 -1
- package/input-number/package.json +0 -7
- package/input-number/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Column.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/Drawer.js +0 -3
- package/nuxt/components/DrawerService.js +0 -3
- package/nuxt/components/Dropdown.js +0 -3
- package/nuxt/components/DropdownMenu.js +0 -3
- package/nuxt/components/Form.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormItem.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/FormOperation.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/InputNumber.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/Select.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/Table.js +0 -3
- package/nuxt/components/Tabs.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Tooltip.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/Tree.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/dropdownMenuProps.js +0 -3
- package/nuxt/components/tooltipProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/select/index.d.ts +0 -7
- package/select/index.es.js +0 -706
- package/select/index.umd.js +0 -1
- package/select/package.json +0 -7
- package/select/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -242
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/table/index.d.ts +0 -7
- package/table/index.es.js +0 -2024
- package/table/index.umd.js +0 -1
- package/table/package.json +0 -7
- package/table/style.css +0 -1
- package/tabs/index.d.ts +0 -7
- package/tabs/index.es.js +0 -194
- package/tabs/index.umd.js +0 -1
- package/tabs/package.json +0 -7
- package/tabs/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1238
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/tooltip/index.d.ts +0 -7
- package/tooltip/index.es.js +0 -5835
- package/tooltip/index.umd.js +0 -27
- package/tooltip/package.json +0 -7
- package/tooltip/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7615
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree/index.d.ts +0 -7
- package/tree/index.es.js +0 -6495
- package/tree/index.umd.js +0 -27
- package/tree/package.json +0 -7
- package/tree/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -627
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/gantt/index.es.js
DELETED
|
@@ -1,523 +0,0 @@
|
|
|
1
|
-
import { defineComponent, toRefs, ref, onMounted, watch, createVNode, withDirectives, resolveComponent, resolveDirective, createTextVNode } from "vue";
|
|
2
|
-
var ganttScale = "";
|
|
3
|
-
var GanttScaleUnit = /* @__PURE__ */ ((GanttScaleUnit2) => {
|
|
4
|
-
GanttScaleUnit2["day"] = "day";
|
|
5
|
-
GanttScaleUnit2["week"] = "week";
|
|
6
|
-
GanttScaleUnit2["month"] = "month";
|
|
7
|
-
return GanttScaleUnit2;
|
|
8
|
-
})(GanttScaleUnit || {});
|
|
9
|
-
const isSameDate = (date, compareDate) => {
|
|
10
|
-
return date.getFullYear() === compareDate.getFullYear() && date.getMonth() === compareDate.getMonth() && date.getDate() === compareDate.getDate();
|
|
11
|
-
};
|
|
12
|
-
const useScaleData = (milestoneList) => {
|
|
13
|
-
const SCALE_START_LABLE_OFFSET = 7;
|
|
14
|
-
const generateDateInfo = (date, index2) => {
|
|
15
|
-
const dateInfo = {
|
|
16
|
-
dayOfMonthLabel: "",
|
|
17
|
-
dayOfWeekLabel: "",
|
|
18
|
-
monthLabel: "",
|
|
19
|
-
yearLabel: "",
|
|
20
|
-
date,
|
|
21
|
-
monthStart: false,
|
|
22
|
-
weekend: false,
|
|
23
|
-
today: false,
|
|
24
|
-
milestone: "",
|
|
25
|
-
highlightStart: false,
|
|
26
|
-
scaleStartVisable: true,
|
|
27
|
-
index: index2
|
|
28
|
-
};
|
|
29
|
-
const dayOfMonth = date.getDate();
|
|
30
|
-
dateInfo.dayOfMonthLabel = dayOfMonth + "";
|
|
31
|
-
if (dayOfMonth === 1) {
|
|
32
|
-
dateInfo.monthStart = true;
|
|
33
|
-
}
|
|
34
|
-
const dayOfWeek = date.getDay();
|
|
35
|
-
dateInfo.dayOfWeekLabel = dayOfWeek + "";
|
|
36
|
-
if (dayOfWeek === 6) {
|
|
37
|
-
dateInfo.weekend = true;
|
|
38
|
-
}
|
|
39
|
-
const month = date.getMonth() + 1;
|
|
40
|
-
dateInfo.monthLabel = month + "";
|
|
41
|
-
const year = date.getFullYear();
|
|
42
|
-
dateInfo.yearLabel = year + "";
|
|
43
|
-
if (isSameDate(date, new Date())) {
|
|
44
|
-
dateInfo.today = true;
|
|
45
|
-
}
|
|
46
|
-
if (new Date(year, month - 1, dayOfMonth + SCALE_START_LABLE_OFFSET).getMonth() > month - 1) {
|
|
47
|
-
dateInfo.scaleStartVisable = false;
|
|
48
|
-
}
|
|
49
|
-
if (milestoneList.value) {
|
|
50
|
-
milestoneList.value.forEach((milestone) => {
|
|
51
|
-
if (milestone.date) {
|
|
52
|
-
if (isSameDate(milestone.date, dateInfo.date)) {
|
|
53
|
-
dateInfo.milestone = milestone.lable;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return dateInfo;
|
|
59
|
-
};
|
|
60
|
-
const getNextDay = (date) => {
|
|
61
|
-
const nextDayDate = date.setDate(date.getDate() + 1);
|
|
62
|
-
return new Date(nextDayDate);
|
|
63
|
-
};
|
|
64
|
-
const generateScaleData = (startDate, endDate) => {
|
|
65
|
-
const scaleData = [];
|
|
66
|
-
let handleDate = startDate;
|
|
67
|
-
let index2 = 0;
|
|
68
|
-
while (!isSameDate(handleDate, endDate)) {
|
|
69
|
-
const dateInfo = generateDateInfo(handleDate, index2);
|
|
70
|
-
scaleData.push(dateInfo);
|
|
71
|
-
handleDate = getNextDay(new Date(handleDate));
|
|
72
|
-
index2++;
|
|
73
|
-
}
|
|
74
|
-
console.log({ scaleData });
|
|
75
|
-
return scaleData;
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
generateScaleData
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
const i18nText = {
|
|
82
|
-
en: {
|
|
83
|
-
today: "today",
|
|
84
|
-
monthsOfYear: [
|
|
85
|
-
"January",
|
|
86
|
-
"February",
|
|
87
|
-
"March",
|
|
88
|
-
"April",
|
|
89
|
-
"May",
|
|
90
|
-
"June",
|
|
91
|
-
"July",
|
|
92
|
-
"August",
|
|
93
|
-
"September",
|
|
94
|
-
"October",
|
|
95
|
-
"November",
|
|
96
|
-
"December"
|
|
97
|
-
],
|
|
98
|
-
yearDisplay(year) {
|
|
99
|
-
return `${year}`;
|
|
100
|
-
},
|
|
101
|
-
monthDisplay(strMonthIndex) {
|
|
102
|
-
return this.monthsOfYear[Number(strMonthIndex) - 1];
|
|
103
|
-
},
|
|
104
|
-
yearAndMonthDisplay(year, strMonthIndex) {
|
|
105
|
-
return this.yearDisplay(year) + this.monthDisplay(strMonthIndex);
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
zh: {
|
|
109
|
-
today: "\u4ECA\u5929",
|
|
110
|
-
monthsOfYear: [
|
|
111
|
-
"1\u6708",
|
|
112
|
-
"2\u6708",
|
|
113
|
-
"3\u6708",
|
|
114
|
-
"4\u6708",
|
|
115
|
-
"5\u6708",
|
|
116
|
-
"6\u6708",
|
|
117
|
-
"7\u6708",
|
|
118
|
-
"8\u6708",
|
|
119
|
-
"9\u6708",
|
|
120
|
-
"10\u6708",
|
|
121
|
-
"11\u6708",
|
|
122
|
-
"12\u6708"
|
|
123
|
-
],
|
|
124
|
-
yearDisplay(year) {
|
|
125
|
-
return `${year}\u5E74`;
|
|
126
|
-
},
|
|
127
|
-
monthDisplay(strMonthIndex) {
|
|
128
|
-
return this.monthsOfYear[Number(strMonthIndex) - 1];
|
|
129
|
-
},
|
|
130
|
-
yearAndMonthDisplay(year, strMonthIndex) {
|
|
131
|
-
return this.yearDisplay(year) + this.monthDisplay(strMonthIndex);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
var DGanttScale = defineComponent({
|
|
136
|
-
name: "DGanttScale",
|
|
137
|
-
props: {
|
|
138
|
-
unit: {
|
|
139
|
-
type: String,
|
|
140
|
-
default: GanttScaleUnit.day
|
|
141
|
-
},
|
|
142
|
-
height: {
|
|
143
|
-
type: Number
|
|
144
|
-
},
|
|
145
|
-
startDate: {
|
|
146
|
-
type: Date
|
|
147
|
-
},
|
|
148
|
-
endDate: {
|
|
149
|
-
type: Date
|
|
150
|
-
},
|
|
151
|
-
ganttScaleContainerOffsetLeft: {
|
|
152
|
-
type: Number
|
|
153
|
-
},
|
|
154
|
-
milestoneList: {
|
|
155
|
-
type: Array
|
|
156
|
-
},
|
|
157
|
-
scrollElement: {
|
|
158
|
-
type: Object
|
|
159
|
-
},
|
|
160
|
-
ganttBarContainerElement: {
|
|
161
|
-
type: Object
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
emits: ["addMilestone"],
|
|
165
|
-
setup(props, ctx) {
|
|
166
|
-
const {
|
|
167
|
-
startDate,
|
|
168
|
-
endDate,
|
|
169
|
-
milestoneList,
|
|
170
|
-
scrollElement,
|
|
171
|
-
unit
|
|
172
|
-
} = toRefs(props);
|
|
173
|
-
const scaleData = ref([]);
|
|
174
|
-
const viewSCaleData = ref([]);
|
|
175
|
-
const scaleWidth = ref({
|
|
176
|
-
day: 40,
|
|
177
|
-
week: 30,
|
|
178
|
-
month: 20
|
|
179
|
-
});
|
|
180
|
-
const highlight = ref(false);
|
|
181
|
-
const highlightStartText = ref("");
|
|
182
|
-
const highlightEndText = ref("");
|
|
183
|
-
const {
|
|
184
|
-
generateScaleData
|
|
185
|
-
} = useScaleData(milestoneList);
|
|
186
|
-
let viewScaleRange = [0, 0];
|
|
187
|
-
const addMilestone = (info) => {
|
|
188
|
-
ctx.emit("addMilestone", info);
|
|
189
|
-
};
|
|
190
|
-
const getViewScaleData = () => {
|
|
191
|
-
if (scrollElement.value) {
|
|
192
|
-
const containerWidth = scrollElement.value.clientWidth;
|
|
193
|
-
const scrollLeft = scrollElement.value.scrollLeft;
|
|
194
|
-
const start = Math.floor(scrollLeft / scaleWidth.value[unit.value]);
|
|
195
|
-
const offset = Math.ceil(containerWidth / scaleWidth.value[unit.value]);
|
|
196
|
-
viewScaleRange = [start - 2, start + offset + 2];
|
|
197
|
-
viewSCaleData.value = scaleData.value.filter((i) => {
|
|
198
|
-
return i.index >= viewScaleRange[0] && i.index <= viewScaleRange[1];
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
onMounted(() => {
|
|
203
|
-
if (startDate.value && endDate.value) {
|
|
204
|
-
scaleData.value = generateScaleData(startDate.value, endDate.value);
|
|
205
|
-
getViewScaleData();
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
watch(() => props.scrollElement, () => {
|
|
209
|
-
getViewScaleData();
|
|
210
|
-
props.scrollElement.addEventListener("scroll", () => {
|
|
211
|
-
getViewScaleData();
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
return {
|
|
215
|
-
viewSCaleData,
|
|
216
|
-
scaleWidth,
|
|
217
|
-
addMilestone,
|
|
218
|
-
highlight,
|
|
219
|
-
highlightStartText,
|
|
220
|
-
highlightEndText
|
|
221
|
-
};
|
|
222
|
-
},
|
|
223
|
-
render() {
|
|
224
|
-
const {
|
|
225
|
-
unit,
|
|
226
|
-
viewSCaleData,
|
|
227
|
-
scaleWidth,
|
|
228
|
-
addMilestone,
|
|
229
|
-
highlight,
|
|
230
|
-
highlightStartText,
|
|
231
|
-
highlightEndText,
|
|
232
|
-
ganttBarContainerElement
|
|
233
|
-
} = this;
|
|
234
|
-
return createVNode("div", {
|
|
235
|
-
"class": "devui-gantt-scale-wrapper"
|
|
236
|
-
}, [viewSCaleData.map((data, index2) => withDirectives(createVNode("div", {
|
|
237
|
-
"class": `devui-gantt-scale ${unit} ${data.today} ${data.milestone}`,
|
|
238
|
-
"style": {
|
|
239
|
-
left: `${scaleWidth[unit] * data.index}px`,
|
|
240
|
-
width: `${scaleWidth[unit]}px`
|
|
241
|
-
}
|
|
242
|
-
}, [createVNode("div", {
|
|
243
|
-
"class": `devui-scale-start ${data.milestone}`
|
|
244
|
-
}, [data.milestone && unit === "day" && createVNode("div", null, [data.milestone]), (!data.milestone || unit !== "day") && data.scaleStartVisable && (index2 === 0 || data.monthStart) ? unit === "month" ? i18nText.zh.yearDisplay(data.yearLabel) : i18nText.zh.yearAndMonthDisplay(data.yearLabel, data.monthLabel) : ""]), createVNode("div", {
|
|
245
|
-
"class": "devui-scale-unit"
|
|
246
|
-
}, [highlight && data.highlightStart && createVNode("div", {
|
|
247
|
-
"class": "scale-highlight"
|
|
248
|
-
}, [createVNode("div", {
|
|
249
|
-
"style": "float: left"
|
|
250
|
-
}, [highlightStartText]), createVNode("div", {
|
|
251
|
-
"style": "float: right"
|
|
252
|
-
}, [highlightEndText]), createVNode("div", {
|
|
253
|
-
"style": "clear: both"
|
|
254
|
-
}, null)]), (!highlight || !data.highlightStart) && unit === "day" && createVNode("div", {
|
|
255
|
-
"class": `border-left ${data.today ? "today" : ""}`
|
|
256
|
-
}, [data.today ? i18nText.zh.today : data.dayOfMonthLabel]), (!highlight || !data.highlightStart) && unit === "week" && createVNode("div", {
|
|
257
|
-
"class": `${data.weekend || index2 === 0 ? "border-left" : ""}`
|
|
258
|
-
}, [index2 === 0 || data.weekend ? data.dayOfMonthLabel : ""]), (!highlight || !data.highlightStart) && unit === "month" && createVNode("div", {
|
|
259
|
-
"class": `${data.monthStart || index2 === 0 ? "border-left" : ""}`
|
|
260
|
-
}, [index2 === 0 || data.monthStart ? i18nText.zh.monthDisplay(data.monthLabel) : ""])]), createVNode("div", {
|
|
261
|
-
"class": `milestone-new ${unit}`,
|
|
262
|
-
"title": "milestone",
|
|
263
|
-
"onClick": () => addMilestone(data)
|
|
264
|
-
}, [createVNode(resolveComponent("d-icon"), {
|
|
265
|
-
"name": "add"
|
|
266
|
-
}, null)])]), [[resolveDirective("gantt-marker"), {
|
|
267
|
-
ganttBarContainerElement,
|
|
268
|
-
monthMark: data.monthMark,
|
|
269
|
-
weekend: data.weekend,
|
|
270
|
-
milestone: data.milestone,
|
|
271
|
-
today: data.today,
|
|
272
|
-
date: data.date,
|
|
273
|
-
unit,
|
|
274
|
-
last: index2 === viewSCaleData.length - 1
|
|
275
|
-
}]]))]);
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
var ganttTools = "";
|
|
279
|
-
var GanttTools = defineComponent({
|
|
280
|
-
name: "DGanttTools",
|
|
281
|
-
props: {
|
|
282
|
-
unit: {
|
|
283
|
-
type: String,
|
|
284
|
-
default: null
|
|
285
|
-
},
|
|
286
|
-
isFullScreen: {
|
|
287
|
-
type: Boolean,
|
|
288
|
-
default: false
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
emits: ["goToday", "reduceUnit", "increaseUnit", "switchView"],
|
|
292
|
-
setup(props, ctx) {
|
|
293
|
-
const currentUnitLabel = ref(props.unit);
|
|
294
|
-
const views = ref([{
|
|
295
|
-
name: "Day",
|
|
296
|
-
value: "day"
|
|
297
|
-
}, {
|
|
298
|
-
name: "Week",
|
|
299
|
-
value: "week"
|
|
300
|
-
}, {
|
|
301
|
-
name: "Month",
|
|
302
|
-
value: "month"
|
|
303
|
-
}]);
|
|
304
|
-
const actionHandle = (type) => {
|
|
305
|
-
switch (type) {
|
|
306
|
-
case "today":
|
|
307
|
-
ctx.emit("goToday");
|
|
308
|
-
break;
|
|
309
|
-
case "reduce":
|
|
310
|
-
ctx.emit("reduceUnit");
|
|
311
|
-
break;
|
|
312
|
-
case "increase":
|
|
313
|
-
ctx.emit("increaseUnit");
|
|
314
|
-
break;
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
const selectView = (selectItem) => {
|
|
318
|
-
ctx.emit("switchView", selectItem.value);
|
|
319
|
-
};
|
|
320
|
-
return {
|
|
321
|
-
actionHandle,
|
|
322
|
-
currentUnitLabel,
|
|
323
|
-
views,
|
|
324
|
-
selectView
|
|
325
|
-
};
|
|
326
|
-
},
|
|
327
|
-
render() {
|
|
328
|
-
const {
|
|
329
|
-
isFullScreen,
|
|
330
|
-
actionHandle,
|
|
331
|
-
views,
|
|
332
|
-
selectView,
|
|
333
|
-
$slots
|
|
334
|
-
} = this;
|
|
335
|
-
return createVNode("div", {
|
|
336
|
-
"class": "tools-container",
|
|
337
|
-
"style": {
|
|
338
|
-
position: isFullScreen ? "fixed" : "absolute"
|
|
339
|
-
}
|
|
340
|
-
}, [createVNode(resolveComponent("d-button"), {
|
|
341
|
-
"variant": "common",
|
|
342
|
-
"onClick": () => actionHandle("today"),
|
|
343
|
-
"class": "tool"
|
|
344
|
-
}, {
|
|
345
|
-
default: () => [createTextVNode("Today")]
|
|
346
|
-
}), createVNode("div", {
|
|
347
|
-
"class": "tool"
|
|
348
|
-
}, [createVNode(resolveComponent("d-select"), {
|
|
349
|
-
"modelValue": this.currentUnitLabel,
|
|
350
|
-
"onUpdate:modelValue": ($event) => this.currentUnitLabel = $event,
|
|
351
|
-
"options": views,
|
|
352
|
-
"onValueChange": selectView
|
|
353
|
-
}, null)]), createVNode(resolveComponent("d-button"), {
|
|
354
|
-
"variant": "common",
|
|
355
|
-
"class": ["tool", "minus", this.currentUnitLabel === GanttScaleUnit.day ? "disabled" : ""],
|
|
356
|
-
"disabled": this.currentUnitLabel === GanttScaleUnit.day,
|
|
357
|
-
"onClick": () => actionHandle("reduce")
|
|
358
|
-
}, {
|
|
359
|
-
default: () => [createVNode(resolveComponent("d-icon"), {
|
|
360
|
-
"name": "minus"
|
|
361
|
-
}, null)]
|
|
362
|
-
}), createVNode(resolveComponent("d-button"), {
|
|
363
|
-
"variant": "common",
|
|
364
|
-
"class": ["tool", "add", this.currentUnitLabel === GanttScaleUnit.month ? "disabled" : ""],
|
|
365
|
-
"disabled": this.currentUnitLabel === GanttScaleUnit.month,
|
|
366
|
-
"onClick": () => actionHandle("increase")
|
|
367
|
-
}, {
|
|
368
|
-
default: () => [createVNode(resolveComponent("d-icon"), {
|
|
369
|
-
"name": "add"
|
|
370
|
-
}, null)]
|
|
371
|
-
}), $slots.default && $slots.default()]);
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
const ganttProps = {
|
|
375
|
-
startDate: {
|
|
376
|
-
type: Date
|
|
377
|
-
},
|
|
378
|
-
endDate: {
|
|
379
|
-
type: Date
|
|
380
|
-
},
|
|
381
|
-
unit: {
|
|
382
|
-
type: String,
|
|
383
|
-
default: GanttScaleUnit.day
|
|
384
|
-
},
|
|
385
|
-
progressRate: {
|
|
386
|
-
type: Number
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
var gantt = "";
|
|
390
|
-
const useGantt = (scaleUnit = GanttScaleUnit.day) => {
|
|
391
|
-
const DAY_DURATION = 24 * 60 * 60 * 1e3;
|
|
392
|
-
const getScaleUnitPixel = () => {
|
|
393
|
-
switch (scaleUnit) {
|
|
394
|
-
case GanttScaleUnit.day:
|
|
395
|
-
return 40;
|
|
396
|
-
case GanttScaleUnit.week:
|
|
397
|
-
return 30;
|
|
398
|
-
case GanttScaleUnit.month:
|
|
399
|
-
return 20;
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
const getDuration = (startDate, endDate) => {
|
|
403
|
-
if (startDate && endDate) {
|
|
404
|
-
const timeOffset = endDate.getTime() - startDate.getTime();
|
|
405
|
-
const duration = timeOffset / DAY_DURATION + 1;
|
|
406
|
-
console.log("duration => ", duration);
|
|
407
|
-
return Math.round(duration);
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
const getDurationWidth = (startDate, endDate) => {
|
|
411
|
-
if (startDate && endDate) {
|
|
412
|
-
const duration = getDuration(startDate, endDate);
|
|
413
|
-
return duration * getScaleUnitPixel();
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
return {
|
|
417
|
-
getDurationWidth
|
|
418
|
-
};
|
|
419
|
-
};
|
|
420
|
-
var Gantt = defineComponent({
|
|
421
|
-
name: "DGantt",
|
|
422
|
-
components: {
|
|
423
|
-
DGanttScale,
|
|
424
|
-
DGanttTools: GanttTools
|
|
425
|
-
},
|
|
426
|
-
props: ganttProps,
|
|
427
|
-
setup(props, ctx) {
|
|
428
|
-
const {
|
|
429
|
-
startDate,
|
|
430
|
-
endDate
|
|
431
|
-
} = toRefs(props);
|
|
432
|
-
const ganttContainer = ref();
|
|
433
|
-
const ganttScaleWidth = ref();
|
|
434
|
-
const {
|
|
435
|
-
getDurationWidth
|
|
436
|
-
} = useGantt();
|
|
437
|
-
onMounted(() => {
|
|
438
|
-
ganttScaleWidth.value = getDurationWidth(startDate.value, endDate.value);
|
|
439
|
-
});
|
|
440
|
-
return {
|
|
441
|
-
ganttContainer,
|
|
442
|
-
ganttScaleWidth
|
|
443
|
-
};
|
|
444
|
-
},
|
|
445
|
-
render() {
|
|
446
|
-
const {
|
|
447
|
-
$slots,
|
|
448
|
-
startDate,
|
|
449
|
-
endDate,
|
|
450
|
-
unit,
|
|
451
|
-
ganttContainer,
|
|
452
|
-
ganttScaleWidth
|
|
453
|
-
} = this;
|
|
454
|
-
return createVNode("div", {
|
|
455
|
-
"style": {
|
|
456
|
-
position: "relative"
|
|
457
|
-
}
|
|
458
|
-
}, [createVNode("div", {
|
|
459
|
-
"class": "devui-gantt gantt-container",
|
|
460
|
-
"ref": "ganttContainer"
|
|
461
|
-
}, [createVNode("div", {
|
|
462
|
-
"class": "header",
|
|
463
|
-
"style": {
|
|
464
|
-
width: `${ganttScaleWidth}px`
|
|
465
|
-
}
|
|
466
|
-
}, [createVNode(resolveComponent("d-gantt-scale"), {
|
|
467
|
-
"startDate": startDate,
|
|
468
|
-
"endDate": endDate,
|
|
469
|
-
"unit": unit,
|
|
470
|
-
"scrollElement": ganttContainer
|
|
471
|
-
}, null)]), createVNode(resolveComponent("d-gantt-tools"), {
|
|
472
|
-
"unit": unit
|
|
473
|
-
}, null), createVNode("div", {
|
|
474
|
-
"class": "body",
|
|
475
|
-
"style": {
|
|
476
|
-
width: `${ganttScaleWidth}px`
|
|
477
|
-
}
|
|
478
|
-
}, null)])]);
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
const ganttMarkerDirective = {
|
|
482
|
-
ganttBarContainerElement: null,
|
|
483
|
-
monthMarkElement: null,
|
|
484
|
-
weekendElement: null,
|
|
485
|
-
todayElement: null,
|
|
486
|
-
milestoneElement: null,
|
|
487
|
-
monthMark: "",
|
|
488
|
-
mounted(el, binding) {
|
|
489
|
-
const { ganttBarContainerElement, monthMark } = binding.value;
|
|
490
|
-
if (ganttBarContainerElement) {
|
|
491
|
-
this.ganttBarContainerElement = ganttBarContainerElement;
|
|
492
|
-
}
|
|
493
|
-
if (monthMark) {
|
|
494
|
-
this.monthMark = this.monthMark;
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
updated(el, binding) {
|
|
498
|
-
const { monthMark, weekend, today, milestone, unit } = binding.value;
|
|
499
|
-
if (monthMark) {
|
|
500
|
-
this.initMarkElement();
|
|
501
|
-
}
|
|
502
|
-
},
|
|
503
|
-
initMarkElement() {
|
|
504
|
-
if (this.ganttBarContainerElement) {
|
|
505
|
-
if (this.monthMark && !this.monthMarkElement)
|
|
506
|
-
;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
Gantt.install = function(app) {
|
|
511
|
-
app.component(Gantt.name, Gantt);
|
|
512
|
-
app.component(GanttTools.name, GanttTools);
|
|
513
|
-
app.directive("gantt-marker", ganttMarkerDirective);
|
|
514
|
-
};
|
|
515
|
-
var index = {
|
|
516
|
-
title: "Gantt \u7518\u7279\u56FE",
|
|
517
|
-
category: "\u6570\u636E\u5C55\u793A",
|
|
518
|
-
status: "10%",
|
|
519
|
-
install(app) {
|
|
520
|
-
app.use(Gantt);
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
export { Gantt, index as default };
|
package/gantt/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(u,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.index={},u.Vue))})(this,function(u,e){"use strict";var U="",h=(t=>(t.day="day",t.week="week",t.month="month",t))(h||{});const p=(t,o)=>t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()&&t.getDate()===o.getDate(),N=t=>{const r=(a,l)=>{const i={dayOfMonthLabel:"",dayOfWeekLabel:"",monthLabel:"",yearLabel:"",date:a,monthStart:!1,weekend:!1,today:!1,milestone:"",highlightStart:!1,scaleStartVisable:!0,index:l},n=a.getDate();i.dayOfMonthLabel=n+"",n===1&&(i.monthStart=!0);const d=a.getDay();i.dayOfWeekLabel=d+"",d===6&&(i.weekend=!0);const m=a.getMonth()+1;i.monthLabel=m+"";const D=a.getFullYear();return i.yearLabel=D+"",p(a,new Date)&&(i.today=!0),new Date(D,m-1,n+7).getMonth()>m-1&&(i.scaleStartVisable=!1),t.value&&t.value.forEach(f=>{f.date&&p(f.date,i.date)&&(i.milestone=f.lable)}),i},s=a=>{const l=a.setDate(a.getDate()+1);return new Date(l)};return{generateScaleData:(a,l)=>{const i=[];let n=a,d=0;for(;!p(n,l);){const m=r(n,d);i.push(m),n=s(new Date(n)),d++}return console.log({scaleData:i}),i}}},g={en:{today:"today",monthsOfYear:["January","February","March","April","May","June","July","August","September","October","November","December"],yearDisplay(t){return`${t}`},monthDisplay(t){return this.monthsOfYear[Number(t)-1]},yearAndMonthDisplay(t,o){return this.yearDisplay(t)+this.monthDisplay(o)}},zh:{today:"\u4ECA\u5929",monthsOfYear:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],yearDisplay(t){return`${t}\u5E74`},monthDisplay(t){return this.monthsOfYear[Number(t)-1]},yearAndMonthDisplay(t,o){return this.yearDisplay(t)+this.monthDisplay(o)}}};var C=e.defineComponent({name:"DGanttScale",props:{unit:{type:String,default:h.day},height:{type:Number},startDate:{type:Date},endDate:{type:Date},ganttScaleContainerOffsetLeft:{type:Number},milestoneList:{type:Array},scrollElement:{type:Object},ganttBarContainerElement:{type:Object}},emits:["addMilestone"],setup(t,o){const{startDate:r,endDate:s,milestoneList:c,scrollElement:a,unit:l}=e.toRefs(t),i=e.ref([]),n=e.ref([]),d=e.ref({day:40,week:30,month:20}),m=e.ref(!1),D=e.ref(""),f=e.ref(""),{generateScaleData:O}=N(c);let S=[0,0];const A=w=>{o.emit("addMilestone",w)},V=()=>{if(a.value){const w=a.value.clientWidth,$=a.value.scrollLeft,k=Math.floor($/d.value[l.value]),x=Math.ceil(w/d.value[l.value]);S=[k-2,k+x+2],n.value=i.value.filter(M=>M.index>=S[0]&&M.index<=S[1])}};return e.onMounted(()=>{r.value&&s.value&&(i.value=O(r.value,s.value),V())}),e.watch(()=>t.scrollElement,()=>{V(),t.scrollElement.addEventListener("scroll",()=>{V()})}),{viewSCaleData:n,scaleWidth:d,addMilestone:A,highlight:m,highlightStartText:D,highlightEndText:f}},render(){const{unit:t,viewSCaleData:o,scaleWidth:r,addMilestone:s,highlight:c,highlightStartText:a,highlightEndText:l,ganttBarContainerElement:i}=this;return e.createVNode("div",{class:"devui-gantt-scale-wrapper"},[o.map((n,d)=>e.withDirectives(e.createVNode("div",{class:`devui-gantt-scale ${t} ${n.today} ${n.milestone}`,style:{left:`${r[t]*n.index}px`,width:`${r[t]}px`}},[e.createVNode("div",{class:`devui-scale-start ${n.milestone}`},[n.milestone&&t==="day"&&e.createVNode("div",null,[n.milestone]),(!n.milestone||t!=="day")&&n.scaleStartVisable&&(d===0||n.monthStart)?t==="month"?g.zh.yearDisplay(n.yearLabel):g.zh.yearAndMonthDisplay(n.yearLabel,n.monthLabel):""]),e.createVNode("div",{class:"devui-scale-unit"},[c&&n.highlightStart&&e.createVNode("div",{class:"scale-highlight"},[e.createVNode("div",{style:"float: left"},[a]),e.createVNode("div",{style:"float: right"},[l]),e.createVNode("div",{style:"clear: both"},null)]),(!c||!n.highlightStart)&&t==="day"&&e.createVNode("div",{class:`border-left ${n.today?"today":""}`},[n.today?g.zh.today:n.dayOfMonthLabel]),(!c||!n.highlightStart)&&t==="week"&&e.createVNode("div",{class:`${n.weekend||d===0?"border-left":""}`},[d===0||n.weekend?n.dayOfMonthLabel:""]),(!c||!n.highlightStart)&&t==="month"&&e.createVNode("div",{class:`${n.monthStart||d===0?"border-left":""}`},[d===0||n.monthStart?g.zh.monthDisplay(n.monthLabel):""])]),e.createVNode("div",{class:`milestone-new ${t}`,title:"milestone",onClick:()=>s(n)},[e.createVNode(e.resolveComponent("d-icon"),{name:"add"},null)])]),[[e.resolveDirective("gantt-marker"),{ganttBarContainerElement:i,monthMark:n.monthMark,weekend:n.weekend,milestone:n.milestone,today:n.today,date:n.date,unit:t,last:d===o.length-1}]]))])}}),W="",b=e.defineComponent({name:"DGanttTools",props:{unit:{type:String,default:null},isFullScreen:{type:Boolean,default:!1}},emits:["goToday","reduceUnit","increaseUnit","switchView"],setup(t,o){const r=e.ref(t.unit),s=e.ref([{name:"Day",value:"day"},{name:"Week",value:"week"},{name:"Month",value:"month"}]);return{actionHandle:l=>{switch(l){case"today":o.emit("goToday");break;case"reduce":o.emit("reduceUnit");break;case"increase":o.emit("increaseUnit");break}},currentUnitLabel:r,views:s,selectView:l=>{o.emit("switchView",l.value)}}},render(){const{isFullScreen:t,actionHandle:o,views:r,selectView:s,$slots:c}=this;return e.createVNode("div",{class:"tools-container",style:{position:t?"fixed":"absolute"}},[e.createVNode(e.resolveComponent("d-button"),{variant:"common",onClick:()=>o("today"),class:"tool"},{default:()=>[e.createTextVNode("Today")]}),e.createVNode("div",{class:"tool"},[e.createVNode(e.resolveComponent("d-select"),{modelValue:this.currentUnitLabel,"onUpdate:modelValue":a=>this.currentUnitLabel=a,options:r,onValueChange:s},null)]),e.createVNode(e.resolveComponent("d-button"),{variant:"common",class:["tool","minus",this.currentUnitLabel===h.day?"disabled":""],disabled:this.currentUnitLabel===h.day,onClick:()=>o("reduce")},{default:()=>[e.createVNode(e.resolveComponent("d-icon"),{name:"minus"},null)]}),e.createVNode(e.resolveComponent("d-button"),{variant:"common",class:["tool","add",this.currentUnitLabel===h.month?"disabled":""],disabled:this.currentUnitLabel===h.month,onClick:()=>o("increase")},{default:()=>[e.createVNode(e.resolveComponent("d-icon"),{name:"add"},null)]}),c.default&&c.default()])}});const E={startDate:{type:Date},endDate:{type:Date},unit:{type:String,default:h.day},progressRate:{type:Number}};var F="";const L=(t=h.day)=>{const r=()=>{switch(t){case h.day:return 40;case h.week:return 30;case h.month:return 20}},s=(a,l)=>{if(a&&l){const n=(l.getTime()-a.getTime())/864e5+1;return console.log("duration => ",n),Math.round(n)}};return{getDurationWidth:(a,l)=>{if(a&&l)return s(a,l)*r()}}};var y=e.defineComponent({name:"DGantt",components:{DGanttScale:C,DGanttTools:b},props:E,setup(t,o){const{startDate:r,endDate:s}=e.toRefs(t),c=e.ref(),a=e.ref(),{getDurationWidth:l}=L();return e.onMounted(()=>{a.value=l(r.value,s.value)}),{ganttContainer:c,ganttScaleWidth:a}},render(){const{$slots:t,startDate:o,endDate:r,unit:s,ganttContainer:c,ganttScaleWidth:a}=this;return e.createVNode("div",{style:{position:"relative"}},[e.createVNode("div",{class:"devui-gantt gantt-container",ref:"ganttContainer"},[e.createVNode("div",{class:"header",style:{width:`${a}px`}},[e.createVNode(e.resolveComponent("d-gantt-scale"),{startDate:o,endDate:r,unit:s,scrollElement:c},null)]),e.createVNode(e.resolveComponent("d-gantt-tools"),{unit:s},null),e.createVNode("div",{class:"body",style:{width:`${a}px`}},null)])])}});const v={ganttBarContainerElement:null,monthMarkElement:null,weekendElement:null,todayElement:null,milestoneElement:null,monthMark:"",mounted(t,o){const{ganttBarContainerElement:r,monthMark:s}=o.value;r&&(this.ganttBarContainerElement=r),s&&(this.monthMark=this.monthMark)},updated(t,o){const{monthMark:r,weekend:s,today:c,milestone:a,unit:l}=o.value;r&&this.initMarkElement()},initMarkElement(){this.ganttBarContainerElement&&this.monthMark&&!this.monthMarkElement}};y.install=function(t){t.component(y.name,y),t.component(b.name,b),t.directive("gantt-marker",v)};var T={title:"Gantt \u7518\u7279\u56FE",category:"\u6570\u636E\u5C55\u793A",status:"10%",install(t){t.use(y)}};u.Gantt=y,u.default=T,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
|
package/gantt/package.json
DELETED
package/gantt/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.devui-gantt-scale-wrapper{display:block;height:36px;line-height:18px}.devui-gantt-scale{display:inline-block;color:var(--devui-placeholder, #8a8e99);text-align:center;position:absolute;height:36px;font-weight:400}.devui-gantt-scale.day:not(.milestone):hover .devui-scale-start{display:none}.devui-gantt-scale.day.milestone{background-image:linear-gradient(180deg,rgba(254,204,85,0) 0%,rgba(62,204,166,.1) 100%)}.devui-gantt-scale .devui-scale-start{width:100%;height:18px;position:absolute;left:1px;white-space:nowrap}.devui-gantt-scale .devui-scale-start.milestone{color:var(--devui-success, #50d4ab)}.devui-gantt-scale .devui-scale-unit{height:18px;position:absolute;top:18px;width:100%}.devui-gantt-scale .devui-scale-unit .border-left{height:18px;border-left:1px solid var(--devui-list-item-selected-bg, #e9edfa)}.devui-gantt-scale .devui-scale-unit .scale-highlight{position:absolute;height:18px;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-brand, #5e7ce0);padding:0 4px}.devui-gantt-scale .devui-scale-unit .scale-highlight div{color:var(--devui-base-bg, #ffffff);font-size:var(--devui-font-size, 12px);font-weight:400}.devui-gantt-scale .devui-scale-unit .today{background:rgba(255,121,14,.2);border-radius:var(--devui-border-radius, 2px);height:16px}.devui-gantt-scale .milestone-new{display:none;position:absolute;width:18px;height:18px;margin-left:16px;border:1px solid var(--devui-list-item-selected-bg, #e9edfa);cursor:pointer}.devui-gantt-scale .milestone-new div{line-height:16px}.devui-gantt-scale:not(.milestone):hover .milestone-new.day{display:block}.devui-mark-line{position:absolute;top:0;bottom:0;width:2px;z-index:1;background:var(--devui-line, #adb0b8);opacity:.5}.devui-mark-line.today{opacity:.2;background:#ff790e}.devui-mark-line.today.day{margin-left:24px}.devui-mark-line.today.week{margin-left:9px}.devui-mark-line.today.month{margin-left:4px}.devui-mark-line.milestone{opacity:.2;background:var(--devui-success, #50d4ab)}.devui-mark-line.milestone.day{margin-left:24px}.devui-mark-line.milestone.week{margin-left:9px}.devui-mark-line.milestone.month{margin-left:4px}.devui-mark-stripe{position:absolute;top:0;bottom:0;z-index:1;background:linear-gradient(45deg,rgba(202,207,216,.2) 0,rgba(202,207,216,.2) 10%,transparent 10%,transparent 50%,rgba(202,207,216,.2) 50%,rgba(202,207,216,.2) 60%,transparent 60%,transparent);background-size:6px 6px}.devui-mark-stripe.day{width:100px}.devui-mark-stripe.week{width:40px}.devui-mark-stripe.month{width:20px}.tools-container{position:absolute;top:70px;right:20px;z-index:10}.tools-container .devui-dropdown-origin{border:0}.tools-container .devui-dropdown-origin:hover{color:var(--devui-link, #526ecc)!important}.tools-container .devui-btn{height:32px!important;color:var(--devui-text, #252b3a)!important;padding:0 8px!important;min-width:50px}.tools-container .devui-btn:hover{color:var(--devui-link, #526ecc)!important}.tools-container .tool.minus .devui-btn,.tools-container .tool.add .devui-btn{min-width:30px}.tools-container .devui-select-selection{width:90px}.tools-container .devui-select-selection .devui-select-input{height:32px}.tool.disabled{opacity:.5}.tool .switch-view{padding:0 8px}.tool .switch-view:hover{color:var(--devui-link, #526ecc)!important}.devui-dropdown-menu{top:10px!important;left:-6px!important}.gantt-container{overflow:scroll}.gantt-container .header{position:relative;border-bottom:1px solid var(--devui-dividing-line, #dfe1e6)}.gantt-container .body{position:relative;min-height:400px;height:100%}.gantt-container .body .item{height:40px;padding-top:8px}.tool{display:inline-flex;align-items:center;justify-content:center;height:32px;margin-left:12px;background-color:var(--devui-base-bg, #ffffff);box-shadow:var(--devui-shadow-length-base, 0 1px 4px 0) #5170ff66;cursor:pointer}.tool span{border:0!important}
|