szld-libs 0.4.38 → 0.4.40
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 +3550 -3538
- package/dist/szld-components.umd.js +29 -29
- package/es/components/DynamicForm/func.js +4 -1
- package/es/components/DynamicForm/useDynamicForm.js +3 -3
- package/es/components/DynamicFormMobile/func.js +4 -1
- package/es/components/DynamicFormMobile/myCalendar/index.js +4 -2
- package/es/components/DynamicFormMobile/useDynamicForm.js +5 -5
- package/es/index.js +10 -4
- package/es/mock/index.js +225 -366
- package/es/utils/method.js +7 -4
- package/es/utils/szxkFunc.d.ts +1 -0
- package/es/utils/szxkFunc.js +10 -1
- package/lib/components/DynamicForm/func.js +4 -1
- package/lib/components/DynamicForm/useDynamicForm.js +3 -3
- package/lib/components/DynamicFormMobile/func.js +4 -1
- package/lib/components/DynamicFormMobile/myCalendar/index.js +4 -2
- package/lib/components/DynamicFormMobile/useDynamicForm.js +5 -5
- package/lib/index.js +8 -2
- package/lib/mock/index.js +225 -366
- package/lib/utils/method.js +7 -4
- package/lib/utils/szxkFunc.d.ts +1 -0
- package/lib/utils/szxkFunc.js +9 -0
- package/package.json +2 -2
package/lib/utils/method.js
CHANGED
|
@@ -162,18 +162,21 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
162
162
|
}
|
|
163
163
|
if (isAutoFill) {
|
|
164
164
|
(_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
|
|
165
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
165
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
166
166
|
const attrvalue = (v == null ? void 0 : v.attrvalue) || "";
|
|
167
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
168
|
if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
|
|
169
169
|
v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
170
170
|
}
|
|
171
|
-
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "
|
|
171
|
+
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "currenttimestamp") {
|
|
172
|
+
v.attrvalue = dayjs().unix().toString();
|
|
173
|
+
}
|
|
174
|
+
if (((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["auto-generate-type"]) === "guid" && !attrvalue) {
|
|
172
175
|
v.attrvalue = onlyNumber || guid || "";
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
|
-
if (((
|
|
176
|
-
v.attrvalue = (
|
|
178
|
+
if (((_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"]) && !attrvalue) {
|
|
179
|
+
v.attrvalue = (_g = v == null ? void 0 : v.json) == null ? void 0 : _g["default"];
|
|
177
180
|
}
|
|
178
181
|
});
|
|
179
182
|
}
|
package/lib/utils/szxkFunc.d.ts
CHANGED
|
@@ -69,3 +69,4 @@ export declare const handleSetTableRowColor: (record: any, index: number | undef
|
|
|
69
69
|
export declare const handleFormatMobileDate: (values: Record<string, any>, format?: string) => Record<string, any>;
|
|
70
70
|
export declare const handleNonUniversalHeader: (nonUniversalHeader: Record<string, string>, data: Record<string, any>) => Record<string, any>;
|
|
71
71
|
export declare const handleGetControlPanelConfig: (sourceNumber: string | number, commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>) => Promise<any>;
|
|
72
|
+
export declare const isJson: (str: string) => boolean;
|
package/lib/utils/szxkFunc.js
CHANGED
|
@@ -100,6 +100,14 @@ const handleGetControlPanelConfig = async (sourceNumber, commonRequest) => {
|
|
|
100
100
|
} catch (error) {
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
+
const isJson = (str) => {
|
|
104
|
+
try {
|
|
105
|
+
JSON.parse(str);
|
|
106
|
+
return true;
|
|
107
|
+
} catch (e) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
103
111
|
exports.handleCallSupportCode = handleCallSupportCode;
|
|
104
112
|
exports.handleFormatMobileDate = handleFormatMobileDate;
|
|
105
113
|
exports.handleGetAttrDetail = handleGetAttrDetail;
|
|
@@ -109,3 +117,4 @@ exports.handleGetList = handleGetList;
|
|
|
109
117
|
exports.handleNonUniversalHeader = handleNonUniversalHeader;
|
|
110
118
|
exports.handleObjDetailToSignleAttrList = handleObjDetailToSignleAttrList;
|
|
111
119
|
exports.handleSetTableRowColor = handleSetTableRowColor;
|
|
120
|
+
exports.isJson = isJson;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "szld-libs",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.40",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"react-router-dom": "^6.6.1",
|
|
24
24
|
"react-vant": "^3.3.5",
|
|
25
25
|
"react-window": "^1.8.9",
|
|
26
|
-
"szld-libs": "^0.4.
|
|
26
|
+
"szld-libs": "^0.4.38"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/crypto-js": "^4.2.1",
|