szld-libs 0.2.76 → 0.2.77
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 +1851 -1830
- package/dist/szld-components.umd.js +3 -3
- package/es/components/DynamicForm/mySelect/index.js +1 -1
- package/es/utils/method.d.ts +6 -0
- package/es/utils/method.js +33 -0
- package/lib/components/DynamicForm/mySelect/index.js +1 -1
- package/lib/utils/method.d.ts +6 -0
- package/lib/utils/method.js +33 -0
- package/package.json +1 -1
|
@@ -113,7 +113,7 @@ const MySelect = ({
|
|
|
113
113
|
return /* @__PURE__ */ jsx(
|
|
114
114
|
Select,
|
|
115
115
|
{
|
|
116
|
-
placeholder: (item == null ? void 0 : item["
|
|
116
|
+
placeholder: (item == null ? void 0 : item["default-prompt"]) || "请选择",
|
|
117
117
|
mode: item.input === "mult-select" ? "multiple" : void 0,
|
|
118
118
|
disabled: readonly,
|
|
119
119
|
loading,
|
package/es/utils/method.d.ts
CHANGED
|
@@ -66,3 +66,9 @@ export declare const handleOperationFile: (params: any, data: any, commonRequest
|
|
|
66
66
|
* @returns 驼峰命名
|
|
67
67
|
*/
|
|
68
68
|
export declare function handleKebabToCamel(str: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* 处理属性列表为目标格式
|
|
71
|
+
* @param {Array} attrList 原始属性列表
|
|
72
|
+
* @returns {Object} 目标格式的data对象
|
|
73
|
+
*/
|
|
74
|
+
export declare const handleAttrListToObj: (attrList: any[]) => any;
|
package/es/utils/method.js
CHANGED
|
@@ -298,10 +298,43 @@ function handleKebabToCamel(str) {
|
|
|
298
298
|
return letter.toUpperCase();
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
+
const handleAttrListToObj = (attrList) => {
|
|
302
|
+
var _a;
|
|
303
|
+
const result = {
|
|
304
|
+
data: {
|
|
305
|
+
asid: ((_a = attrList[0]) == null ? void 0 : _a.asid) || "",
|
|
306
|
+
data_list: []
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
const processItem2 = (item) => {
|
|
310
|
+
var _a2;
|
|
311
|
+
const attrItem = {};
|
|
312
|
+
const key = `${item.attrid}_${item.attrtype}`;
|
|
313
|
+
if (item.children && item.children.length > 0 && item.attrtype == 1) {
|
|
314
|
+
attrItem[key] = {
|
|
315
|
+
asid: ((_a2 = item.children[0]) == null ? void 0 : _a2.asid) || "",
|
|
316
|
+
data_list: {}
|
|
317
|
+
};
|
|
318
|
+
item.children.forEach((child) => {
|
|
319
|
+
attrItem[key].data_list[child.attrid] = child.attrvalue || "";
|
|
320
|
+
});
|
|
321
|
+
attrItem[key].data_list = [attrItem[key].data_list];
|
|
322
|
+
} else {
|
|
323
|
+
attrItem[key] = item.attrvalue || "";
|
|
324
|
+
}
|
|
325
|
+
return attrItem;
|
|
326
|
+
};
|
|
327
|
+
attrList.forEach((item) => {
|
|
328
|
+
result.data.data_list.push(processItem2(item));
|
|
329
|
+
});
|
|
330
|
+
result.data.data_list = [Object.assign({}, ...result.data.data_list)];
|
|
331
|
+
return result;
|
|
332
|
+
};
|
|
301
333
|
export {
|
|
302
334
|
base64ToString,
|
|
303
335
|
getJson,
|
|
304
336
|
handleAttrList,
|
|
337
|
+
handleAttrListToObj,
|
|
305
338
|
handleBaseAttrList,
|
|
306
339
|
handleFormConfig,
|
|
307
340
|
handleKebabToCamel,
|
|
@@ -114,7 +114,7 @@ const MySelect = ({
|
|
|
114
114
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
115
115
|
antd.Select,
|
|
116
116
|
{
|
|
117
|
-
placeholder: (item == null ? void 0 : item["
|
|
117
|
+
placeholder: (item == null ? void 0 : item["default-prompt"]) || "请选择",
|
|
118
118
|
mode: item.input === "mult-select" ? "multiple" : void 0,
|
|
119
119
|
disabled: readonly,
|
|
120
120
|
loading,
|
package/lib/utils/method.d.ts
CHANGED
|
@@ -66,3 +66,9 @@ export declare const handleOperationFile: (params: any, data: any, commonRequest
|
|
|
66
66
|
* @returns 驼峰命名
|
|
67
67
|
*/
|
|
68
68
|
export declare function handleKebabToCamel(str: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* 处理属性列表为目标格式
|
|
71
|
+
* @param {Array} attrList 原始属性列表
|
|
72
|
+
* @returns {Object} 目标格式的data对象
|
|
73
|
+
*/
|
|
74
|
+
export declare const handleAttrListToObj: (attrList: any[]) => any;
|
package/lib/utils/method.js
CHANGED
|
@@ -300,9 +300,42 @@ function handleKebabToCamel(str) {
|
|
|
300
300
|
return letter.toUpperCase();
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
|
+
const handleAttrListToObj = (attrList) => {
|
|
304
|
+
var _a;
|
|
305
|
+
const result = {
|
|
306
|
+
data: {
|
|
307
|
+
asid: ((_a = attrList[0]) == null ? void 0 : _a.asid) || "",
|
|
308
|
+
data_list: []
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const processItem2 = (item) => {
|
|
312
|
+
var _a2;
|
|
313
|
+
const attrItem = {};
|
|
314
|
+
const key = `${item.attrid}_${item.attrtype}`;
|
|
315
|
+
if (item.children && item.children.length > 0 && item.attrtype == 1) {
|
|
316
|
+
attrItem[key] = {
|
|
317
|
+
asid: ((_a2 = item.children[0]) == null ? void 0 : _a2.asid) || "",
|
|
318
|
+
data_list: {}
|
|
319
|
+
};
|
|
320
|
+
item.children.forEach((child) => {
|
|
321
|
+
attrItem[key].data_list[child.attrid] = child.attrvalue || "";
|
|
322
|
+
});
|
|
323
|
+
attrItem[key].data_list = [attrItem[key].data_list];
|
|
324
|
+
} else {
|
|
325
|
+
attrItem[key] = item.attrvalue || "";
|
|
326
|
+
}
|
|
327
|
+
return attrItem;
|
|
328
|
+
};
|
|
329
|
+
attrList.forEach((item) => {
|
|
330
|
+
result.data.data_list.push(processItem2(item));
|
|
331
|
+
});
|
|
332
|
+
result.data.data_list = [Object.assign({}, ...result.data.data_list)];
|
|
333
|
+
return result;
|
|
334
|
+
};
|
|
303
335
|
exports.base64ToString = base64ToString;
|
|
304
336
|
exports.getJson = getJson;
|
|
305
337
|
exports.handleAttrList = handleAttrList;
|
|
338
|
+
exports.handleAttrListToObj = handleAttrListToObj;
|
|
306
339
|
exports.handleBaseAttrList = handleBaseAttrList;
|
|
307
340
|
exports.handleFormConfig = handleFormConfig;
|
|
308
341
|
exports.handleKebabToCamel = handleKebabToCamel;
|