szld-libs 0.4.23 → 0.4.24
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/dist/szld-components.es.js +208 -208
- package/dist/szld-components.umd.js +38 -38
- package/es/components/DynamicForm/func.js +4 -1
- package/es/utils/method.js +17 -16
- package/lib/components/DynamicForm/func.js +4 -1
- package/lib/utils/method.js +17 -16
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@ const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
|
34
34
|
return defaultMessage;
|
|
35
35
|
};
|
|
36
36
|
const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
37
|
-
var _a, _b, _c, _d;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f;
|
|
38
38
|
const inputType = (_a = itemWithJson.json) == null ? void 0 : _a.input;
|
|
39
39
|
let initialValue = itemWithJson.attrvalue || ((_b = itemWithJson.json) == null ? void 0 : _b.default);
|
|
40
40
|
if (inputType === "label" && initialValue) {
|
|
@@ -78,6 +78,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
78
78
|
initialValue = [];
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
if (inputType === "time-picker" && !initialValue && ((_e = itemWithJson.json) == null ? void 0 : _e["auto-generate"]) && ((_f = itemWithJson.json) == null ? void 0 : _f["auto-generate-type"]) === "currenttime") {
|
|
82
|
+
initialValue = dayjs().format("YYYY-MM-DD HH:mm:ss:ss");
|
|
83
|
+
}
|
|
81
84
|
if (itemWithJson.attrtype === 1) {
|
|
82
85
|
initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
|
|
83
86
|
}
|
package/es/utils/method.js
CHANGED
|
@@ -33,22 +33,6 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
33
33
|
const { attr_list = [] } = updatedData;
|
|
34
34
|
const { isMobile = false, guid, isListToObj = false, isAutoFill = true, onlyNumber = "" } = originalData;
|
|
35
35
|
let uploadedFiles = [];
|
|
36
|
-
if (isAutoFill) {
|
|
37
|
-
(_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
|
|
38
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
39
|
-
if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"])) {
|
|
40
|
-
if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
|
|
41
|
-
v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
42
|
-
}
|
|
43
|
-
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "guid") {
|
|
44
|
-
v.attrvalue = onlyNumber || guid || "";
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if ((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["default"]) {
|
|
48
|
-
v.attrvalue = (_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"];
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
36
|
const processAttrList = (attrList, values) => {
|
|
53
37
|
try {
|
|
54
38
|
const attrMap = new Map(attrList.map((item, index) => [item.attrid, index]));
|
|
@@ -174,6 +158,23 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
174
158
|
if (updatedData.attr_list && Array.isArray(updatedData.attr_list)) {
|
|
175
159
|
processAttrList(attr_list, allValues);
|
|
176
160
|
}
|
|
161
|
+
if (isAutoFill) {
|
|
162
|
+
(_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
|
|
163
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
164
|
+
const attrvalue = (v == null ? void 0 : v.attrvalue) || "";
|
|
165
|
+
if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"]) && !attrvalue) {
|
|
166
|
+
if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
|
|
167
|
+
v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
168
|
+
}
|
|
169
|
+
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "guid" && !attrvalue) {
|
|
170
|
+
v.attrvalue = onlyNumber || guid || "";
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["default"]) && !attrvalue) {
|
|
174
|
+
v.attrvalue = (_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
177
178
|
return {
|
|
178
179
|
updatedData: isListToObj ? handleAttrListToObj(updatedData.attr_list || []) : updatedData,
|
|
179
180
|
uploadedFiles
|
|
@@ -36,7 +36,7 @@ const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
|
36
36
|
return defaultMessage;
|
|
37
37
|
};
|
|
38
38
|
const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
39
|
-
var _a, _b, _c, _d;
|
|
39
|
+
var _a, _b, _c, _d, _e, _f;
|
|
40
40
|
const inputType = (_a = itemWithJson.json) == null ? void 0 : _a.input;
|
|
41
41
|
let initialValue = itemWithJson.attrvalue || ((_b = itemWithJson.json) == null ? void 0 : _b.default);
|
|
42
42
|
if (inputType === "label" && initialValue) {
|
|
@@ -80,6 +80,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
80
80
|
initialValue = [];
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
+
if (inputType === "time-picker" && !initialValue && ((_e = itemWithJson.json) == null ? void 0 : _e["auto-generate"]) && ((_f = itemWithJson.json) == null ? void 0 : _f["auto-generate-type"]) === "currenttime") {
|
|
84
|
+
initialValue = dayjs().format("YYYY-MM-DD HH:mm:ss:ss");
|
|
85
|
+
}
|
|
83
86
|
if (itemWithJson.attrtype === 1) {
|
|
84
87
|
initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
|
|
85
88
|
}
|
package/lib/utils/method.js
CHANGED
|
@@ -35,22 +35,6 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
35
35
|
const { attr_list = [] } = updatedData;
|
|
36
36
|
const { isMobile = false, guid, isListToObj = false, isAutoFill = true, onlyNumber = "" } = originalData;
|
|
37
37
|
let uploadedFiles = [];
|
|
38
|
-
if (isAutoFill) {
|
|
39
|
-
(_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
|
|
40
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
41
|
-
if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"])) {
|
|
42
|
-
if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
|
|
43
|
-
v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
44
|
-
}
|
|
45
|
-
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "guid") {
|
|
46
|
-
v.attrvalue = onlyNumber || guid || "";
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if ((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["default"]) {
|
|
50
|
-
v.attrvalue = (_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"];
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
38
|
const processAttrList = (attrList, values) => {
|
|
55
39
|
try {
|
|
56
40
|
const attrMap = new Map(attrList.map((item, index) => [item.attrid, index]));
|
|
@@ -176,6 +160,23 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
176
160
|
if (updatedData.attr_list && Array.isArray(updatedData.attr_list)) {
|
|
177
161
|
processAttrList(attr_list, allValues);
|
|
178
162
|
}
|
|
163
|
+
if (isAutoFill) {
|
|
164
|
+
(_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
|
|
165
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
166
|
+
const attrvalue = (v == null ? void 0 : v.attrvalue) || "";
|
|
167
|
+
if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"]) && !attrvalue) {
|
|
168
|
+
if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
|
|
169
|
+
v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
170
|
+
}
|
|
171
|
+
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "guid" && !attrvalue) {
|
|
172
|
+
v.attrvalue = onlyNumber || guid || "";
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["default"]) && !attrvalue) {
|
|
176
|
+
v.attrvalue = (_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
179
180
|
return {
|
|
180
181
|
updatedData: isListToObj ? handleAttrListToObj(updatedData.attr_list || []) : updatedData,
|
|
181
182
|
uploadedFiles
|