szld-libs 0.3.44 → 0.3.47
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 +3311 -3310
- package/dist/szld-components.umd.js +35 -35
- package/es/components/DynamicForm/func.d.ts +8 -0
- package/es/components/DynamicForm/func.js +8 -1
- package/es/components/DynamicFormMobile/func.d.ts +11 -0
- package/es/components/DynamicFormMobile/func.js +8 -1
- package/es/components/DynamicFormMobile/mySelect/index.js +1 -1
- package/es/utils/method.d.ts +5 -0
- package/es/utils/method.js +6 -2
- package/lib/components/DynamicForm/func.d.ts +8 -0
- package/lib/components/DynamicForm/func.js +8 -1
- package/lib/components/DynamicFormMobile/func.d.ts +11 -0
- package/lib/components/DynamicFormMobile/func.js +8 -1
- package/lib/components/DynamicFormMobile/mySelect/index.js +1 -1
- package/lib/utils/method.d.ts +5 -0
- package/lib/utils/method.js +6 -2
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ export declare const handleGetSingleAttrListObj: (children: any[]) => {
|
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
}[];
|
|
22
22
|
/**
|
|
23
|
+
* 20260325新增
|
|
23
24
|
* 匹配语言数据
|
|
24
25
|
*/
|
|
25
26
|
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
@@ -38,3 +39,10 @@ export declare const handleSelectOptions: ({ commonRequestWidthParams, commonReq
|
|
|
38
39
|
item: Ijson;
|
|
39
40
|
langConfig?: any[] | undefined;
|
|
40
41
|
}) => Promise<any[]>;
|
|
42
|
+
/**
|
|
43
|
+
* 单层详情数据对应到单个属性集
|
|
44
|
+
* @param attrList 属性集列表
|
|
45
|
+
* @param detail 属性集详情 {attrid_attrtype: attrvalue} 格式的数据
|
|
46
|
+
* @returns 处理后的属性集列表,每个属性项包含attrvalue
|
|
47
|
+
*/
|
|
48
|
+
export declare const handleObjDetailToSignleAttrList: (attrList: any[], detail: any) => any[];
|
|
@@ -195,7 +195,7 @@ const handleSelectOptions = async ({
|
|
|
195
195
|
};
|
|
196
196
|
if (item.inputType === "local") {
|
|
197
197
|
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
198
|
-
label:
|
|
198
|
+
label: val,
|
|
199
199
|
value: val
|
|
200
200
|
}))) || [];
|
|
201
201
|
if (item.options && Array.isArray(item.options)) {
|
|
@@ -211,11 +211,18 @@ const handleSelectOptions = async ({
|
|
|
211
211
|
}
|
|
212
212
|
return options;
|
|
213
213
|
};
|
|
214
|
+
const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
215
|
+
return attrList.map((item) => ({
|
|
216
|
+
...item,
|
|
217
|
+
attrvalue: detail[item.attrid] || ""
|
|
218
|
+
}));
|
|
219
|
+
};
|
|
214
220
|
export {
|
|
215
221
|
disabledDate,
|
|
216
222
|
getTitle,
|
|
217
223
|
handleGetPlaceholder,
|
|
218
224
|
handleGetSingleAttrListObj,
|
|
225
|
+
handleObjDetailToSignleAttrList,
|
|
219
226
|
handleSelectOptions,
|
|
220
227
|
handleSetFormItemInitialValue,
|
|
221
228
|
handleUrlOptions
|
|
@@ -19,6 +19,10 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
|
|
|
19
19
|
export declare const handleGetSingleAttrListObj: (children: any[]) => {
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
}[];
|
|
22
|
+
/**
|
|
23
|
+
* 20260325新增
|
|
24
|
+
* 匹配语言数据
|
|
25
|
+
*/
|
|
22
26
|
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
23
27
|
/**
|
|
24
28
|
* 根据属性项配置处理成下拉数据
|
|
@@ -35,3 +39,10 @@ export declare const handleSelectOptions: ({ commonRequestWidthParams, commonReq
|
|
|
35
39
|
item: Ijson;
|
|
36
40
|
langConfig?: any[] | undefined;
|
|
37
41
|
}) => Promise<any[]>;
|
|
42
|
+
/**
|
|
43
|
+
* 单层详情数据对应到单个属性集
|
|
44
|
+
* @param attrList 属性集列表
|
|
45
|
+
* @param detail 属性集详情 {attrid_attrtype: attrvalue} 格式的数据
|
|
46
|
+
* @returns 处理后的属性集列表,每个属性项包含attrvalue
|
|
47
|
+
*/
|
|
48
|
+
export declare const handleObjDetailToSignleAttrList: (attrList: any[], detail: any) => any[];
|
|
@@ -195,7 +195,7 @@ const handleSelectOptions = async ({
|
|
|
195
195
|
};
|
|
196
196
|
if (item.inputType === "local") {
|
|
197
197
|
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
198
|
-
label:
|
|
198
|
+
label: val,
|
|
199
199
|
value: val
|
|
200
200
|
}))) || [];
|
|
201
201
|
if (item.options && Array.isArray(item.options)) {
|
|
@@ -211,11 +211,18 @@ const handleSelectOptions = async ({
|
|
|
211
211
|
}
|
|
212
212
|
return options;
|
|
213
213
|
};
|
|
214
|
+
const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
215
|
+
return attrList.map((item) => ({
|
|
216
|
+
...item,
|
|
217
|
+
attrvalue: detail[item.attrid] || ""
|
|
218
|
+
}));
|
|
219
|
+
};
|
|
214
220
|
export {
|
|
215
221
|
disabledDate,
|
|
216
222
|
getTitle,
|
|
217
223
|
handleGetPlaceholder,
|
|
218
224
|
handleGetSingleAttrListObj,
|
|
225
|
+
handleObjDetailToSignleAttrList,
|
|
219
226
|
handleSelectOptions,
|
|
220
227
|
handleSetFormItemInitialValue,
|
|
221
228
|
handleUrlOptions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { handleSelectOptions } from "../func";
|
|
3
2
|
import { Field, Popup, Checkbox, Picker } from "react-vant";
|
|
3
|
+
import { handleSelectOptions } from "../func";
|
|
4
4
|
import { useState, useEffect } from "react";
|
|
5
5
|
import { Flex } from "antd";
|
|
6
6
|
const checkboxGroup = "index-module_checkbox-group_4684b";
|
package/es/utils/method.d.ts
CHANGED
|
@@ -107,6 +107,11 @@ export declare const handleAttrListToObjDetail: ({ attrList, params, extra, comm
|
|
|
107
107
|
* 将URL中的指定字段拼接为字符串
|
|
108
108
|
*/
|
|
109
109
|
export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]) => string;
|
|
110
|
+
/**
|
|
111
|
+
* 20260325新增
|
|
112
|
+
* 匹配语言数据
|
|
113
|
+
*/
|
|
114
|
+
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
110
115
|
/**
|
|
111
116
|
* 根据属性项配置处理成下拉数据
|
|
112
117
|
* @param param0
|
package/es/utils/method.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { message } from "antd";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
3
|
import _ from "lodash";
|
|
4
|
-
import { getTitle } from "../components/DynamicForm/func";
|
|
5
4
|
function getJson(jsonStr) {
|
|
6
5
|
try {
|
|
7
6
|
return JSON.parse(jsonStr);
|
|
@@ -442,6 +441,10 @@ const handleUrlOptions = (val, delimiter, list) => {
|
|
|
442
441
|
});
|
|
443
442
|
return arr.join(delimiter || "-");
|
|
444
443
|
};
|
|
444
|
+
const getTitle = (langConfig, dataID) => {
|
|
445
|
+
const titleData = langConfig.find((x) => (x == null ? void 0 : x.dataid) === dataID);
|
|
446
|
+
return (titleData == null ? void 0 : titleData.content) ?? dataID;
|
|
447
|
+
};
|
|
445
448
|
const handleSelectOptions = async ({
|
|
446
449
|
commonRequestWidthParams,
|
|
447
450
|
commonRequest,
|
|
@@ -520,7 +523,7 @@ const handleSelectOptions = async ({
|
|
|
520
523
|
};
|
|
521
524
|
if (item.inputType === "local") {
|
|
522
525
|
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
523
|
-
label:
|
|
526
|
+
label: val,
|
|
524
527
|
value: val
|
|
525
528
|
}))) || [];
|
|
526
529
|
if (item.options && Array.isArray(item.options)) {
|
|
@@ -545,6 +548,7 @@ const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
|
545
548
|
export {
|
|
546
549
|
base64ToString,
|
|
547
550
|
getJson,
|
|
551
|
+
getTitle,
|
|
548
552
|
handleAttrList,
|
|
549
553
|
handleAttrListToObj,
|
|
550
554
|
handleAttrListToObjDetail,
|
|
@@ -20,6 +20,7 @@ export declare const handleGetSingleAttrListObj: (children: any[]) => {
|
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
}[];
|
|
22
22
|
/**
|
|
23
|
+
* 20260325新增
|
|
23
24
|
* 匹配语言数据
|
|
24
25
|
*/
|
|
25
26
|
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
@@ -38,3 +39,10 @@ export declare const handleSelectOptions: ({ commonRequestWidthParams, commonReq
|
|
|
38
39
|
item: Ijson;
|
|
39
40
|
langConfig?: any[] | undefined;
|
|
40
41
|
}) => Promise<any[]>;
|
|
42
|
+
/**
|
|
43
|
+
* 单层详情数据对应到单个属性集
|
|
44
|
+
* @param attrList 属性集列表
|
|
45
|
+
* @param detail 属性集详情 {attrid_attrtype: attrvalue} 格式的数据
|
|
46
|
+
* @returns 处理后的属性集列表,每个属性项包含attrvalue
|
|
47
|
+
*/
|
|
48
|
+
export declare const handleObjDetailToSignleAttrList: (attrList: any[], detail: any) => any[];
|
|
@@ -197,7 +197,7 @@ const handleSelectOptions = async ({
|
|
|
197
197
|
};
|
|
198
198
|
if (item.inputType === "local") {
|
|
199
199
|
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
200
|
-
label:
|
|
200
|
+
label: val,
|
|
201
201
|
value: val
|
|
202
202
|
}))) || [];
|
|
203
203
|
if (item.options && Array.isArray(item.options)) {
|
|
@@ -213,10 +213,17 @@ const handleSelectOptions = async ({
|
|
|
213
213
|
}
|
|
214
214
|
return options;
|
|
215
215
|
};
|
|
216
|
+
const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
217
|
+
return attrList.map((item) => ({
|
|
218
|
+
...item,
|
|
219
|
+
attrvalue: detail[item.attrid] || ""
|
|
220
|
+
}));
|
|
221
|
+
};
|
|
216
222
|
exports.disabledDate = disabledDate;
|
|
217
223
|
exports.getTitle = getTitle;
|
|
218
224
|
exports.handleGetPlaceholder = handleGetPlaceholder;
|
|
219
225
|
exports.handleGetSingleAttrListObj = handleGetSingleAttrListObj;
|
|
226
|
+
exports.handleObjDetailToSignleAttrList = handleObjDetailToSignleAttrList;
|
|
220
227
|
exports.handleSelectOptions = handleSelectOptions;
|
|
221
228
|
exports.handleSetFormItemInitialValue = handleSetFormItemInitialValue;
|
|
222
229
|
exports.handleUrlOptions = handleUrlOptions;
|
|
@@ -19,6 +19,10 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
|
|
|
19
19
|
export declare const handleGetSingleAttrListObj: (children: any[]) => {
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
}[];
|
|
22
|
+
/**
|
|
23
|
+
* 20260325新增
|
|
24
|
+
* 匹配语言数据
|
|
25
|
+
*/
|
|
22
26
|
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
23
27
|
/**
|
|
24
28
|
* 根据属性项配置处理成下拉数据
|
|
@@ -35,3 +39,10 @@ export declare const handleSelectOptions: ({ commonRequestWidthParams, commonReq
|
|
|
35
39
|
item: Ijson;
|
|
36
40
|
langConfig?: any[] | undefined;
|
|
37
41
|
}) => Promise<any[]>;
|
|
42
|
+
/**
|
|
43
|
+
* 单层详情数据对应到单个属性集
|
|
44
|
+
* @param attrList 属性集列表
|
|
45
|
+
* @param detail 属性集详情 {attrid_attrtype: attrvalue} 格式的数据
|
|
46
|
+
* @returns 处理后的属性集列表,每个属性项包含attrvalue
|
|
47
|
+
*/
|
|
48
|
+
export declare const handleObjDetailToSignleAttrList: (attrList: any[], detail: any) => any[];
|
|
@@ -197,7 +197,7 @@ const handleSelectOptions = async ({
|
|
|
197
197
|
};
|
|
198
198
|
if (item.inputType === "local") {
|
|
199
199
|
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
200
|
-
label:
|
|
200
|
+
label: val,
|
|
201
201
|
value: val
|
|
202
202
|
}))) || [];
|
|
203
203
|
if (item.options && Array.isArray(item.options)) {
|
|
@@ -213,10 +213,17 @@ const handleSelectOptions = async ({
|
|
|
213
213
|
}
|
|
214
214
|
return options;
|
|
215
215
|
};
|
|
216
|
+
const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
217
|
+
return attrList.map((item) => ({
|
|
218
|
+
...item,
|
|
219
|
+
attrvalue: detail[item.attrid] || ""
|
|
220
|
+
}));
|
|
221
|
+
};
|
|
216
222
|
exports.disabledDate = disabledDate;
|
|
217
223
|
exports.getTitle = getTitle;
|
|
218
224
|
exports.handleGetPlaceholder = handleGetPlaceholder;
|
|
219
225
|
exports.handleGetSingleAttrListObj = handleGetSingleAttrListObj;
|
|
226
|
+
exports.handleObjDetailToSignleAttrList = handleObjDetailToSignleAttrList;
|
|
220
227
|
exports.handleSelectOptions = handleSelectOptions;
|
|
221
228
|
exports.handleSetFormItemInitialValue = handleSetFormItemInitialValue;
|
|
222
229
|
exports.handleUrlOptions = handleUrlOptions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const func = require("../func");
|
|
4
3
|
const reactVant = require("react-vant");
|
|
4
|
+
const func = require("../func");
|
|
5
5
|
const react = require("react");
|
|
6
6
|
const antd = require("antd");
|
|
7
7
|
const checkboxGroup = "index-module_checkbox-group_4684b";
|
package/lib/utils/method.d.ts
CHANGED
|
@@ -107,6 +107,11 @@ export declare const handleAttrListToObjDetail: ({ attrList, params, extra, comm
|
|
|
107
107
|
* 将URL中的指定字段拼接为字符串
|
|
108
108
|
*/
|
|
109
109
|
export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]) => string;
|
|
110
|
+
/**
|
|
111
|
+
* 20260325新增
|
|
112
|
+
* 匹配语言数据
|
|
113
|
+
*/
|
|
114
|
+
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
110
115
|
/**
|
|
111
116
|
* 根据属性项配置处理成下拉数据
|
|
112
117
|
* @param param0
|
package/lib/utils/method.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const antd = require("antd");
|
|
4
4
|
const dayjs = require("dayjs");
|
|
5
5
|
const _ = require("lodash");
|
|
6
|
-
const func = require("../components/DynamicForm/func");
|
|
7
6
|
function getJson(jsonStr) {
|
|
8
7
|
try {
|
|
9
8
|
return JSON.parse(jsonStr);
|
|
@@ -444,6 +443,10 @@ const handleUrlOptions = (val, delimiter, list) => {
|
|
|
444
443
|
});
|
|
445
444
|
return arr.join(delimiter || "-");
|
|
446
445
|
};
|
|
446
|
+
const getTitle = (langConfig, dataID) => {
|
|
447
|
+
const titleData = langConfig.find((x) => (x == null ? void 0 : x.dataid) === dataID);
|
|
448
|
+
return (titleData == null ? void 0 : titleData.content) ?? dataID;
|
|
449
|
+
};
|
|
447
450
|
const handleSelectOptions = async ({
|
|
448
451
|
commonRequestWidthParams,
|
|
449
452
|
commonRequest,
|
|
@@ -522,7 +525,7 @@ const handleSelectOptions = async ({
|
|
|
522
525
|
};
|
|
523
526
|
if (item.inputType === "local") {
|
|
524
527
|
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
525
|
-
label:
|
|
528
|
+
label: val,
|
|
526
529
|
value: val
|
|
527
530
|
}))) || [];
|
|
528
531
|
if (item.options && Array.isArray(item.options)) {
|
|
@@ -546,6 +549,7 @@ const handleObjDetailToSignleAttrList = (attrList, detail) => {
|
|
|
546
549
|
};
|
|
547
550
|
exports.base64ToString = base64ToString;
|
|
548
551
|
exports.getJson = getJson;
|
|
552
|
+
exports.getTitle = getTitle;
|
|
549
553
|
exports.handleAttrList = handleAttrList;
|
|
550
554
|
exports.handleAttrListToObj = handleAttrListToObj;
|
|
551
555
|
exports.handleAttrListToObjDetail = handleAttrListToObjDetail;
|