szld-libs 0.3.99 → 0.4.2
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 +764 -752
- package/dist/szld-components.umd.js +4 -4
- package/es/components/DynamicFormMobile/useDynamicForm.js +10 -2
- package/es/utils/szxkFunc.d.ts +1 -0
- package/es/utils/szxkFunc.js +13 -0
- package/lib/components/DynamicFormMobile/useDynamicForm.js +10 -2
- package/lib/utils/szxkFunc.d.ts +1 -0
- package/lib/utils/szxkFunc.js +13 -0
- package/package.json +1 -1
|
@@ -606,7 +606,11 @@ function useDynamicForm(props) {
|
|
|
606
606
|
value: val ? val.map(
|
|
607
607
|
(el) => dayjs(el).format("YYYY-MM-DD")
|
|
608
608
|
).join("~") : langId === "10001" ? "请选择日期" : "Please select a date",
|
|
609
|
-
onClick: () =>
|
|
609
|
+
onClick: () => {
|
|
610
|
+
if (!readonly) {
|
|
611
|
+
actions.open();
|
|
612
|
+
}
|
|
613
|
+
}
|
|
610
614
|
}
|
|
611
615
|
);
|
|
612
616
|
} });
|
|
@@ -619,7 +623,11 @@ function useDynamicForm(props) {
|
|
|
619
623
|
value: val ? val.map(
|
|
620
624
|
(el) => dayjs(el).format("YYYY-MM-DD")
|
|
621
625
|
).join(",") : langId === "10001" ? "请选择日期" : "Please select a date",
|
|
622
|
-
onClick: () =>
|
|
626
|
+
onClick: () => {
|
|
627
|
+
if (!readonly) {
|
|
628
|
+
actions.open();
|
|
629
|
+
}
|
|
630
|
+
}
|
|
623
631
|
}
|
|
624
632
|
);
|
|
625
633
|
} });
|
package/es/utils/szxkFunc.d.ts
CHANGED
|
@@ -67,3 +67,4 @@ export declare const handleSetTableRowColor: (record: any, index: number | undef
|
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
69
|
export declare const handleFormatMobileDate: (values: Record<string, any>, format?: string) => Record<string, any>;
|
|
70
|
+
export declare const handleNonUniversalHeader: (nonUniversalHeader: Record<string, string>, data: Record<string, any>) => Record<string, any>;
|
package/es/utils/szxkFunc.js
CHANGED
|
@@ -75,12 +75,25 @@ const handleFormatMobileDate = (values, format = "YYYY-MM-DD") => {
|
|
|
75
75
|
});
|
|
76
76
|
return values;
|
|
77
77
|
};
|
|
78
|
+
const handleNonUniversalHeader = (nonUniversalHeader, data) => {
|
|
79
|
+
const valueToKeyMap = Object.fromEntries(
|
|
80
|
+
Object.entries(nonUniversalHeader).map(([key, value]) => [value, key])
|
|
81
|
+
);
|
|
82
|
+
const mappedResult = {};
|
|
83
|
+
for (const [key, value] of Object.entries(data)) {
|
|
84
|
+
if (valueToKeyMap.hasOwnProperty(key)) {
|
|
85
|
+
mappedResult[valueToKeyMap[key]] = value;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return mappedResult;
|
|
89
|
+
};
|
|
78
90
|
export {
|
|
79
91
|
handleCallSupportCode,
|
|
80
92
|
handleFormatMobileDate,
|
|
81
93
|
handleGetAttrDetail,
|
|
82
94
|
handleGetAttrList,
|
|
83
95
|
handleGetList,
|
|
96
|
+
handleNonUniversalHeader,
|
|
84
97
|
handleObjDetailToSignleAttrList,
|
|
85
98
|
handleSetTableRowColor
|
|
86
99
|
};
|
|
@@ -607,7 +607,11 @@ function useDynamicForm(props) {
|
|
|
607
607
|
value: val ? val.map(
|
|
608
608
|
(el) => dayjs(el).format("YYYY-MM-DD")
|
|
609
609
|
).join("~") : langId === "10001" ? "请选择日期" : "Please select a date",
|
|
610
|
-
onClick: () =>
|
|
610
|
+
onClick: () => {
|
|
611
|
+
if (!readonly) {
|
|
612
|
+
actions.open();
|
|
613
|
+
}
|
|
614
|
+
}
|
|
611
615
|
}
|
|
612
616
|
);
|
|
613
617
|
} });
|
|
@@ -620,7 +624,11 @@ function useDynamicForm(props) {
|
|
|
620
624
|
value: val ? val.map(
|
|
621
625
|
(el) => dayjs(el).format("YYYY-MM-DD")
|
|
622
626
|
).join(",") : langId === "10001" ? "请选择日期" : "Please select a date",
|
|
623
|
-
onClick: () =>
|
|
627
|
+
onClick: () => {
|
|
628
|
+
if (!readonly) {
|
|
629
|
+
actions.open();
|
|
630
|
+
}
|
|
631
|
+
}
|
|
624
632
|
}
|
|
625
633
|
);
|
|
626
634
|
} });
|
package/lib/utils/szxkFunc.d.ts
CHANGED
|
@@ -67,3 +67,4 @@ export declare const handleSetTableRowColor: (record: any, index: number | undef
|
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
69
|
export declare const handleFormatMobileDate: (values: Record<string, any>, format?: string) => Record<string, any>;
|
|
70
|
+
export declare const handleNonUniversalHeader: (nonUniversalHeader: Record<string, string>, data: Record<string, any>) => Record<string, any>;
|
package/lib/utils/szxkFunc.js
CHANGED
|
@@ -77,10 +77,23 @@ const handleFormatMobileDate = (values, format = "YYYY-MM-DD") => {
|
|
|
77
77
|
});
|
|
78
78
|
return values;
|
|
79
79
|
};
|
|
80
|
+
const handleNonUniversalHeader = (nonUniversalHeader, data) => {
|
|
81
|
+
const valueToKeyMap = Object.fromEntries(
|
|
82
|
+
Object.entries(nonUniversalHeader).map(([key, value]) => [value, key])
|
|
83
|
+
);
|
|
84
|
+
const mappedResult = {};
|
|
85
|
+
for (const [key, value] of Object.entries(data)) {
|
|
86
|
+
if (valueToKeyMap.hasOwnProperty(key)) {
|
|
87
|
+
mappedResult[valueToKeyMap[key]] = value;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return mappedResult;
|
|
91
|
+
};
|
|
80
92
|
exports.handleCallSupportCode = handleCallSupportCode;
|
|
81
93
|
exports.handleFormatMobileDate = handleFormatMobileDate;
|
|
82
94
|
exports.handleGetAttrDetail = handleGetAttrDetail;
|
|
83
95
|
exports.handleGetAttrList = handleGetAttrList;
|
|
84
96
|
exports.handleGetList = handleGetList;
|
|
97
|
+
exports.handleNonUniversalHeader = handleNonUniversalHeader;
|
|
85
98
|
exports.handleObjDetailToSignleAttrList = handleObjDetailToSignleAttrList;
|
|
86
99
|
exports.handleSetTableRowColor = handleSetTableRowColor;
|