lu-lowcode-package-form 0.9.69 → 0.9.70
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.
@@ -6,8 +6,9 @@ import 'dayjs/locale/zh-cn';
|
|
6
6
|
import zh from 'antd/es/date-picker/locale/zh_CN';
|
7
7
|
|
8
8
|
import updateLocale from 'dayjs/plugin/updateLocale';
|
9
|
-
|
9
|
+
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
10
10
|
dayjs.extend(updateLocale);
|
11
|
+
dayjs.extend(customParseFormat);
|
11
12
|
dayjs.updateLocale('zh-cn', {
|
12
13
|
weekStart: 0,
|
13
14
|
});
|
@@ -20,14 +21,18 @@ const DatePicker = ({ datetype, value, defaultNow, onChange, ...props }) => {
|
|
20
21
|
const [needConfirm, setNeedConfirm] = useState(false)
|
21
22
|
const isChanged = useRef(false)
|
22
23
|
useEffect(() => {
|
24
|
+
console.log("value change", value)
|
25
|
+
console.log("value type change", typeof value)
|
23
26
|
if (defaultNow && !value && !isChanged.current) {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
if (value && typeof value === "string" && dayjs(value).isValid()) {
|
28
|
-
typeof onChange === "function" && onChange(dayjs(value))
|
27
|
+
const now =dayjs().format("YYYY-MM-DD HH:mm:ss")
|
28
|
+
console.log("now", now)
|
29
|
+
typeof onChange === "function" && onChange(now)
|
29
30
|
return
|
30
31
|
}
|
32
|
+
// if (value && typeof value === "string" && dayjs(value).isValid()) {
|
33
|
+
// typeof onChange === "function" && onChange(dayjs(value))
|
34
|
+
// return
|
35
|
+
// }
|
31
36
|
}, [value,onChange, format, picker])
|
32
37
|
|
33
38
|
const handleChange = (value, dateString) => {
|
@@ -70,7 +75,7 @@ const DatePicker = ({ datetype, value, defaultNow, onChange, ...props }) => {
|
|
70
75
|
}, [datetype])
|
71
76
|
return (
|
72
77
|
<BaseWrapper {...props}>
|
73
|
-
<OriginalDatePicker locale={zh} {...props} picker={picker} format={format} style={{ width: '100%' }} onChange={handleChange} value={
|
78
|
+
<OriginalDatePicker locale={zh} {...props} picker={picker} format={format} style={{ width: '100%' }} onChange={handleChange} value={dayjs(value).isValid() ? dayjs(value) : undefined} showTime={showTime} needConfirm={needConfirm} />
|
74
79
|
</BaseWrapper>
|
75
80
|
);
|
76
81
|
}
|
@@ -93,7 +93,6 @@ const SearchSelect = ({ addWrapper = true, value, type, defaultValue, onChange,
|
|
93
93
|
notFoundContent={fetching ? <Spin size="small" /> : null}
|
94
94
|
value={value}
|
95
95
|
{...props}
|
96
|
-
disabled={false}
|
97
96
|
filterOption={false}
|
98
97
|
showSearch={request && option_search ? true : false}
|
99
98
|
onSearch={request && option_search ? handleSearch : null}
|
@@ -110,7 +109,6 @@ const SearchSelect = ({ addWrapper = true, value, type, defaultValue, onChange,
|
|
110
109
|
notFoundContent={fetching ? <Spin size="small" /> : null}
|
111
110
|
value={value}
|
112
111
|
{...props}
|
113
|
-
disabled={false}
|
114
112
|
filterOption={false}
|
115
113
|
showSearch={request && option_search ? true : false}
|
116
114
|
onSearch={request && option_search ? handleSearch : null}
|