@zgfe/business-lib 1.2.51-ljy.9 → 1.2.51-plat.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/assets/iconfont/demo_index.html +3 -187
- package/es/assets/iconfont/iconfont.css +3 -35
- package/es/assets/iconfont/iconfont.js +7 -7
- package/es/assets/iconfont/iconfont.json +0 -56
- package/es/assets/iconfont/iconfont.ttf +0 -0
- package/es/assets/iconfont/iconfont.woff +0 -0
- package/es/assets/iconfont/iconfont.woff2 +0 -0
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/{datePickerOld → platformSelector}/demo/index.d.ts +0 -1
- package/es/platformSelector/demo/index.js +16 -0
- package/es/platformSelector/index.d.ts +16 -0
- package/es/{datePickerOld/demo → platformSelector}/index.js +37 -35
- package/es/platformSelector/styles/index.less +9 -0
- package/es/platformSelector/types.d.ts +6 -0
- package/es/platformSelector/types.js +1 -0
- package/es/platformSelector/util.d.ts +2 -0
- package/es/platformSelector/util.js +44 -0
- package/es/table/font_2545884_ievcoe4sky/demo.css +539 -0
- package/es/table/font_2545884_ievcoe4sky/demo_index.html +4857 -0
- package/es/table/font_2545884_ievcoe4sky/iconfont.css +827 -0
- package/es/table/font_2545884_ievcoe4sky/iconfont.js +43 -0
- package/es/table/font_2545884_ievcoe4sky/iconfont.json +1430 -0
- package/es/table/font_2545884_ievcoe4sky/iconfont.ttf +0 -0
- package/es/table/font_2545884_ievcoe4sky/iconfont.woff +0 -0
- package/es/table/font_2545884_ievcoe4sky/iconfont.woff2 +0 -0
- package/es/userCondition/conditions/cdpCondition.js +8 -2
- package/es/userCondition/conditions/cdpCshCondition.js +14 -3
- package/es/userCondition/conditions/styles/cdpCondition.less +6 -0
- package/es/userCondition/conditions/styles/cdpCshCondition.less +6 -0
- package/es/userGroup/overlay.js +6 -5
- package/es/userGroupHeader/index.js +1 -1
- package/package.json +3 -3
- package/es/datePickerOld/context.d.ts +0 -15
- package/es/datePickerOld/context.js +0 -3
- package/es/datePickerOld/datePicker.d.ts +0 -7
- package/es/datePickerOld/datePicker.js +0 -149
- package/es/datePickerOld/demo/customType.d.ts +0 -4
- package/es/datePickerOld/demo/customType.js +0 -44
- package/es/datePickerOld/demo/day.d.ts +0 -4
- package/es/datePickerOld/demo/day.js +0 -48
- package/es/datePickerOld/index.d.ts +0 -6
- package/es/datePickerOld/index.js +0 -246
- package/es/datePickerOld/popoverContent.d.ts +0 -14
- package/es/datePickerOld/popoverContent.js +0 -56
- package/es/datePickerOld/shortcut.d.ts +0 -7
- package/es/datePickerOld/shortcut.js +0 -101
- package/es/datePickerOld/styles/index.less +0 -165
- package/es/datePickerOld/types.d.ts +0 -39
- package/es/datePickerOld/types.js +0 -12
- package/es/datePickerOld/utils.d.ts +0 -9
- package/es/datePickerOld/utils.js +0 -129
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import moment from 'moment';
|
|
2
|
-
import { DatePickerTypes } from './types';
|
|
3
|
-
function getAbsoluteDate(unit, count, maxDate) {
|
|
4
|
-
var res = {};
|
|
5
|
-
var dayTime = 24 * 60 * 60 * 1000;
|
|
6
|
-
switch (unit) {
|
|
7
|
-
case DatePickerTypes.Unit.hour:
|
|
8
|
-
res.endDate = res.startDate = moment().subtract(count, 'days').toDate();
|
|
9
|
-
break;
|
|
10
|
-
case DatePickerTypes.Unit.day:
|
|
11
|
-
res.startDate = moment().subtract(count, 'days').toDate();
|
|
12
|
-
count == 1 ? res.endDate = moment().subtract(count, 'days').toDate() : res.endDate = maxDate;
|
|
13
|
-
break;
|
|
14
|
-
case DatePickerTypes.Unit.week:
|
|
15
|
-
res.endDate = maxDate;
|
|
16
|
-
var firstOfWeek = new Date(maxDate.getTime() - (maxDate.getDay() - 1) * dayTime);
|
|
17
|
-
res.startDate = new Date(firstOfWeek.getTime() - count * 7 * dayTime);
|
|
18
|
-
break;
|
|
19
|
-
case DatePickerTypes.Unit.month:
|
|
20
|
-
res.endDate = maxDate;
|
|
21
|
-
var firstOfMonth = new Date(maxDate.getTime() - (maxDate.getDate() - 1) * dayTime);
|
|
22
|
-
firstOfMonth.setMonth(firstOfMonth.getMonth() - count);
|
|
23
|
-
res.startDate = new Date(firstOfMonth);
|
|
24
|
-
break;
|
|
25
|
-
case DatePickerTypes.Unit.quarter:
|
|
26
|
-
res.endDate = maxDate;
|
|
27
|
-
var firstOfQuarter = new Date(maxDate.getTime() - (maxDate.getDate() - 1) * dayTime);
|
|
28
|
-
firstOfQuarter.setMonth(firstOfQuarter.getMonth() - firstOfQuarter.getMonth() % 3 - 3 * (count - 1));
|
|
29
|
-
res.startDate = new Date(firstOfQuarter);
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
return res;
|
|
33
|
-
}
|
|
34
|
-
export var getDateRange = function getDateRange(type, count, includeToday) {
|
|
35
|
-
var maxDate = moment().subtract(includeToday || count == 0 ? 0 : 1, 'days').toDate();
|
|
36
|
-
var res = getAbsoluteDate(type, count, maxDate);
|
|
37
|
-
return {
|
|
38
|
-
begin: moment(res.startDate).format('YYYY-MM-DD'),
|
|
39
|
-
end: moment(res.endDate).format('YYYY-MM-DD')
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export var isTodayInRange = function isTodayInRange(_startDate, _endDate) {
|
|
43
|
-
var startDate = _startDate.format('x');
|
|
44
|
-
var endDate = moment(_endDate).add(1, 'days').format('x');
|
|
45
|
-
var dateToCheck = moment(new Date()).format('x');
|
|
46
|
-
return dateToCheck >= startDate && dateToCheck <= endDate;
|
|
47
|
-
};
|
|
48
|
-
export var getTypeList = function getTypeList(currentType, mode, includeToday) {
|
|
49
|
-
var _shortcuts$find;
|
|
50
|
-
var shortcuts = [{
|
|
51
|
-
label: '按小时',
|
|
52
|
-
value: DatePickerTypes.Unit.hour,
|
|
53
|
-
children: [{
|
|
54
|
-
value: '昨天',
|
|
55
|
-
count: 1
|
|
56
|
-
}, {
|
|
57
|
-
value: '前天',
|
|
58
|
-
count: 2
|
|
59
|
-
}]
|
|
60
|
-
}, {
|
|
61
|
-
label: '按天',
|
|
62
|
-
value: DatePickerTypes.Unit.day,
|
|
63
|
-
children: [{
|
|
64
|
-
value: '今天',
|
|
65
|
-
count: 0
|
|
66
|
-
}, {
|
|
67
|
-
value: '昨天',
|
|
68
|
-
count: 1
|
|
69
|
-
}, {
|
|
70
|
-
value: '7天',
|
|
71
|
-
count: 7
|
|
72
|
-
}, {
|
|
73
|
-
value: '14天',
|
|
74
|
-
count: 14
|
|
75
|
-
}, {
|
|
76
|
-
value: '30天',
|
|
77
|
-
count: 30
|
|
78
|
-
}]
|
|
79
|
-
}, {
|
|
80
|
-
label: '按周',
|
|
81
|
-
value: DatePickerTypes.Unit.week,
|
|
82
|
-
children: [{
|
|
83
|
-
value: '4周',
|
|
84
|
-
count: 4
|
|
85
|
-
}, {
|
|
86
|
-
value: '8周',
|
|
87
|
-
count: 8
|
|
88
|
-
}, {
|
|
89
|
-
value: '12周',
|
|
90
|
-
count: 12
|
|
91
|
-
}]
|
|
92
|
-
}, {
|
|
93
|
-
label: '按月',
|
|
94
|
-
value: DatePickerTypes.Unit.month,
|
|
95
|
-
children: [{
|
|
96
|
-
value: '1个月',
|
|
97
|
-
count: 1
|
|
98
|
-
}, {
|
|
99
|
-
value: '2个月',
|
|
100
|
-
count: 2
|
|
101
|
-
}, {
|
|
102
|
-
value: '3个月',
|
|
103
|
-
count: 3
|
|
104
|
-
}]
|
|
105
|
-
}, {
|
|
106
|
-
label: '按季度',
|
|
107
|
-
value: DatePickerTypes.Unit.quarter,
|
|
108
|
-
children: [{
|
|
109
|
-
value: '1季度',
|
|
110
|
-
count: 1
|
|
111
|
-
}, {
|
|
112
|
-
value: '2季度',
|
|
113
|
-
count: 2
|
|
114
|
-
}, {
|
|
115
|
-
value: '4季度',
|
|
116
|
-
count: 4
|
|
117
|
-
}]
|
|
118
|
-
}];
|
|
119
|
-
var list = (((_shortcuts$find = shortcuts.find(function (item) {
|
|
120
|
-
return item.value === currentType;
|
|
121
|
-
})) === null || _shortcuts$find === void 0 ? void 0 : _shortcuts$find.children) || []).filter(function (item) {
|
|
122
|
-
if (currentType === 'day') {
|
|
123
|
-
if ((mode === 'general' || !includeToday) && (item.count === 0 || item.count === 1)) return false;
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
return true;
|
|
127
|
-
});
|
|
128
|
-
return list;
|
|
129
|
-
};
|