szld-libs 0.4.54 → 0.4.57
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 +2969 -2965
- package/dist/szld-components.umd.js +58 -58
- package/es/hooks/useUniversalTable.d.ts +4 -3
- package/es/hooks/useUniversalTable.js +7 -4
- package/es/mock/index.js +56 -567
- package/es/utils/method.js +3 -2
- package/lib/hooks/useUniversalTable.d.ts +4 -3
- package/lib/hooks/useUniversalTable.js +7 -4
- package/lib/mock/index.js +56 -567
- package/lib/utils/method.js +3 -2
- package/package.json +1 -1
package/lib/utils/method.js
CHANGED
|
@@ -7,7 +7,8 @@ function getJson(jsonStr) {
|
|
|
7
7
|
try {
|
|
8
8
|
return JSON.parse(jsonStr);
|
|
9
9
|
} catch (error) {
|
|
10
|
-
|
|
10
|
+
const fixedData = jsonStr.replace(/\\_/g, "_");
|
|
11
|
+
return fixedData ? JSON.parse(fixedData) : {};
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
function base64ToString(base64Str) {
|
|
@@ -227,7 +228,7 @@ const processItem = (item, extraAttrs, notDisplay) => {
|
|
|
227
228
|
if (!item.json && item.info) {
|
|
228
229
|
try {
|
|
229
230
|
const infoStr = item.info_base64 === 1 ? base64ToString(item.info) : item.info;
|
|
230
|
-
const json = getJson(infoStr);
|
|
231
|
+
const json = typeof infoStr === "string" ? getJson(infoStr) : infoStr;
|
|
231
232
|
const _extraAttrs = _.cloneDeep(extraAttrs) || {};
|
|
232
233
|
const { langConfig = [], attrLangConfig = [] } = _extraAttrs || {};
|
|
233
234
|
_extraAttrs == null ? true : delete _extraAttrs.langConfig;
|