szld-libs 0.3.48 → 0.3.50
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 +1221 -1221
- package/dist/szld-components.umd.js +35 -35
- package/es/components/DynamicForm/func.js +1 -1
- package/es/components/DynamicForm/myCheckbox/index.js +1 -1
- package/es/components/DynamicForm/myRadio/index.js +1 -1
- package/es/components/DynamicForm/mySelect/index.js +1 -1
- package/es/components/DynamicForm/useDynamicForm.js +2 -2
- package/es/index.js +8 -12
- package/es/mock/index.d.ts +1 -1
- package/es/mock/index.js +994 -84
- package/lib/components/DynamicForm/func.js +1 -1
- package/lib/components/DynamicForm/myCheckbox/index.js +1 -1
- package/lib/components/DynamicForm/myRadio/index.js +1 -1
- package/lib/components/DynamicForm/mySelect/index.js +1 -1
- package/lib/components/DynamicForm/useDynamicForm.js +2 -2
- package/lib/index.js +7 -11
- package/lib/mock/index.d.ts +1 -1
- package/lib/mock/index.js +994 -84
- package/package.json +1 -1
|
@@ -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: val,
|
|
200
|
+
label: getTitle(langConfig || [], val),
|
|
201
201
|
value: val
|
|
202
202
|
}))) || [];
|
|
203
203
|
if (item.options && Array.isArray(item.options)) {
|
|
@@ -24,7 +24,7 @@ const MyCheckbox = (props) => {
|
|
|
24
24
|
const [val, setVal] = react.useState(value || []);
|
|
25
25
|
react.useEffect(() => {
|
|
26
26
|
handleLoadOptions();
|
|
27
|
-
}, [item.inputType, item.classify, item.data, item.options]);
|
|
27
|
+
}, [item.inputType, item.classify, item.data, item.options, langConfig]);
|
|
28
28
|
const handleLoadOptions = async () => {
|
|
29
29
|
const list2 = await func.handleSelectOptions({
|
|
30
30
|
commonRequestWidthParams,
|
|
@@ -22,7 +22,7 @@ const MyRadio = (props) => {
|
|
|
22
22
|
const [list, setList] = react.useState([]);
|
|
23
23
|
react.useEffect(() => {
|
|
24
24
|
handleLoadOptions();
|
|
25
|
-
}, [item.inputType, item.classify, item.data, item.options]);
|
|
25
|
+
}, [item.inputType, item.classify, item.data, item.options, langConfig]);
|
|
26
26
|
const handleLoadOptions = async () => {
|
|
27
27
|
const list2 = await func.handleSelectOptions({
|
|
28
28
|
commonRequestWidthParams,
|
|
@@ -22,7 +22,7 @@ const MySelect = ({
|
|
|
22
22
|
const [loading, setLoading] = react.useState(false);
|
|
23
23
|
react.useEffect(() => {
|
|
24
24
|
handleLoadOptions();
|
|
25
|
-
}, [item.inputType, item.classify, item.data, item.options]);
|
|
25
|
+
}, [item.inputType, item.classify, item.data, item.options, langConfig]);
|
|
26
26
|
const handleLoadOptions = async () => {
|
|
27
27
|
setLoading(true);
|
|
28
28
|
const list = await func.handleSelectOptions({
|
|
@@ -303,7 +303,7 @@ function useDynamicForm(props) {
|
|
|
303
303
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
304
304
|
antd.Form.Item,
|
|
305
305
|
{
|
|
306
|
-
label: (_c = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _c["combination-name"],
|
|
306
|
+
label: func.getTitle(langConfig, (_c = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _c["combination-name"]),
|
|
307
307
|
required: (_d = itemWithJson.json) == null ? void 0 : _d.must,
|
|
308
308
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Space.Compact, { children: combinations.map((item, index) => {
|
|
309
309
|
var _a2, _b2, _c2, _d2;
|
|
@@ -398,7 +398,7 @@ function useDynamicForm(props) {
|
|
|
398
398
|
}
|
|
399
399
|
return null;
|
|
400
400
|
},
|
|
401
|
-
[handleDealInstruction, func.handleSetFormItemInitialValue, handleSetFormItemProps, renderNestedFormList]
|
|
401
|
+
[handleDealInstruction, func.handleSetFormItemInitialValue, handleSetFormItemProps, renderNestedFormList, langConfig]
|
|
402
402
|
);
|
|
403
403
|
const handleOnRemove = async (file) => {
|
|
404
404
|
var _a;
|
package/lib/index.js
CHANGED
|
@@ -17,18 +17,14 @@ const Demo = () => {
|
|
|
17
17
|
const formRef = react.useRef(null);
|
|
18
18
|
const [form] = antd.Form.useForm();
|
|
19
19
|
const [list, setList] = react.useState(method.handleAttrList(mock.attrList));
|
|
20
|
+
const [langList, setLangList] = react.useState([]);
|
|
20
21
|
const onValuesChange = async (values, allValues) => {
|
|
21
|
-
const keys = Object.keys(values);
|
|
22
|
-
if (keys.includes("6A5984BD547449088172BD33F2A965E8")) {
|
|
23
|
-
list.forEach((item) => {
|
|
24
|
-
if (item.attrid === "4E507938BE7448E5883CFCD9C962707D") {
|
|
25
|
-
item.json.data = ["1", "2", "3"];
|
|
26
|
-
item.info = JSON.stringify(item == null ? void 0 : item.json);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
setList([...list]);
|
|
30
|
-
}
|
|
31
22
|
};
|
|
23
|
+
react.useEffect(() => {
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
setLangList(mock.langConfig);
|
|
26
|
+
}, 2e3);
|
|
27
|
+
}, [mock.langConfig]);
|
|
32
28
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
33
29
|
/* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
|
|
34
30
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {}, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Form, { form, onValuesChange, children: [
|
|
@@ -47,7 +43,7 @@ const Demo = () => {
|
|
|
47
43
|
instructionShowMode: "icon",
|
|
48
44
|
ref: formRef,
|
|
49
45
|
langId: "10001",
|
|
50
|
-
langConfig:
|
|
46
|
+
langConfig: langList
|
|
51
47
|
}
|
|
52
48
|
),
|
|
53
49
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "submit", style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", htmlType: "submit", children: "提交" }) })
|