szld-libs 0.3.77 → 0.3.79
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.
|
@@ -42,8 +42,7 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
42
42
|
}
|
|
43
43
|
if (inputType === "range-picker" && initialValue) {
|
|
44
44
|
try {
|
|
45
|
-
initialValue = initialValue
|
|
46
|
-
initialValue = initialValue.map((v) => v);
|
|
45
|
+
initialValue = initialValue.map((v) => new Date(v));
|
|
47
46
|
} catch (error) {
|
|
48
47
|
initialValue = void 0;
|
|
49
48
|
}
|
|
@@ -51,7 +50,7 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
51
50
|
if (inputType === "multiple-date-picker" && initialValue) {
|
|
52
51
|
try {
|
|
53
52
|
initialValue = initialValue == null ? void 0 : initialValue.split(",");
|
|
54
|
-
initialValue = initialValue.map((v) =>
|
|
53
|
+
initialValue = initialValue.map((v) => new Date(v));
|
|
55
54
|
} catch (error) {
|
|
56
55
|
initialValue = void 0;
|
|
57
56
|
}
|
package/es/utils/szxkFunc.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
|
+
import _ from "lodash";
|
|
2
3
|
const handleGetAttrList = async (params, commonRequest, interfaceType) => {
|
|
3
4
|
var _a;
|
|
4
5
|
try {
|
|
@@ -64,7 +65,7 @@ const handleSetTableRowColor = (record, index, ngColor) => ({
|
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
const handleFormatMobileDate = (values, format = "YYYY-MM-DD") => {
|
|
67
|
-
Object.entries(values).forEach(([key, value]) => {
|
|
68
|
+
Object.entries(_.cloneDeep(values)).forEach(([key, value]) => {
|
|
68
69
|
if (Array.isArray(value) && value.length > 0 && value[0] instanceof Date) {
|
|
69
70
|
values[key] = value.map((item) => dayjs(item).format(format));
|
|
70
71
|
}
|
|
@@ -44,8 +44,7 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
44
44
|
}
|
|
45
45
|
if (inputType === "range-picker" && initialValue) {
|
|
46
46
|
try {
|
|
47
|
-
initialValue = initialValue
|
|
48
|
-
initialValue = initialValue.map((v) => v);
|
|
47
|
+
initialValue = initialValue.map((v) => new Date(v));
|
|
49
48
|
} catch (error) {
|
|
50
49
|
initialValue = void 0;
|
|
51
50
|
}
|
|
@@ -53,7 +52,7 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
53
52
|
if (inputType === "multiple-date-picker" && initialValue) {
|
|
54
53
|
try {
|
|
55
54
|
initialValue = initialValue == null ? void 0 : initialValue.split(",");
|
|
56
|
-
initialValue = initialValue.map((v) =>
|
|
55
|
+
initialValue = initialValue.map((v) => new Date(v));
|
|
57
56
|
} catch (error) {
|
|
58
57
|
initialValue = void 0;
|
|
59
58
|
}
|
package/lib/utils/szxkFunc.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const dayjs = require("dayjs");
|
|
4
|
+
const _ = require("lodash");
|
|
4
5
|
const handleGetAttrList = async (params, commonRequest, interfaceType) => {
|
|
5
6
|
var _a;
|
|
6
7
|
try {
|
|
@@ -66,7 +67,7 @@ const handleSetTableRowColor = (record, index, ngColor) => ({
|
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
const handleFormatMobileDate = (values, format = "YYYY-MM-DD") => {
|
|
69
|
-
Object.entries(values).forEach(([key, value]) => {
|
|
70
|
+
Object.entries(_.cloneDeep(values)).forEach(([key, value]) => {
|
|
70
71
|
if (Array.isArray(value) && value.length > 0 && value[0] instanceof Date) {
|
|
71
72
|
values[key] = value.map((item) => dayjs(item).format(format));
|
|
72
73
|
}
|