@zgfe/business-lib 1.2.50 → 1.2.51-ljy.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 +661 -17
- package/es/assets/iconfont/iconfont.css +117 -5
- package/es/assets/iconfont/iconfont.js +6 -6
- package/es/assets/iconfont/iconfont.json +200 -4
- 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/datePickerOld/context.d.ts +15 -0
- package/es/datePickerOld/context.js +3 -0
- package/es/datePickerOld/datePicker.d.ts +8 -0
- package/es/datePickerOld/datePicker.js +151 -0
- package/es/datePickerOld/demo/customType.d.ts +4 -0
- package/es/datePickerOld/demo/customType.js +44 -0
- package/es/datePickerOld/demo/day.d.ts +4 -0
- package/es/datePickerOld/demo/day.js +48 -0
- package/es/datePickerOld/demo/index.d.ts +4 -0
- package/es/datePickerOld/demo/index.js +41 -0
- package/es/datePickerOld/index.d.ts +6 -0
- package/es/datePickerOld/index.js +218 -0
- package/es/datePickerOld/popoverContent.d.ts +11 -0
- package/es/datePickerOld/popoverContent.js +48 -0
- package/es/datePickerOld/shortcut.d.ts +7 -0
- package/es/datePickerOld/shortcut.js +202 -0
- package/es/datePickerOld/styles/index.less +165 -0
- package/es/datePickerOld/types.d.ts +39 -0
- package/es/datePickerOld/types.js +12 -0
- package/es/datePickerOld/utils.d.ts +7 -0
- package/es/datePickerOld/utils.js +47 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/package.json +3 -3
|
@@ -5,6 +5,202 @@
|
|
|
5
5
|
"css_prefix_text": "",
|
|
6
6
|
"description": "诸葛业务平台",
|
|
7
7
|
"glyphs": [
|
|
8
|
+
{
|
|
9
|
+
"icon_id": "41262540",
|
|
10
|
+
"name": "时间",
|
|
11
|
+
"font_class": "shijian",
|
|
12
|
+
"unicode": "e7cd",
|
|
13
|
+
"unicode_decimal": 59341
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"icon_id": "41262538",
|
|
17
|
+
"name": "日历",
|
|
18
|
+
"font_class": "rili",
|
|
19
|
+
"unicode": "e7ce",
|
|
20
|
+
"unicode_decimal": 59342
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"icon_id": "41262539",
|
|
24
|
+
"name": "日历-2",
|
|
25
|
+
"font_class": "rili-2",
|
|
26
|
+
"unicode": "e7cc",
|
|
27
|
+
"unicode_decimal": 59340
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"icon_id": "41214661",
|
|
31
|
+
"name": "鸿蒙",
|
|
32
|
+
"font_class": "hongmeng",
|
|
33
|
+
"unicode": "e64a",
|
|
34
|
+
"unicode_decimal": 58954
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"icon_id": "41211242",
|
|
38
|
+
"name": "其他",
|
|
39
|
+
"font_class": "qita",
|
|
40
|
+
"unicode": "e649",
|
|
41
|
+
"unicode_decimal": 58953
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"icon_id": "41170258",
|
|
45
|
+
"name": "结束",
|
|
46
|
+
"font_class": "jieshu",
|
|
47
|
+
"unicode": "e7cb",
|
|
48
|
+
"unicode_decimal": 59339
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"icon_id": "41168988",
|
|
52
|
+
"name": "消息通知",
|
|
53
|
+
"font_class": "xiaoxitongzhi",
|
|
54
|
+
"unicode": "e7ca",
|
|
55
|
+
"unicode_decimal": 59338
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"icon_id": "41169079",
|
|
59
|
+
"name": "审批",
|
|
60
|
+
"font_class": "shenpi",
|
|
61
|
+
"unicode": "e7c9",
|
|
62
|
+
"unicode_decimal": 59337
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"icon_id": "41153342",
|
|
66
|
+
"name": "上传图片",
|
|
67
|
+
"font_class": "shangchuantupian",
|
|
68
|
+
"unicode": "e648",
|
|
69
|
+
"unicode_decimal": 58952
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"icon_id": "41153408",
|
|
73
|
+
"name": "插入指标",
|
|
74
|
+
"font_class": "charuzhibiao",
|
|
75
|
+
"unicode": "e644",
|
|
76
|
+
"unicode_decimal": 58948
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"icon_id": "41153407",
|
|
80
|
+
"name": "添加标题",
|
|
81
|
+
"font_class": "tianjiabiaoti",
|
|
82
|
+
"unicode": "e645",
|
|
83
|
+
"unicode_decimal": 58949
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"icon_id": "41153406",
|
|
87
|
+
"name": "添加文本",
|
|
88
|
+
"font_class": "tianjiawenben",
|
|
89
|
+
"unicode": "e646",
|
|
90
|
+
"unicode_decimal": 58950
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"icon_id": "41153405",
|
|
94
|
+
"name": "添加图片",
|
|
95
|
+
"font_class": "tianjiatupian",
|
|
96
|
+
"unicode": "e647",
|
|
97
|
+
"unicode_decimal": 58951
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"icon_id": "41047713",
|
|
101
|
+
"name": "js 2",
|
|
102
|
+
"font_class": "a-js2",
|
|
103
|
+
"unicode": "e63f",
|
|
104
|
+
"unicode_decimal": 58943
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"icon_id": "41047712",
|
|
108
|
+
"name": "微信小程序",
|
|
109
|
+
"font_class": "weixinxiaochengxu",
|
|
110
|
+
"unicode": "e640",
|
|
111
|
+
"unicode_decimal": 58944
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"icon_id": "41047711",
|
|
115
|
+
"name": "ios",
|
|
116
|
+
"font_class": "ios1",
|
|
117
|
+
"unicode": "e641",
|
|
118
|
+
"unicode_decimal": 58945
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"icon_id": "41047710",
|
|
122
|
+
"name": "android2",
|
|
123
|
+
"font_class": "android1",
|
|
124
|
+
"unicode": "e642",
|
|
125
|
+
"unicode_decimal": 58946
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"icon_id": "41047709",
|
|
129
|
+
"name": "服务器",
|
|
130
|
+
"font_class": "fuwuqi",
|
|
131
|
+
"unicode": "e643",
|
|
132
|
+
"unicode_decimal": 58947
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"icon_id": "40911670",
|
|
136
|
+
"name": "菜单-用户营销",
|
|
137
|
+
"font_class": "caidan-yonghuyingxiao",
|
|
138
|
+
"unicode": "e63a",
|
|
139
|
+
"unicode_decimal": 58938
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"icon_id": "40624563",
|
|
143
|
+
"name": "菜单-理财业务分析",
|
|
144
|
+
"font_class": "licaiyewufenxi",
|
|
145
|
+
"unicode": "e7c8",
|
|
146
|
+
"unicode_decimal": 59336
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"icon_id": "40533696",
|
|
150
|
+
"name": "菜单-信用卡业务",
|
|
151
|
+
"font_class": "xinyongkayewu1",
|
|
152
|
+
"unicode": "e7c6",
|
|
153
|
+
"unicode_decimal": 59334
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"icon_id": "40533695",
|
|
157
|
+
"name": "菜单-信用卡分期",
|
|
158
|
+
"font_class": "xinyongkafenqi",
|
|
159
|
+
"unicode": "e7c7",
|
|
160
|
+
"unicode_decimal": 59335
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"icon_id": "39969156",
|
|
164
|
+
"name": "LTV 分析",
|
|
165
|
+
"font_class": "a-LTVfenxi",
|
|
166
|
+
"unicode": "e7c5",
|
|
167
|
+
"unicode_decimal": 59333
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"icon_id": "39962950",
|
|
171
|
+
"name": "导航二级箭头",
|
|
172
|
+
"font_class": "daohangerjijiantou",
|
|
173
|
+
"unicode": "e632",
|
|
174
|
+
"unicode_decimal": 58930
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"icon_id": "39962949",
|
|
178
|
+
"name": "导航一级箭头收起",
|
|
179
|
+
"font_class": "daohangyijijiantoushouqi",
|
|
180
|
+
"unicode": "e634",
|
|
181
|
+
"unicode_decimal": 58932
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"icon_id": "39962948",
|
|
185
|
+
"name": "角色交换",
|
|
186
|
+
"font_class": "jiaosejiaohuan",
|
|
187
|
+
"unicode": "e635",
|
|
188
|
+
"unicode_decimal": 58933
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"icon_id": "39962947",
|
|
192
|
+
"name": "导航一级箭头展开",
|
|
193
|
+
"font_class": "daohangyijijiantouzhankai",
|
|
194
|
+
"unicode": "e636",
|
|
195
|
+
"unicode_decimal": 58934
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"icon_id": "39799478",
|
|
199
|
+
"name": "菜单-存款业务分析",
|
|
200
|
+
"font_class": "cunkuanyewu",
|
|
201
|
+
"unicode": "e7c4",
|
|
202
|
+
"unicode_decimal": 59332
|
|
203
|
+
},
|
|
8
204
|
{
|
|
9
205
|
"icon_id": "39634357",
|
|
10
206
|
"name": "埋点",
|
|
@@ -924,8 +1120,8 @@
|
|
|
924
1120
|
},
|
|
925
1121
|
{
|
|
926
1122
|
"icon_id": "31623999",
|
|
927
|
-
"name": "left",
|
|
928
|
-
"font_class": "
|
|
1123
|
+
"name": "数据集-left",
|
|
1124
|
+
"font_class": "shujuji_left",
|
|
929
1125
|
"unicode": "e6d2",
|
|
930
1126
|
"unicode_decimal": 59090
|
|
931
1127
|
},
|
|
@@ -938,8 +1134,8 @@
|
|
|
938
1134
|
},
|
|
939
1135
|
{
|
|
940
1136
|
"icon_id": "31624006",
|
|
941
|
-
"name": "right",
|
|
942
|
-
"font_class": "
|
|
1137
|
+
"name": "数据集-right",
|
|
1138
|
+
"font_class": "shujuji_right",
|
|
943
1139
|
"unicode": "e6d4",
|
|
944
1140
|
"unicode_decimal": 59092
|
|
945
1141
|
},
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { DatePickerTypes } from './types';
|
|
3
|
+
export interface DatePickerContextProps {
|
|
4
|
+
dateRange?: DatePickerTypes.Range;
|
|
5
|
+
setDateRange?: (range: DatePickerTypes.Range) => void;
|
|
6
|
+
includeToday?: boolean;
|
|
7
|
+
mode?: DatePickerTypes.Props['mode'];
|
|
8
|
+
currentType?: DatePickerTypes.Unit;
|
|
9
|
+
relative?: [number, number];
|
|
10
|
+
setRelative?: (relative?: [number, number]) => void;
|
|
11
|
+
setOpen?: Dispatch<SetStateAction<boolean>>;
|
|
12
|
+
setLabel?: Dispatch<SetStateAction<string>>;
|
|
13
|
+
}
|
|
14
|
+
declare const DatePickerContext: import("react").Context<DatePickerContextProps>;
|
|
15
|
+
export default DatePickerContext;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const BizDate: React.ForwardRefExoticComponent<{
|
|
3
|
+
selectRange?: number | undefined;
|
|
4
|
+
timeRangeOpen?: number | undefined;
|
|
5
|
+
selectRangeUnit?: "quarter" | "months" | "weeks" | "days" | undefined;
|
|
6
|
+
onOpenChange?: ((data: boolean) => void) | undefined;
|
|
7
|
+
} & React.RefAttributes<any>>;
|
|
8
|
+
export default BizDate;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { DatePicker, message } from 'antd';
|
|
8
|
+
import moment from 'moment';
|
|
9
|
+
import React, { useContext, useState, useEffect, useImperativeHandle } from 'react';
|
|
10
|
+
import { classPrefix } from '.';
|
|
11
|
+
import IconFont from '../icon/iconFont';
|
|
12
|
+
import { DatePickerTypes } from './types';
|
|
13
|
+
import locale from 'antd/es/date-picker/locale/zh_CN';
|
|
14
|
+
import DatePickerContext from './context';
|
|
15
|
+
import BizGlobalDataContext from '../context';
|
|
16
|
+
import { isTodayInRange } from './utils';
|
|
17
|
+
import _ from 'lodash';
|
|
18
|
+
var RangePicker = DatePicker.RangePicker;
|
|
19
|
+
var BizDateBeyondRange = false;
|
|
20
|
+
var BizDate = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
21
|
+
var selectRange = _ref.selectRange,
|
|
22
|
+
selectRangeUnit = _ref.selectRangeUnit,
|
|
23
|
+
_onOpenChange = _ref.onOpenChange,
|
|
24
|
+
timeRangeOpen = _ref.timeRangeOpen;
|
|
25
|
+
var _useContext = useContext(DatePickerContext),
|
|
26
|
+
includeToday = _useContext.includeToday,
|
|
27
|
+
currentType = _useContext.currentType,
|
|
28
|
+
dateRange = _useContext.dateRange,
|
|
29
|
+
setRelative = _useContext.setRelative;
|
|
30
|
+
var _useContext2 = useContext(BizGlobalDataContext),
|
|
31
|
+
envs = _useContext2.envs;
|
|
32
|
+
function disabledDate(current) {
|
|
33
|
+
var step = includeToday ? 0 : 1;
|
|
34
|
+
var max = moment().subtract(step, 'days');
|
|
35
|
+
var _timeRangeOpen = timeRangeOpen || 12;
|
|
36
|
+
if (envs === null || envs === void 0 ? void 0 : envs.timeRangeOpen) {
|
|
37
|
+
_timeRangeOpen = typeof (envs === null || envs === void 0 ? void 0 : envs.timeRangeOpen) === 'boolean' ? (envs === null || envs === void 0 ? void 0 : envs.timeRangeOpen) ? 200 : 12 : envs === null || envs === void 0 ? void 0 : envs.timeRangeOpen;
|
|
38
|
+
}
|
|
39
|
+
var min = moment(max).subtract(_timeRangeOpen, 'month');
|
|
40
|
+
return current > max || current < min;
|
|
41
|
+
}
|
|
42
|
+
var _useState = useState(),
|
|
43
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
+
value = _useState2[0],
|
|
45
|
+
setValue = _useState2[1];
|
|
46
|
+
var _useState3 = useState('个月'),
|
|
47
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
|
+
selectRangeUnitText = _useState4[0],
|
|
49
|
+
setSelectRangeUnitText = _useState4[1];
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
if (selectRangeUnit) {
|
|
52
|
+
switch (selectRangeUnit) {
|
|
53
|
+
case 'days':
|
|
54
|
+
setSelectRangeUnitText('天');
|
|
55
|
+
break;
|
|
56
|
+
case 'weeks':
|
|
57
|
+
setSelectRangeUnitText('周');
|
|
58
|
+
break;
|
|
59
|
+
case 'months':
|
|
60
|
+
setSelectRangeUnitText('个月');
|
|
61
|
+
break;
|
|
62
|
+
case 'quarter':
|
|
63
|
+
setSelectRangeUnitText('个季度');
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, [selectRangeUnit]);
|
|
68
|
+
useImperativeHandle(ref, function () {
|
|
69
|
+
return {
|
|
70
|
+
getDateValue: function getDateValue() {
|
|
71
|
+
if (setRelative) setRelative(undefined);
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
if (!dateRange) {
|
|
77
|
+
return /*#__PURE__*/React.createElement(DatePicker, {
|
|
78
|
+
disabled: true
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: "".concat(classPrefix, "-panel")
|
|
83
|
+
}, currentType === DatePickerTypes.Unit.hour ? /*#__PURE__*/React.createElement(DatePicker, {
|
|
84
|
+
value: moment(dateRange.begin, 'YYYY-MM-DD'),
|
|
85
|
+
allowClear: false,
|
|
86
|
+
inputReadOnly: true,
|
|
87
|
+
popupClassName: "".concat(classPrefix, "-drop"),
|
|
88
|
+
locale: locale,
|
|
89
|
+
showToday: false,
|
|
90
|
+
placement: "bottomLeft",
|
|
91
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
|
92
|
+
return trigger.parentNode;
|
|
93
|
+
},
|
|
94
|
+
placeholder: "\u81EA\u5B9A\u4E49",
|
|
95
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
96
|
+
type: 'shijian1'
|
|
97
|
+
}),
|
|
98
|
+
disabledDate: disabledDate,
|
|
99
|
+
open: true,
|
|
100
|
+
onChange: function onChange(date) {
|
|
101
|
+
if (date) {
|
|
102
|
+
setValue({
|
|
103
|
+
begin: date.format('YYYY-MM-DD'),
|
|
104
|
+
end: date.format('YYYY-MM-DD')
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}) : /*#__PURE__*/React.createElement(RangePicker, {
|
|
109
|
+
value: [moment(dateRange.begin, 'YYYY-MM-DD'), moment(dateRange.end, 'YYYY-MM-DD')],
|
|
110
|
+
allowClear: false,
|
|
111
|
+
popupClassName: "".concat(classPrefix, "-drop"),
|
|
112
|
+
inputReadOnly: true,
|
|
113
|
+
locale: locale,
|
|
114
|
+
placement: "bottomLeft",
|
|
115
|
+
separator: '至',
|
|
116
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
117
|
+
type: 'shijian1'
|
|
118
|
+
}),
|
|
119
|
+
format: 'YYYY-MM-DD',
|
|
120
|
+
disabledDate: disabledDate,
|
|
121
|
+
open: true,
|
|
122
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
|
123
|
+
return trigger.parentNode;
|
|
124
|
+
},
|
|
125
|
+
onOpenChange: function onOpenChange(open) {
|
|
126
|
+
if (BizDateBeyondRange) {
|
|
127
|
+
message.error("\u65F6\u95F4\u6BB5\u6700\u5927\u652F\u6301".concat(selectRange ? selectRange : 12).concat(selectRangeUnitText));
|
|
128
|
+
BizDateBeyondRange = false;
|
|
129
|
+
}
|
|
130
|
+
_onOpenChange && _onOpenChange(open);
|
|
131
|
+
},
|
|
132
|
+
onChange: function onChange(value) {
|
|
133
|
+
var subtractDays = 0;
|
|
134
|
+
if (includeToday && value && value.length === 2 && isTodayInRange(value[0], value[1])) {
|
|
135
|
+
subtractDays = 1;
|
|
136
|
+
}
|
|
137
|
+
if (value && value.length === 2 && moment(_.cloneDeep(value[1]).subtract(subtractDays, 'days').format('YYYY-MM-DD')).diff(moment(value[0].format('YYYY-MM-DD')), selectRangeUnit || 'months') >= (selectRange ? selectRange : 12)) {
|
|
138
|
+
BizDateBeyondRange = true;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (value && value.length === 2) {
|
|
142
|
+
BizDateBeyondRange = false;
|
|
143
|
+
setValue({
|
|
144
|
+
begin: value[0].format('YYYY-MM-DD'),
|
|
145
|
+
end: value[1].format('YYYY-MM-DD')
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
150
|
+
});
|
|
151
|
+
export default BizDate;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { BizDatePicker } from '@zgfe/business-lib';
|
|
9
|
+
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
|
+
import { Divider, Switch } from 'antd';
|
|
11
|
+
export default (function () {
|
|
12
|
+
var _useState = useState({
|
|
13
|
+
begin: '2022-05-03',
|
|
14
|
+
end: '2022-05-30',
|
|
15
|
+
relative: [0, 1]
|
|
16
|
+
}),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
time = _useState2[0],
|
|
19
|
+
setTime = _useState2[1];
|
|
20
|
+
var _useState3 = useState(false),
|
|
21
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
22
|
+
includeToday = _useState4[0],
|
|
23
|
+
setIncludeToday = _useState4[1];
|
|
24
|
+
var handleChange = function handleChange(data) {
|
|
25
|
+
setTime(data);
|
|
26
|
+
};
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u5305\u542B\u300C\u4ECA\u5929\u300D: ", /*#__PURE__*/React.createElement(Switch, {
|
|
28
|
+
defaultChecked: includeToday,
|
|
29
|
+
onChange: setIncludeToday
|
|
30
|
+
})), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(BizDatePicker, {
|
|
31
|
+
onChange: handleChange,
|
|
32
|
+
dateTypeList: ['week', 'month', 'quarter', 'custom'],
|
|
33
|
+
includeToday: includeToday,
|
|
34
|
+
defaultValue: time
|
|
35
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(BizDatePicker, {
|
|
36
|
+
onChange: handleChange,
|
|
37
|
+
dateTypeList: ['week', 'month', 'quarter'],
|
|
38
|
+
timeRangeOpen: 14,
|
|
39
|
+
selectRange: 400,
|
|
40
|
+
selectRangeUnit: 'days',
|
|
41
|
+
includeToday: includeToday,
|
|
42
|
+
defaultValue: time
|
|
43
|
+
}), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(time)));
|
|
44
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { BizDatePicker } from '@zgfe/business-lib';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
|
+
import { Button, Divider, Space, Switch } from 'antd';
|
|
11
|
+
export default (function () {
|
|
12
|
+
var _useState = useState({
|
|
13
|
+
unit: 'day',
|
|
14
|
+
begin: '2022-05-03',
|
|
15
|
+
end: '2022-05-30',
|
|
16
|
+
relative: [0, 1]
|
|
17
|
+
}),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
time = _useState2[0],
|
|
20
|
+
setTime = _useState2[1];
|
|
21
|
+
var aaa = {
|
|
22
|
+
unit: 'week',
|
|
23
|
+
relative: [7, 1]
|
|
24
|
+
};
|
|
25
|
+
var _useState3 = useState(false),
|
|
26
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
+
includeToday = _useState4[0],
|
|
28
|
+
setIncludeToday = _useState4[1];
|
|
29
|
+
var handleChange = function handleChange(data) {
|
|
30
|
+
setTime(data);
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
|
|
33
|
+
onClick: function onClick() {
|
|
34
|
+
return setTime(aaa);
|
|
35
|
+
}
|
|
36
|
+
}, "\u624B\u52A8\u8BBE\u7F6E\u65F6\u95F4"), /*#__PURE__*/React.createElement("span", null, JSON.stringify(aaa))), /*#__PURE__*/React.createElement("div", null, "\u5305\u542B\u300C\u4ECA\u5929\u300D: ", /*#__PURE__*/React.createElement(Switch, {
|
|
37
|
+
defaultChecked: includeToday,
|
|
38
|
+
onChange: setIncludeToday
|
|
39
|
+
})), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(BizDatePicker, {
|
|
40
|
+
mode: "simple",
|
|
41
|
+
onChange: handleChange,
|
|
42
|
+
includeToday: true,
|
|
43
|
+
value: time,
|
|
44
|
+
defaultValue: time,
|
|
45
|
+
selectRange: 1,
|
|
46
|
+
selectRangeUnit: 'weeks'
|
|
47
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(time)));
|
|
48
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { BizDatePickerOld } from '@zgfe/business-lib';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
|
+
import { Divider, Space, Switch } from 'antd';
|
|
11
|
+
export default (function () {
|
|
12
|
+
var _useState = useState({
|
|
13
|
+
begin: '2024-07-23',
|
|
14
|
+
end: '2024-08-05',
|
|
15
|
+
relative: [14, 1],
|
|
16
|
+
unit: 'day'
|
|
17
|
+
}),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
time = _useState2[0],
|
|
20
|
+
setTime = _useState2[1];
|
|
21
|
+
var _useState3 = useState(false),
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
+
includeToday = _useState4[0],
|
|
24
|
+
setIncludeToday = _useState4[1];
|
|
25
|
+
var handleChange = function handleChange(data) {
|
|
26
|
+
setTime(function () {
|
|
27
|
+
return data;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, {
|
|
31
|
+
direction: "vertical"
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u5305\u542B\u300C\u4ECA\u5929\u300D: ", /*#__PURE__*/React.createElement(Switch, {
|
|
33
|
+
defaultChecked: includeToday,
|
|
34
|
+
onChange: setIncludeToday
|
|
35
|
+
})), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(BizDatePickerOld, {
|
|
36
|
+
key: "".concat(includeToday, "--2"),
|
|
37
|
+
onChange: handleChange,
|
|
38
|
+
includeToday: includeToday,
|
|
39
|
+
defaultValue: time
|
|
40
|
+
}), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(time))));
|
|
41
|
+
});
|