szld-libs 0.4.14 → 0.4.16
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 +4452 -4449
- package/dist/szld-components.umd.js +42 -42
- package/es/components/DynamicForm/index.d.ts +1 -0
- package/es/components/DynamicForm/mySelect/index.js +1 -0
- package/es/components/DynamicForm/useDynamicForm.js +13 -10
- package/es/utils/method.d.ts +2 -2
- package/es/utils/method.js +12 -9
- package/lib/components/DynamicForm/index.d.ts +1 -0
- package/lib/components/DynamicForm/mySelect/index.js +1 -0
- package/lib/components/DynamicForm/useDynamicForm.js +13 -10
- package/lib/utils/method.d.ts +2 -2
- package/lib/utils/method.js +12 -9
- package/package.json +1 -1
|
@@ -298,7 +298,7 @@ function useDynamicForm(props) {
|
|
|
298
298
|
formListField,
|
|
299
299
|
isShowLabel = true
|
|
300
300
|
}) => {
|
|
301
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
301
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
302
302
|
if (((_a = itemWithJson.json) == null ? void 0 : _a.hide) === true) {
|
|
303
303
|
return /* @__PURE__ */ jsx(Fragment$1, {});
|
|
304
304
|
}
|
|
@@ -323,16 +323,17 @@ function useDynamicForm(props) {
|
|
|
323
323
|
if (itemWithJson.attrtype === 0) {
|
|
324
324
|
const initialValue = handleSetFormItemInitialValue(itemWithJson);
|
|
325
325
|
const message2 = (_b = itemWithJson.json) == null ? void 0 : _b["default-prompt"];
|
|
326
|
+
const hidden = (_c = itemWithJson.json) == null ? void 0 : _c.hidden;
|
|
326
327
|
const placeholder = handleGetPlaceholder(itemWithJson, langId);
|
|
327
328
|
const { combinations = [] } = itemWithJson.json || {};
|
|
328
329
|
if (combinations == null ? void 0 : combinations.length) {
|
|
329
330
|
return /* @__PURE__ */ jsx(Col, { span: 24 / colNum, children: /* @__PURE__ */ jsx(
|
|
330
331
|
Form.Item,
|
|
331
332
|
{
|
|
332
|
-
label: (
|
|
333
|
-
required: (
|
|
333
|
+
label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"],
|
|
334
|
+
required: (_e = itemWithJson.json) == null ? void 0 : _e.must,
|
|
334
335
|
children: /* @__PURE__ */ jsx(Space.Compact, { children: combinations.map((item, index) => {
|
|
335
|
-
var _a2, _b2, _c2, _d2;
|
|
336
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
336
337
|
let initValue = handleSetFormItemInitialValue(item);
|
|
337
338
|
let width = defaultWidth;
|
|
338
339
|
const customWidth = {};
|
|
@@ -351,20 +352,21 @@ function useDynamicForm(props) {
|
|
|
351
352
|
return /* @__PURE__ */ jsx(
|
|
352
353
|
Form.Item,
|
|
353
354
|
{
|
|
355
|
+
hidden: (_b2 = item.json) == null ? void 0 : _b2.hidden,
|
|
354
356
|
name: formListField ? Array.isArray(formListField.name) ? [...formListField.name, item.attrid] : [formListField.name, item.attrid] : item.attrid,
|
|
355
357
|
noStyle: true,
|
|
356
358
|
initialValue: initValue,
|
|
357
359
|
rules: [
|
|
358
|
-
...((
|
|
360
|
+
...((_c2 = item.json) == null ? void 0 : _c2.must) ? [
|
|
359
361
|
{
|
|
360
362
|
required: true,
|
|
361
363
|
message: message2 || `${placeholder}${item.attrname}`
|
|
362
364
|
}
|
|
363
365
|
] : [],
|
|
364
|
-
...((
|
|
366
|
+
...((_d2 = itemWithJson.json) == null ? void 0 : _d2.regexp) ? [
|
|
365
367
|
{
|
|
366
368
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
367
|
-
message: ((
|
|
369
|
+
message: ((_e2 = itemWithJson.json) == null ? void 0 : _e2["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
368
370
|
}
|
|
369
371
|
] : []
|
|
370
372
|
],
|
|
@@ -394,17 +396,18 @@ function useDynamicForm(props) {
|
|
|
394
396
|
name: formItemName,
|
|
395
397
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
396
398
|
initialValue,
|
|
399
|
+
hidden,
|
|
397
400
|
rules: [
|
|
398
|
-
...((
|
|
401
|
+
...((_f = itemWithJson.json) == null ? void 0 : _f.must) ? [
|
|
399
402
|
{
|
|
400
403
|
required: true,
|
|
401
404
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
402
405
|
}
|
|
403
406
|
] : [],
|
|
404
|
-
...((
|
|
407
|
+
...((_g = itemWithJson.json) == null ? void 0 : _g.regexp) ? [
|
|
405
408
|
{
|
|
406
409
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
407
|
-
message: ((
|
|
410
|
+
message: ((_h = itemWithJson.json) == null ? void 0 : _h["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
408
411
|
}
|
|
409
412
|
] : []
|
|
410
413
|
],
|
package/es/utils/method.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const handleSubmitForm: (originalData: {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const handleBaseAttrList: (attrList: any[], extraAttrs?: {
|
|
28
28
|
[key: string]: any;
|
|
29
|
-
} | undefined) => any[];
|
|
29
|
+
} | undefined, notDisplay?: string[]) => any[];
|
|
30
30
|
/**
|
|
31
31
|
* 处理属性列表,合并组合属性
|
|
32
32
|
* @param attrList 属性列表
|
|
@@ -35,7 +35,7 @@ export declare const handleBaseAttrList: (attrList: any[], extraAttrs?: {
|
|
|
35
35
|
*/
|
|
36
36
|
export declare const handleAttrList: (attrList: any[], extraAttrs?: {
|
|
37
37
|
[key: string]: any;
|
|
38
|
-
} | undefined) => any[];
|
|
38
|
+
} | undefined, notDisplay?: string[]) => any[];
|
|
39
39
|
export declare const handleFormConfig: ({ number, key, sourceNumber, guidInterfaceName, SelPCParamInterfaceName, servicerAttrListInterfaceName, accepterAttrListInterfaceName, defaultAttrListInterfaceName, commonRequest, guidParams, pcParam, attrReqKey, attrListExtraParams, }: {
|
|
40
40
|
number: string | number;
|
|
41
41
|
key: string;
|
package/es/utils/method.js
CHANGED
|
@@ -179,24 +179,24 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
179
179
|
uploadedFiles
|
|
180
180
|
};
|
|
181
181
|
};
|
|
182
|
-
const processChildren = (items, extraAttrs) => {
|
|
182
|
+
const processChildren = (items, extraAttrs, notDisplay) => {
|
|
183
183
|
return items.map((item) => {
|
|
184
184
|
var _a, _b, _c;
|
|
185
|
-
const processedItem = processItem(item, extraAttrs);
|
|
185
|
+
const processedItem = processItem(item, extraAttrs, notDisplay);
|
|
186
186
|
const { children } = processedItem;
|
|
187
187
|
if (children && !Array.isArray(children == null ? void 0 : children[0]) && (children == null ? void 0 : children.length)) {
|
|
188
|
-
processedItem.children = [processChildren(children)];
|
|
188
|
+
processedItem.children = [processChildren(children, extraAttrs, notDisplay)];
|
|
189
189
|
}
|
|
190
190
|
if ((processedItem == null ? void 0 : processedItem.children) && Array.isArray((_a = processedItem == null ? void 0 : processedItem.children) == null ? void 0 : _a[0]) && ((_b = processedItem == null ? void 0 : processedItem.children) == null ? void 0 : _b.length)) {
|
|
191
191
|
const list = (_c = processedItem == null ? void 0 : processedItem.children) == null ? void 0 : _c.map(
|
|
192
|
-
(child) => child == null ? void 0 : child.map((v) => processItem(v, extraAttrs))
|
|
192
|
+
(child) => child == null ? void 0 : child.map((v) => processItem(v, extraAttrs, notDisplay))
|
|
193
193
|
);
|
|
194
194
|
processedItem.children = list;
|
|
195
195
|
}
|
|
196
196
|
return processedItem;
|
|
197
197
|
});
|
|
198
198
|
};
|
|
199
|
-
const processItem = (item, extraAttrs) => {
|
|
199
|
+
const processItem = (item, extraAttrs, notDisplay) => {
|
|
200
200
|
var _a, _b;
|
|
201
201
|
if (!item.json && item.info) {
|
|
202
202
|
try {
|
|
@@ -214,6 +214,9 @@ const processItem = (item, extraAttrs) => {
|
|
|
214
214
|
});
|
|
215
215
|
json == null ? true : delete json.data;
|
|
216
216
|
}
|
|
217
|
+
if (notDisplay == null ? void 0 : notDisplay.includes(item.attrid)) {
|
|
218
|
+
json["hidden"] = true;
|
|
219
|
+
}
|
|
217
220
|
if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json["combination-name"])) {
|
|
218
221
|
json["combination-name"] = getTitle(attrLangConfig, json["combination-name"]) || getTitle(langConfig, json["combination-name"]);
|
|
219
222
|
}
|
|
@@ -233,11 +236,11 @@ const processItem = (item, extraAttrs) => {
|
|
|
233
236
|
}
|
|
234
237
|
return { ...item, ...extraAttrs };
|
|
235
238
|
};
|
|
236
|
-
const handleBaseAttrList = (attrList, extraAttrs) => {
|
|
237
|
-
return processChildren(attrList, extraAttrs);
|
|
239
|
+
const handleBaseAttrList = (attrList, extraAttrs, notDisplay) => {
|
|
240
|
+
return processChildren(attrList, extraAttrs, notDisplay);
|
|
238
241
|
};
|
|
239
|
-
const handleAttrList = (attrList, extraAttrs) => {
|
|
240
|
-
const parsedAttrList = processChildren(attrList, extraAttrs);
|
|
242
|
+
const handleAttrList = (attrList, extraAttrs, notDisplay) => {
|
|
243
|
+
const parsedAttrList = processChildren(attrList, extraAttrs, notDisplay);
|
|
241
244
|
const combinationGroups = parsedAttrList.filter((item) => {
|
|
242
245
|
var _a;
|
|
243
246
|
return (_a = item.json) == null ? void 0 : _a.combination;
|
|
@@ -299,7 +299,7 @@ function useDynamicForm(props) {
|
|
|
299
299
|
formListField,
|
|
300
300
|
isShowLabel = true
|
|
301
301
|
}) => {
|
|
302
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
302
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
303
303
|
if (((_a = itemWithJson.json) == null ? void 0 : _a.hide) === true) {
|
|
304
304
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
305
305
|
}
|
|
@@ -324,16 +324,17 @@ function useDynamicForm(props) {
|
|
|
324
324
|
if (itemWithJson.attrtype === 0) {
|
|
325
325
|
const initialValue = func.handleSetFormItemInitialValue(itemWithJson);
|
|
326
326
|
const message2 = (_b = itemWithJson.json) == null ? void 0 : _b["default-prompt"];
|
|
327
|
+
const hidden = (_c = itemWithJson.json) == null ? void 0 : _c.hidden;
|
|
327
328
|
const placeholder = func.handleGetPlaceholder(itemWithJson, langId);
|
|
328
329
|
const { combinations = [] } = itemWithJson.json || {};
|
|
329
330
|
if (combinations == null ? void 0 : combinations.length) {
|
|
330
331
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
331
332
|
antd.Form.Item,
|
|
332
333
|
{
|
|
333
|
-
label: (
|
|
334
|
-
required: (
|
|
334
|
+
label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"],
|
|
335
|
+
required: (_e = itemWithJson.json) == null ? void 0 : _e.must,
|
|
335
336
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Space.Compact, { children: combinations.map((item, index) => {
|
|
336
|
-
var _a2, _b2, _c2, _d2;
|
|
337
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
337
338
|
let initValue = func.handleSetFormItemInitialValue(item);
|
|
338
339
|
let width = defaultWidth;
|
|
339
340
|
const customWidth = {};
|
|
@@ -352,20 +353,21 @@ function useDynamicForm(props) {
|
|
|
352
353
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
353
354
|
antd.Form.Item,
|
|
354
355
|
{
|
|
356
|
+
hidden: (_b2 = item.json) == null ? void 0 : _b2.hidden,
|
|
355
357
|
name: formListField ? Array.isArray(formListField.name) ? [...formListField.name, item.attrid] : [formListField.name, item.attrid] : item.attrid,
|
|
356
358
|
noStyle: true,
|
|
357
359
|
initialValue: initValue,
|
|
358
360
|
rules: [
|
|
359
|
-
...((
|
|
361
|
+
...((_c2 = item.json) == null ? void 0 : _c2.must) ? [
|
|
360
362
|
{
|
|
361
363
|
required: true,
|
|
362
364
|
message: message2 || `${placeholder}${item.attrname}`
|
|
363
365
|
}
|
|
364
366
|
] : [],
|
|
365
|
-
...((
|
|
367
|
+
...((_d2 = itemWithJson.json) == null ? void 0 : _d2.regexp) ? [
|
|
366
368
|
{
|
|
367
369
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
368
|
-
message: ((
|
|
370
|
+
message: ((_e2 = itemWithJson.json) == null ? void 0 : _e2["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
369
371
|
}
|
|
370
372
|
] : []
|
|
371
373
|
],
|
|
@@ -395,17 +397,18 @@ function useDynamicForm(props) {
|
|
|
395
397
|
name: formItemName,
|
|
396
398
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
397
399
|
initialValue,
|
|
400
|
+
hidden,
|
|
398
401
|
rules: [
|
|
399
|
-
...((
|
|
402
|
+
...((_f = itemWithJson.json) == null ? void 0 : _f.must) ? [
|
|
400
403
|
{
|
|
401
404
|
required: true,
|
|
402
405
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
403
406
|
}
|
|
404
407
|
] : [],
|
|
405
|
-
...((
|
|
408
|
+
...((_g = itemWithJson.json) == null ? void 0 : _g.regexp) ? [
|
|
406
409
|
{
|
|
407
410
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
408
|
-
message: ((
|
|
411
|
+
message: ((_h = itemWithJson.json) == null ? void 0 : _h["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
409
412
|
}
|
|
410
413
|
] : []
|
|
411
414
|
],
|
package/lib/utils/method.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const handleSubmitForm: (originalData: {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const handleBaseAttrList: (attrList: any[], extraAttrs?: {
|
|
28
28
|
[key: string]: any;
|
|
29
|
-
} | undefined) => any[];
|
|
29
|
+
} | undefined, notDisplay?: string[]) => any[];
|
|
30
30
|
/**
|
|
31
31
|
* 处理属性列表,合并组合属性
|
|
32
32
|
* @param attrList 属性列表
|
|
@@ -35,7 +35,7 @@ export declare const handleBaseAttrList: (attrList: any[], extraAttrs?: {
|
|
|
35
35
|
*/
|
|
36
36
|
export declare const handleAttrList: (attrList: any[], extraAttrs?: {
|
|
37
37
|
[key: string]: any;
|
|
38
|
-
} | undefined) => any[];
|
|
38
|
+
} | undefined, notDisplay?: string[]) => any[];
|
|
39
39
|
export declare const handleFormConfig: ({ number, key, sourceNumber, guidInterfaceName, SelPCParamInterfaceName, servicerAttrListInterfaceName, accepterAttrListInterfaceName, defaultAttrListInterfaceName, commonRequest, guidParams, pcParam, attrReqKey, attrListExtraParams, }: {
|
|
40
40
|
number: string | number;
|
|
41
41
|
key: string;
|
package/lib/utils/method.js
CHANGED
|
@@ -181,24 +181,24 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
181
181
|
uploadedFiles
|
|
182
182
|
};
|
|
183
183
|
};
|
|
184
|
-
const processChildren = (items, extraAttrs) => {
|
|
184
|
+
const processChildren = (items, extraAttrs, notDisplay) => {
|
|
185
185
|
return items.map((item) => {
|
|
186
186
|
var _a, _b, _c;
|
|
187
|
-
const processedItem = processItem(item, extraAttrs);
|
|
187
|
+
const processedItem = processItem(item, extraAttrs, notDisplay);
|
|
188
188
|
const { children } = processedItem;
|
|
189
189
|
if (children && !Array.isArray(children == null ? void 0 : children[0]) && (children == null ? void 0 : children.length)) {
|
|
190
|
-
processedItem.children = [processChildren(children)];
|
|
190
|
+
processedItem.children = [processChildren(children, extraAttrs, notDisplay)];
|
|
191
191
|
}
|
|
192
192
|
if ((processedItem == null ? void 0 : processedItem.children) && Array.isArray((_a = processedItem == null ? void 0 : processedItem.children) == null ? void 0 : _a[0]) && ((_b = processedItem == null ? void 0 : processedItem.children) == null ? void 0 : _b.length)) {
|
|
193
193
|
const list = (_c = processedItem == null ? void 0 : processedItem.children) == null ? void 0 : _c.map(
|
|
194
|
-
(child) => child == null ? void 0 : child.map((v) => processItem(v, extraAttrs))
|
|
194
|
+
(child) => child == null ? void 0 : child.map((v) => processItem(v, extraAttrs, notDisplay))
|
|
195
195
|
);
|
|
196
196
|
processedItem.children = list;
|
|
197
197
|
}
|
|
198
198
|
return processedItem;
|
|
199
199
|
});
|
|
200
200
|
};
|
|
201
|
-
const processItem = (item, extraAttrs) => {
|
|
201
|
+
const processItem = (item, extraAttrs, notDisplay) => {
|
|
202
202
|
var _a, _b;
|
|
203
203
|
if (!item.json && item.info) {
|
|
204
204
|
try {
|
|
@@ -216,6 +216,9 @@ const processItem = (item, extraAttrs) => {
|
|
|
216
216
|
});
|
|
217
217
|
json == null ? true : delete json.data;
|
|
218
218
|
}
|
|
219
|
+
if (notDisplay == null ? void 0 : notDisplay.includes(item.attrid)) {
|
|
220
|
+
json["hidden"] = true;
|
|
221
|
+
}
|
|
219
222
|
if ((langConfig == null ? void 0 : langConfig.length) && (json == null ? void 0 : json["combination-name"])) {
|
|
220
223
|
json["combination-name"] = getTitle(attrLangConfig, json["combination-name"]) || getTitle(langConfig, json["combination-name"]);
|
|
221
224
|
}
|
|
@@ -235,11 +238,11 @@ const processItem = (item, extraAttrs) => {
|
|
|
235
238
|
}
|
|
236
239
|
return { ...item, ...extraAttrs };
|
|
237
240
|
};
|
|
238
|
-
const handleBaseAttrList = (attrList, extraAttrs) => {
|
|
239
|
-
return processChildren(attrList, extraAttrs);
|
|
241
|
+
const handleBaseAttrList = (attrList, extraAttrs, notDisplay) => {
|
|
242
|
+
return processChildren(attrList, extraAttrs, notDisplay);
|
|
240
243
|
};
|
|
241
|
-
const handleAttrList = (attrList, extraAttrs) => {
|
|
242
|
-
const parsedAttrList = processChildren(attrList, extraAttrs);
|
|
244
|
+
const handleAttrList = (attrList, extraAttrs, notDisplay) => {
|
|
245
|
+
const parsedAttrList = processChildren(attrList, extraAttrs, notDisplay);
|
|
243
246
|
const combinationGroups = parsedAttrList.filter((item) => {
|
|
244
247
|
var _a;
|
|
245
248
|
return (_a = item.json) == null ? void 0 : _a.combination;
|