szld-libs 0.3.65 → 0.3.67
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 +8970 -8960
- package/dist/szld-components.umd.js +48 -48
- package/es/components/DynamicForm/index.d.ts +1 -0
- package/es/components/DynamicForm/useDynamicForm.js +15 -10
- package/es/hooks/useUniversalTable.d.ts +2 -1
- package/es/hooks/useUniversalTable.js +180 -164
- package/lib/components/DynamicForm/index.d.ts +1 -0
- package/lib/components/DynamicForm/useDynamicForm.js +15 -10
- package/lib/hooks/useUniversalTable.d.ts +2 -1
- package/lib/hooks/useUniversalTable.js +180 -164
- package/package.json +1 -1
|
@@ -115,9 +115,13 @@ function useDynamicForm(props) {
|
|
|
115
115
|
break;
|
|
116
116
|
case "range-picker":
|
|
117
117
|
baseProps.getValueFromEvent = (date) => date == null ? void 0 : date.map((d) => d == null ? void 0 : d.format(format || "YYYY-MM-DD"));
|
|
118
|
-
baseProps.getValueProps = (value) =>
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
baseProps.getValueProps = (value) => {
|
|
119
|
+
if (!(value == null ? void 0 : value.length) && !Array.isArray(value))
|
|
120
|
+
return { value: null };
|
|
121
|
+
return {
|
|
122
|
+
value: (value == null ? void 0 : value.map((v) => dayjs(v))) || null
|
|
123
|
+
};
|
|
124
|
+
};
|
|
121
125
|
break;
|
|
122
126
|
case "multiple-date-picker":
|
|
123
127
|
baseProps.getValueFromEvent = (date) => date == null ? void 0 : date.map((d) => d == null ? void 0 : d.format(format || "YYYY-MM-DD"));
|
|
@@ -431,7 +435,7 @@ function useDynamicForm(props) {
|
|
|
431
435
|
defaultWidth = 358,
|
|
432
436
|
customWidth = {}
|
|
433
437
|
}) => {
|
|
434
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
438
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
435
439
|
const mode = item.json.input || "text";
|
|
436
440
|
const format = ((_a = item.json) == null ? void 0 : _a.format) || "";
|
|
437
441
|
const attrid = item.attrid;
|
|
@@ -611,7 +615,8 @@ function useDynamicForm(props) {
|
|
|
611
615
|
DatePicker,
|
|
612
616
|
{
|
|
613
617
|
multiple: true,
|
|
614
|
-
|
|
618
|
+
maxTagCount: ((_p = item == null ? void 0 : item.json) == null ? void 0 : _p["max-tag-count"]) || 2,
|
|
619
|
+
disabled: readonly || ((_q = item.json) == null ? void 0 : _q.readonly) || false,
|
|
615
620
|
style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
616
621
|
}
|
|
617
622
|
);
|
|
@@ -623,7 +628,7 @@ function useDynamicForm(props) {
|
|
|
623
628
|
commonRequest,
|
|
624
629
|
commonRequestWidthParams,
|
|
625
630
|
item: item.json,
|
|
626
|
-
readonly: readonly || ((
|
|
631
|
+
readonly: readonly || ((_r = item.json) == null ? void 0 : _r.readonly),
|
|
627
632
|
options: params,
|
|
628
633
|
handleUrlOptions,
|
|
629
634
|
value: formatValue,
|
|
@@ -644,7 +649,7 @@ function useDynamicForm(props) {
|
|
|
644
649
|
commonRequest,
|
|
645
650
|
commonRequestWidthParams,
|
|
646
651
|
item: item.json,
|
|
647
|
-
readonly: readonly || ((
|
|
652
|
+
readonly: readonly || ((_s = item.json) == null ? void 0 : _s.readonly),
|
|
648
653
|
options: params,
|
|
649
654
|
value: formatValue,
|
|
650
655
|
handleUrlOptions,
|
|
@@ -669,7 +674,7 @@ function useDynamicForm(props) {
|
|
|
669
674
|
uploadType: mode,
|
|
670
675
|
langId,
|
|
671
676
|
list: formatValue,
|
|
672
|
-
readonly: readonly || ((
|
|
677
|
+
readonly: readonly || ((_t = item.json) == null ? void 0 : _t.readonly),
|
|
673
678
|
relatedid,
|
|
674
679
|
relatedidKey,
|
|
675
680
|
onRemove: (file) => handleOnRemove(file)
|
|
@@ -696,7 +701,7 @@ function useDynamicForm(props) {
|
|
|
696
701
|
RadioCard,
|
|
697
702
|
{
|
|
698
703
|
item: item.json,
|
|
699
|
-
readonly: readonly || ((
|
|
704
|
+
readonly: readonly || ((_u = item.json) == null ? void 0 : _u.readonly),
|
|
700
705
|
onChange: (value) => {
|
|
701
706
|
form.setFieldValue(item.attrid, value);
|
|
702
707
|
},
|
|
@@ -711,7 +716,7 @@ function useDynamicForm(props) {
|
|
|
711
716
|
placeholder: message2 || placeholder,
|
|
712
717
|
...params,
|
|
713
718
|
showCount: true,
|
|
714
|
-
disabled: readonly || ((
|
|
719
|
+
disabled: readonly || ((_v = item.json) == null ? void 0 : _v.readonly),
|
|
715
720
|
style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
716
721
|
}
|
|
717
722
|
);
|
|
@@ -12,7 +12,7 @@ declare function useUniversalTable(): {
|
|
|
12
12
|
otherLangPageId?: string | undefined;
|
|
13
13
|
objDefaultLangPageId?: string | undefined;
|
|
14
14
|
}) => any[] | import("antd/es/message/interface").MessageType;
|
|
15
|
-
handleSelListToFormItems: ({ selListData, handleSearch, handleReset, detail, styles, attributeSetId, commonRequest, commonRequestWidthParams, getTitle, searchText, resetText, }: {
|
|
15
|
+
handleSelListToFormItems: ({ selListData, handleSearch, handleReset, detail, styles, attributeSetId, commonRequest, commonRequestWidthParams, getTitle, searchText, resetText, langConfig, }: {
|
|
16
16
|
selListData: any[];
|
|
17
17
|
handleSearch: (values: any, selListData: any[]) => void;
|
|
18
18
|
handleReset: (values: any) => void;
|
|
@@ -24,6 +24,7 @@ declare function useUniversalTable(): {
|
|
|
24
24
|
getTitle?: ((commonId: string, code: string, defaultTitle?: string) => string) | undefined;
|
|
25
25
|
searchText?: string | undefined;
|
|
26
26
|
resetText?: string | undefined;
|
|
27
|
+
langConfig?: any;
|
|
27
28
|
}) => Promise<{
|
|
28
29
|
formItems: import("szld-libs/lib/components/CreateForm").CreateFormItemProps<import("szld-libs/lib/components/CreateForm").ValueType>[];
|
|
29
30
|
selList: any[];
|
|
@@ -5,6 +5,7 @@ import { App, Flex, Space, Button, Tooltip } from "antd";
|
|
|
5
5
|
import { downloadUrl } from "../utils/download";
|
|
6
6
|
function useUniversalTable() {
|
|
7
7
|
const { message, modal } = App.useApp();
|
|
8
|
+
const attrListCache = {};
|
|
8
9
|
const handleSelListToFormItems = async ({
|
|
9
10
|
selListData,
|
|
10
11
|
handleSearch,
|
|
@@ -16,181 +17,196 @@ function useUniversalTable() {
|
|
|
16
17
|
commonRequestWidthParams,
|
|
17
18
|
getTitle,
|
|
18
19
|
searchText = "搜索",
|
|
19
|
-
resetText = "重置"
|
|
20
|
+
resetText = "重置",
|
|
21
|
+
langConfig = []
|
|
20
22
|
}) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var _a;
|
|
32
|
-
return ((_a = item.renderdata) == null ? void 0 : _a.input) !== "tab";
|
|
33
|
-
});
|
|
34
|
-
const selectItems = searchItems.filter(
|
|
35
|
-
(item) => {
|
|
36
|
-
var _a;
|
|
37
|
-
return ["select", "checkbox", "radio", "mult-select", "cascader"].includes((_a = item.renderdata) == null ? void 0 : _a.input);
|
|
23
|
+
var _a;
|
|
24
|
+
try {
|
|
25
|
+
if ((selListData == null ? void 0 : selListData.length) && detail) {
|
|
26
|
+
selListData.forEach((item) => {
|
|
27
|
+
var _a2;
|
|
28
|
+
const key = ((_a2 = item["default-render-data"]) == null ? void 0 : _a2.key) || "";
|
|
29
|
+
if (key) {
|
|
30
|
+
item.attrvalue = (detail == null ? void 0 : detail[key]) || "";
|
|
31
|
+
}
|
|
32
|
+
});
|
|
38
33
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
asid: attributeSetId
|
|
45
|
-
},
|
|
46
|
-
commonRequest
|
|
34
|
+
const searchItems = selListData.filter(
|
|
35
|
+
(item) => {
|
|
36
|
+
var _a2;
|
|
37
|
+
return ((_a2 = item.renderdata) == null ? void 0 : _a2.input) !== "tab" && !(item == null ? void 0 : item["default-render-data"]);
|
|
38
|
+
}
|
|
47
39
|
);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var _a;
|
|
53
|
-
const renderdata = item.renderdata || {};
|
|
54
|
-
const { input, width } = renderdata || {};
|
|
55
|
-
const labelCol = (renderdata == null ? void 0 : renderdata["label-col"]) || 6;
|
|
56
|
-
const renderPlaceholder = () => {
|
|
57
|
-
const value = renderdata["default-prompt"];
|
|
58
|
-
if (getTitle) {
|
|
59
|
-
if (typeof value === "string") {
|
|
60
|
-
return getTitle(attributeSetId, item.attrid, value);
|
|
61
|
-
} else if (Array.isArray(value)) {
|
|
62
|
-
return [
|
|
63
|
-
getTitle(attributeSetId, `${item.attrid}_1`, value[0]),
|
|
64
|
-
getTitle(attributeSetId, `${item.attrid}_2`, value[1])
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
return value || "";
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
let valueType = "input";
|
|
72
|
-
switch (input) {
|
|
73
|
-
case "range-picker":
|
|
74
|
-
valueType = "rangePicker";
|
|
75
|
-
break;
|
|
76
|
-
case "number":
|
|
77
|
-
valueType = "inputNumber";
|
|
78
|
-
break;
|
|
79
|
-
case "select":
|
|
80
|
-
case "checkbox":
|
|
81
|
-
case "radio":
|
|
82
|
-
case "textarea":
|
|
83
|
-
valueType = input;
|
|
84
|
-
break;
|
|
85
|
-
case "mult-select":
|
|
86
|
-
valueType = "select";
|
|
87
|
-
break;
|
|
88
|
-
case "time-picker":
|
|
89
|
-
valueType = "timePicker";
|
|
90
|
-
break;
|
|
91
|
-
case "date-picker":
|
|
92
|
-
valueType = "datePicker";
|
|
93
|
-
break;
|
|
94
|
-
case "cascader":
|
|
95
|
-
valueType = "cascader";
|
|
96
|
-
break;
|
|
97
|
-
default:
|
|
98
|
-
valueType = "input";
|
|
99
|
-
break;
|
|
40
|
+
const selectItems = searchItems.filter(
|
|
41
|
+
(item) => {
|
|
42
|
+
var _a2;
|
|
43
|
+
return ["select", "checkbox", "radio", "mult-select", "cascader"].includes((_a2 = item.renderdata) == null ? void 0 : _a2.input);
|
|
100
44
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
45
|
+
);
|
|
46
|
+
let attrList = [];
|
|
47
|
+
if (selectItems == null ? void 0 : selectItems.length) {
|
|
48
|
+
if ((_a = attrListCache[attributeSetId]) == null ? void 0 : _a.length) {
|
|
49
|
+
attrList = attrListCache[attributeSetId];
|
|
50
|
+
} else {
|
|
51
|
+
const list = await handleGetAttrList(
|
|
52
|
+
{
|
|
53
|
+
asid: attributeSetId
|
|
54
|
+
},
|
|
55
|
+
commonRequest
|
|
56
|
+
);
|
|
57
|
+
attrList = handleBaseAttrList(list) || [];
|
|
58
|
+
attrListCache[attributeSetId] = attrList || [];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const formItems = await Promise.all(
|
|
62
|
+
searchItems.map(async (item) => {
|
|
63
|
+
var _a2;
|
|
64
|
+
const renderdata = item.renderdata || {};
|
|
65
|
+
const { input, width } = renderdata || {};
|
|
66
|
+
const labelCol = (renderdata == null ? void 0 : renderdata["label-col"]) || 6;
|
|
67
|
+
const renderPlaceholder = () => {
|
|
68
|
+
const value = renderdata["default-prompt"];
|
|
69
|
+
if (getTitle) {
|
|
70
|
+
if (typeof value === "string") {
|
|
71
|
+
const getTitleResult = getTitle(attributeSetId || "", value);
|
|
72
|
+
const isGetTitleArrayStr = isArrayString(getTitleResult);
|
|
73
|
+
if (input === "range-picker" && value && isGetTitleArrayStr) {
|
|
74
|
+
return JSON.parse(getTitleResult);
|
|
75
|
+
} else {
|
|
76
|
+
return getTitleResult;
|
|
77
|
+
}
|
|
126
78
|
}
|
|
127
|
-
}
|
|
79
|
+
} else {
|
|
80
|
+
return value || "";
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
let valueType = "input";
|
|
84
|
+
switch (input) {
|
|
85
|
+
case "range-picker":
|
|
86
|
+
valueType = "rangePicker";
|
|
87
|
+
break;
|
|
88
|
+
case "number":
|
|
89
|
+
valueType = "inputNumber";
|
|
90
|
+
break;
|
|
91
|
+
case "select":
|
|
92
|
+
case "checkbox":
|
|
93
|
+
case "radio":
|
|
94
|
+
case "textarea":
|
|
95
|
+
valueType = input;
|
|
96
|
+
break;
|
|
97
|
+
case "mult-select":
|
|
98
|
+
valueType = "select";
|
|
99
|
+
break;
|
|
100
|
+
case "time-picker":
|
|
101
|
+
valueType = "timePicker";
|
|
102
|
+
break;
|
|
103
|
+
case "date-picker":
|
|
104
|
+
valueType = "datePicker";
|
|
105
|
+
break;
|
|
106
|
+
case "cascader":
|
|
107
|
+
valueType = "cascader";
|
|
108
|
+
break;
|
|
109
|
+
default:
|
|
110
|
+
valueType = "input";
|
|
111
|
+
break;
|
|
128
112
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
113
|
+
const formItem = {
|
|
114
|
+
dataIndex: item.attrid,
|
|
115
|
+
title: item.attrname || "",
|
|
116
|
+
valueType,
|
|
117
|
+
valueProps: {
|
|
118
|
+
placeholder: renderPlaceholder()
|
|
119
|
+
},
|
|
120
|
+
colProps: {},
|
|
121
|
+
formItemProps: {
|
|
122
|
+
style: { marginBottom: 10, width: typeof width === "string" ? `${width}px` : width || 240 },
|
|
123
|
+
labelCol: { span: labelCol }
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
if (["select", "checkbox", "radio", "mult-select", "cascader"].includes(input)) {
|
|
127
|
+
const attrid = item.attrid || "";
|
|
128
|
+
const attrItem = attrList.find((attrItem2) => attrItem2.attrid === attrid);
|
|
129
|
+
let json = (attrItem == null ? void 0 : attrItem.json) || {};
|
|
130
|
+
if (!(json == null ? void 0 : json.inputType) && (renderdata == null ? void 0 : renderdata["input-type"])) {
|
|
131
|
+
json = {
|
|
132
|
+
...json,
|
|
133
|
+
inputType: renderdata == null ? void 0 : renderdata["input-type"],
|
|
134
|
+
"action-url": renderdata == null ? void 0 : renderdata["action-url"],
|
|
135
|
+
"field-names": renderdata == null ? void 0 : renderdata["field-names"],
|
|
136
|
+
"key-field": {
|
|
137
|
+
...renderdata == null ? void 0 : renderdata["key-field"]
|
|
138
|
+
}
|
|
139
|
+
};
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
let options = await handleSelectOptions({
|
|
142
|
+
item: json || {},
|
|
143
|
+
commonRequest,
|
|
144
|
+
commonRequestWidthParams,
|
|
145
|
+
langConfig: langConfig || []
|
|
146
|
+
});
|
|
147
|
+
if (!(options == null ? void 0 : options.length)) {
|
|
148
|
+
const { data = [] } = renderdata || {};
|
|
149
|
+
if (data == null ? void 0 : data.length) {
|
|
150
|
+
options = data == null ? void 0 : data.map((v) => ({
|
|
151
|
+
label: v || "",
|
|
152
|
+
value: v || ""
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
if ((_a2 = renderdata == null ? void 0 : renderdata.options) == null ? void 0 : _a2.length) {
|
|
156
|
+
options = (renderdata == null ? void 0 : renderdata.options) || [];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (input === "cascader") {
|
|
160
|
+
const _options = handleCascaderOptions(options, renderdata == null ? void 0 : renderdata["field-names"]);
|
|
161
|
+
formItem.valueProps.options = _options || [];
|
|
162
|
+
} else {
|
|
163
|
+
formItem.valueProps.options = options || [];
|
|
144
164
|
}
|
|
145
165
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
166
|
+
return formItem;
|
|
167
|
+
})
|
|
168
|
+
);
|
|
169
|
+
let defaultSearchStyle = {
|
|
170
|
+
color: "#ffffff",
|
|
171
|
+
borderRadius: 4,
|
|
172
|
+
fontSize: 14,
|
|
173
|
+
height: 32
|
|
174
|
+
};
|
|
175
|
+
let defaultResetStyle = {
|
|
176
|
+
color: "#333333",
|
|
177
|
+
borderRadius: 4,
|
|
178
|
+
fontSize: 14,
|
|
179
|
+
height: 32,
|
|
180
|
+
borderColor: "#D9D9D9"
|
|
181
|
+
};
|
|
182
|
+
formItems.push({
|
|
183
|
+
dataIndex: "btns",
|
|
184
|
+
valueType: "btns",
|
|
185
|
+
valueProps: [
|
|
186
|
+
{
|
|
187
|
+
btnType: "submit",
|
|
188
|
+
title: searchText,
|
|
189
|
+
type: "primary",
|
|
190
|
+
shape: "default",
|
|
191
|
+
style: { ...defaultSearchStyle, ...styles == null ? void 0 : styles.searchStyle },
|
|
192
|
+
onClick: (values) => handleSearch(values, selListData)
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
btnType: "reset",
|
|
196
|
+
title: resetText,
|
|
197
|
+
style: { ...defaultResetStyle, ...styles == null ? void 0 : styles.resetStyle },
|
|
198
|
+
onClick: () => handleReset(selListData)
|
|
151
199
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
);
|
|
156
|
-
let defaultSearchStyle = {
|
|
157
|
-
color: "#ffffff",
|
|
158
|
-
borderRadius: 4,
|
|
159
|
-
fontSize: 14,
|
|
160
|
-
height: 32
|
|
161
|
-
};
|
|
162
|
-
let defaultResetStyle = {
|
|
163
|
-
color: "#333333",
|
|
164
|
-
borderRadius: 4,
|
|
165
|
-
fontSize: 14,
|
|
166
|
-
height: 32,
|
|
167
|
-
borderColor: "#D9D9D9"
|
|
168
|
-
};
|
|
169
|
-
formItems.push({
|
|
170
|
-
dataIndex: "btns",
|
|
171
|
-
valueType: "btns",
|
|
172
|
-
valueProps: [
|
|
173
|
-
{
|
|
174
|
-
btnType: "submit",
|
|
175
|
-
title: searchText,
|
|
176
|
-
type: "primary",
|
|
177
|
-
shape: "default",
|
|
178
|
-
style: { ...defaultSearchStyle, ...styles == null ? void 0 : styles.searchStyle },
|
|
179
|
-
onClick: (values) => handleSearch(values, selListData)
|
|
200
|
+
],
|
|
201
|
+
colProps: {
|
|
202
|
+
flex: "none"
|
|
180
203
|
},
|
|
181
|
-
{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
],
|
|
188
|
-
colProps: {
|
|
189
|
-
flex: "none"
|
|
190
|
-
},
|
|
191
|
-
formItemProps: { style: { marginBottom: 10, minWidth: 127 } }
|
|
192
|
-
});
|
|
193
|
-
return { formItems, selList: selListData };
|
|
204
|
+
formItemProps: { style: { marginBottom: 10, minWidth: 127 } }
|
|
205
|
+
});
|
|
206
|
+
return { formItems, selList: selListData };
|
|
207
|
+
} catch (error) {
|
|
208
|
+
return { formItems: [], selList: [] };
|
|
209
|
+
}
|
|
194
210
|
};
|
|
195
211
|
const handleUniversalHeaderToColumns = ({
|
|
196
212
|
universalHeader,
|
|
@@ -116,9 +116,13 @@ function useDynamicForm(props) {
|
|
|
116
116
|
break;
|
|
117
117
|
case "range-picker":
|
|
118
118
|
baseProps.getValueFromEvent = (date) => date == null ? void 0 : date.map((d) => d == null ? void 0 : d.format(format || "YYYY-MM-DD"));
|
|
119
|
-
baseProps.getValueProps = (value) =>
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
baseProps.getValueProps = (value) => {
|
|
120
|
+
if (!(value == null ? void 0 : value.length) && !Array.isArray(value))
|
|
121
|
+
return { value: null };
|
|
122
|
+
return {
|
|
123
|
+
value: (value == null ? void 0 : value.map((v) => dayjs(v))) || null
|
|
124
|
+
};
|
|
125
|
+
};
|
|
122
126
|
break;
|
|
123
127
|
case "multiple-date-picker":
|
|
124
128
|
baseProps.getValueFromEvent = (date) => date == null ? void 0 : date.map((d) => d == null ? void 0 : d.format(format || "YYYY-MM-DD"));
|
|
@@ -432,7 +436,7 @@ function useDynamicForm(props) {
|
|
|
432
436
|
defaultWidth = 358,
|
|
433
437
|
customWidth = {}
|
|
434
438
|
}) => {
|
|
435
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
439
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
436
440
|
const mode = item.json.input || "text";
|
|
437
441
|
const format = ((_a = item.json) == null ? void 0 : _a.format) || "";
|
|
438
442
|
const attrid = item.attrid;
|
|
@@ -612,7 +616,8 @@ function useDynamicForm(props) {
|
|
|
612
616
|
antd.DatePicker,
|
|
613
617
|
{
|
|
614
618
|
multiple: true,
|
|
615
|
-
|
|
619
|
+
maxTagCount: ((_p = item == null ? void 0 : item.json) == null ? void 0 : _p["max-tag-count"]) || 2,
|
|
620
|
+
disabled: readonly || ((_q = item.json) == null ? void 0 : _q.readonly) || false,
|
|
616
621
|
style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
617
622
|
}
|
|
618
623
|
);
|
|
@@ -624,7 +629,7 @@ function useDynamicForm(props) {
|
|
|
624
629
|
commonRequest,
|
|
625
630
|
commonRequestWidthParams,
|
|
626
631
|
item: item.json,
|
|
627
|
-
readonly: readonly || ((
|
|
632
|
+
readonly: readonly || ((_r = item.json) == null ? void 0 : _r.readonly),
|
|
628
633
|
options: params,
|
|
629
634
|
handleUrlOptions: method.handleUrlOptions,
|
|
630
635
|
value: formatValue,
|
|
@@ -645,7 +650,7 @@ function useDynamicForm(props) {
|
|
|
645
650
|
commonRequest,
|
|
646
651
|
commonRequestWidthParams,
|
|
647
652
|
item: item.json,
|
|
648
|
-
readonly: readonly || ((
|
|
653
|
+
readonly: readonly || ((_s = item.json) == null ? void 0 : _s.readonly),
|
|
649
654
|
options: params,
|
|
650
655
|
value: formatValue,
|
|
651
656
|
handleUrlOptions: method.handleUrlOptions,
|
|
@@ -670,7 +675,7 @@ function useDynamicForm(props) {
|
|
|
670
675
|
uploadType: mode,
|
|
671
676
|
langId,
|
|
672
677
|
list: formatValue,
|
|
673
|
-
readonly: readonly || ((
|
|
678
|
+
readonly: readonly || ((_t = item.json) == null ? void 0 : _t.readonly),
|
|
674
679
|
relatedid,
|
|
675
680
|
relatedidKey,
|
|
676
681
|
onRemove: (file) => handleOnRemove(file)
|
|
@@ -697,7 +702,7 @@ function useDynamicForm(props) {
|
|
|
697
702
|
RadioCard,
|
|
698
703
|
{
|
|
699
704
|
item: item.json,
|
|
700
|
-
readonly: readonly || ((
|
|
705
|
+
readonly: readonly || ((_u = item.json) == null ? void 0 : _u.readonly),
|
|
701
706
|
onChange: (value) => {
|
|
702
707
|
form.setFieldValue(item.attrid, value);
|
|
703
708
|
},
|
|
@@ -712,7 +717,7 @@ function useDynamicForm(props) {
|
|
|
712
717
|
placeholder: message2 || placeholder,
|
|
713
718
|
...params,
|
|
714
719
|
showCount: true,
|
|
715
|
-
disabled: readonly || ((
|
|
720
|
+
disabled: readonly || ((_v = item.json) == null ? void 0 : _v.readonly),
|
|
716
721
|
style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
717
722
|
}
|
|
718
723
|
);
|
|
@@ -12,7 +12,7 @@ declare function useUniversalTable(): {
|
|
|
12
12
|
otherLangPageId?: string | undefined;
|
|
13
13
|
objDefaultLangPageId?: string | undefined;
|
|
14
14
|
}) => any[] | import("antd/es/message/interface").MessageType;
|
|
15
|
-
handleSelListToFormItems: ({ selListData, handleSearch, handleReset, detail, styles, attributeSetId, commonRequest, commonRequestWidthParams, getTitle, searchText, resetText, }: {
|
|
15
|
+
handleSelListToFormItems: ({ selListData, handleSearch, handleReset, detail, styles, attributeSetId, commonRequest, commonRequestWidthParams, getTitle, searchText, resetText, langConfig, }: {
|
|
16
16
|
selListData: any[];
|
|
17
17
|
handleSearch: (values: any, selListData: any[]) => void;
|
|
18
18
|
handleReset: (values: any) => void;
|
|
@@ -24,6 +24,7 @@ declare function useUniversalTable(): {
|
|
|
24
24
|
getTitle?: ((commonId: string, code: string, defaultTitle?: string) => string) | undefined;
|
|
25
25
|
searchText?: string | undefined;
|
|
26
26
|
resetText?: string | undefined;
|
|
27
|
+
langConfig?: any;
|
|
27
28
|
}) => Promise<{
|
|
28
29
|
formItems: import("szld-libs/lib/components/CreateForm").CreateFormItemProps<import("szld-libs/lib/components/CreateForm").ValueType>[];
|
|
29
30
|
selList: any[];
|