@zgfe/business-lib 1.0.21-cdp.8 → 1.0.21-cdp.9
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/cycleTime/index.d.ts +5 -5
- package/es/cycleTime/index.js +14 -14
- package/package.json +2 -2
package/es/cycleTime/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import './styles/index.less';
|
|
4
|
-
declare enum
|
|
5
|
-
day =
|
|
6
|
-
week =
|
|
7
|
-
month =
|
|
4
|
+
export declare enum CycleTimeUnit {
|
|
5
|
+
day = 1,
|
|
6
|
+
week = 2,
|
|
7
|
+
month = 3
|
|
8
8
|
}
|
|
9
9
|
interface Value {
|
|
10
|
-
unit:
|
|
10
|
+
unit: CycleTimeUnit;
|
|
11
11
|
day?: number[];
|
|
12
12
|
time?: string;
|
|
13
13
|
}
|
package/es/cycleTime/index.js
CHANGED
|
@@ -15,13 +15,13 @@ import React, { useEffect, useState } from 'react';
|
|
|
15
15
|
import { BizSelect } from '..';
|
|
16
16
|
import MonthDay from './month';
|
|
17
17
|
import './styles/index.less';
|
|
18
|
-
var
|
|
18
|
+
export var CycleTimeUnit;
|
|
19
19
|
|
|
20
|
-
(function (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})(
|
|
20
|
+
(function (CycleTimeUnit) {
|
|
21
|
+
CycleTimeUnit[CycleTimeUnit["day"] = 1] = "day";
|
|
22
|
+
CycleTimeUnit[CycleTimeUnit["week"] = 2] = "week";
|
|
23
|
+
CycleTimeUnit[CycleTimeUnit["month"] = 3] = "month";
|
|
24
|
+
})(CycleTimeUnit || (CycleTimeUnit = {}));
|
|
25
25
|
|
|
26
26
|
var BizCycleTime = function BizCycleTime(props) {
|
|
27
27
|
var multiple = props.multiple,
|
|
@@ -29,13 +29,13 @@ var BizCycleTime = function BizCycleTime(props) {
|
|
|
29
29
|
var classPrefix = 'biz-cycle-time';
|
|
30
30
|
var unitList = [{
|
|
31
31
|
label: '每日',
|
|
32
|
-
value:
|
|
32
|
+
value: CycleTimeUnit.day
|
|
33
33
|
}, {
|
|
34
34
|
label: '每周',
|
|
35
|
-
value:
|
|
35
|
+
value: CycleTimeUnit.week
|
|
36
36
|
}, {
|
|
37
37
|
label: '每月',
|
|
38
|
-
value:
|
|
38
|
+
value: CycleTimeUnit.month
|
|
39
39
|
}];
|
|
40
40
|
var days = [];
|
|
41
41
|
|
|
@@ -62,7 +62,7 @@ var BizCycleTime = function BizCycleTime(props) {
|
|
|
62
62
|
useEffect(function () {
|
|
63
63
|
var res = {
|
|
64
64
|
unit: unit.value,
|
|
65
|
-
day: unit.value ===
|
|
65
|
+
day: unit.value === CycleTimeUnit.month ? dayList === null || dayList === void 0 ? void 0 : dayList.map(function (item) {
|
|
66
66
|
return item.value;
|
|
67
67
|
}) : multiple ? day.map(function (item) {
|
|
68
68
|
return item.value;
|
|
@@ -70,7 +70,7 @@ var BizCycleTime = function BizCycleTime(props) {
|
|
|
70
70
|
time: time
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
if (unit.value ===
|
|
73
|
+
if (unit.value === CycleTimeUnit.day) {
|
|
74
74
|
delete res.day;
|
|
75
75
|
} else {
|
|
76
76
|
delete res.time;
|
|
@@ -99,13 +99,13 @@ var BizCycleTime = function BizCycleTime(props) {
|
|
|
99
99
|
onChange: function onChange(v) {
|
|
100
100
|
setUnit(v);
|
|
101
101
|
}
|
|
102
|
-
}), unit.value ===
|
|
102
|
+
}), unit.value === CycleTimeUnit.day && /*#__PURE__*/React.createElement(DatePicker.TimePicker, {
|
|
103
103
|
className: "".concat(classPrefix, "-hour"),
|
|
104
104
|
size: size,
|
|
105
105
|
onChange: function onChange(time) {
|
|
106
106
|
setTime(time === null || time === void 0 ? void 0 : time.format('hh:mm:ss'));
|
|
107
107
|
}
|
|
108
|
-
}), unit.value ===
|
|
108
|
+
}), unit.value === CycleTimeUnit.week && /*#__PURE__*/React.createElement(BizSelect, {
|
|
109
109
|
options: days,
|
|
110
110
|
labelField: "label",
|
|
111
111
|
keyField: "value",
|
|
@@ -115,7 +115,7 @@ var BizCycleTime = function BizCycleTime(props) {
|
|
|
115
115
|
onChange: function onChange(v) {
|
|
116
116
|
setDay(v);
|
|
117
117
|
}
|
|
118
|
-
}), unit.value ===
|
|
118
|
+
}), unit.value === CycleTimeUnit.month && /*#__PURE__*/React.createElement(MonthDay, {
|
|
119
119
|
onChange: setDayList
|
|
120
120
|
}));
|
|
121
121
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.0.21-cdp.
|
|
3
|
+
"version": "1.0.21-cdp.9",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react": "^16.12.0 || ^17.0.0",
|
|
59
59
|
"yorkie": "^2.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "dab7c9facdadd1dbab45ef27728d93f9558b6334"
|
|
62
62
|
}
|