szld-libs 0.3.79 → 0.3.81
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 +5771 -5850
- package/dist/szld-components.umd.js +38 -38
- package/es/components/DynamicFormMobile/func.d.ts +1 -2
- package/es/components/DynamicFormMobile/func.js +1 -2
- package/es/components/DynamicFormMobile/myCheckbox/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/myCheckbox/index.js +15 -68
- package/es/components/DynamicFormMobile/myRadio/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/myRadio/index.js +15 -70
- package/es/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
- package/es/components/DynamicFormMobile/useDynamicForm.js +0 -2
- package/lib/components/DynamicFormMobile/func.d.ts +1 -2
- package/lib/components/DynamicFormMobile/func.js +1 -2
- package/lib/components/DynamicFormMobile/myCheckbox/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/myCheckbox/index.js +15 -68
- package/lib/components/DynamicFormMobile/myRadio/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/myRadio/index.js +15 -70
- package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
- package/lib/components/DynamicFormMobile/useDynamicForm.js +0 -2
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
|
29
29
|
* @param param0
|
|
30
30
|
* @returns
|
|
31
31
|
*/
|
|
32
|
-
export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item,
|
|
32
|
+
export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, }: {
|
|
33
33
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
34
34
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
35
35
|
interfaceTypeDict?: string | undefined;
|
|
@@ -37,7 +37,6 @@ export declare const handleSelectOptions: ({ commonRequestWidthParams, commonReq
|
|
|
37
37
|
actionUrlKey?: string | undefined;
|
|
38
38
|
actionUrlExtraParams?: object | undefined;
|
|
39
39
|
item: Ijson;
|
|
40
|
-
langConfig?: any[] | undefined;
|
|
41
40
|
}) => Promise<any[]>;
|
|
42
41
|
/**
|
|
43
42
|
* 单层详情数据对应到单个属性集
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { App, Checkbox } from "antd";
|
|
4
|
+
import { handleSelectOptions } from "../../DynamicForm/func";
|
|
4
5
|
const MyCheckbox = (props) => {
|
|
5
6
|
const {
|
|
6
7
|
item,
|
|
@@ -18,77 +19,23 @@ const MyCheckbox = (props) => {
|
|
|
18
19
|
actionUrlExtraParams,
|
|
19
20
|
langId
|
|
20
21
|
} = props;
|
|
21
|
-
|
|
22
|
+
App.useApp();
|
|
22
23
|
const [list, setList] = useState([]);
|
|
23
24
|
const [val, setVal] = useState(value || []);
|
|
24
25
|
useEffect(() => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!id) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const res = await commonRequest(interfaceType, { asctypeid: id });
|
|
42
|
-
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
43
|
-
const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
|
|
44
|
-
setList(
|
|
45
|
-
arr.map((v) => {
|
|
46
|
-
const value2 = v.dicid + "-" + v.info;
|
|
47
|
-
return { value: value2, label: value2 };
|
|
48
|
-
})
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const getUrlList = async () => {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
try {
|
|
55
|
-
const keyFieldList = ((_a = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a.list) || [];
|
|
56
|
-
const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
|
|
57
|
-
if (!keyFieldList.length) {
|
|
58
|
-
message.error(langId === "10001" ? "请配置key-field" : "Please configure key-field");
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const response = await commonRequestWidthParams(
|
|
62
|
-
{
|
|
63
|
-
PageName: "dns_relay",
|
|
64
|
-
Controlname: "CallActionUrl",
|
|
65
|
-
InterfaceType: ""
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
69
|
-
...actionUrlExtraParams
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
if (response == null ? void 0 : response.data) {
|
|
73
|
-
const data = response == null ? void 0 : response.data;
|
|
74
|
-
const list2 = data == null ? void 0 : data.list;
|
|
75
|
-
let urlData = [];
|
|
76
|
-
if (Array.isArray(data)) {
|
|
77
|
-
urlData = data;
|
|
78
|
-
}
|
|
79
|
-
if (Array.isArray(list2)) {
|
|
80
|
-
urlData = list2;
|
|
81
|
-
}
|
|
82
|
-
const urlOptions = urlData.map((val2) => ({
|
|
83
|
-
label: handleUrlOptions(val2, delimiter, keyFieldList),
|
|
84
|
-
value: handleUrlOptions(val2, delimiter, keyFieldList)
|
|
85
|
-
}));
|
|
86
|
-
setList([...urlOptions]);
|
|
87
|
-
}
|
|
88
|
-
} catch (error) {
|
|
89
|
-
message.error(langId === "10001" ? "加载选项失败" : "Failed to load options");
|
|
90
|
-
} finally {
|
|
91
|
-
}
|
|
26
|
+
handleLoadOptions();
|
|
27
|
+
}, [item.inputType, item.classify, item.data, item.options]);
|
|
28
|
+
const handleLoadOptions = async () => {
|
|
29
|
+
const list2 = await handleSelectOptions({
|
|
30
|
+
commonRequestWidthParams,
|
|
31
|
+
commonRequest,
|
|
32
|
+
interfaceTypeDict,
|
|
33
|
+
interfaceTypeSysDict,
|
|
34
|
+
actionUrlKey,
|
|
35
|
+
actionUrlExtraParams,
|
|
36
|
+
item
|
|
37
|
+
});
|
|
38
|
+
setList(list2);
|
|
92
39
|
};
|
|
93
40
|
return /* @__PURE__ */ jsx(
|
|
94
41
|
Checkbox.Group,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RadioChangeEvent } from 'antd';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
|
-
import { Ijson } from '
|
|
3
|
+
import { Ijson } from '../../DynamicForm/index.d';
|
|
4
4
|
export interface IMYRadio {
|
|
5
5
|
onChange?: (e: RadioChangeEvent) => void;
|
|
6
6
|
value?: string | number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { App, Radio } from "antd";
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
|
+
import { handleSelectOptions } from "../../DynamicForm/func";
|
|
4
5
|
const MyRadio = (props) => {
|
|
5
6
|
const {
|
|
6
7
|
item,
|
|
@@ -18,78 +19,22 @@ const MyRadio = (props) => {
|
|
|
18
19
|
actionUrlExtraParams,
|
|
19
20
|
langId
|
|
20
21
|
} = props;
|
|
21
|
-
|
|
22
|
+
App.useApp();
|
|
22
23
|
const [list, setList] = useState([]);
|
|
23
24
|
useEffect(() => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!id) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const res = await commonRequest(interfaceType, { asctypeid: id });
|
|
41
|
-
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
42
|
-
const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
|
|
43
|
-
setList(
|
|
44
|
-
arr.map((v) => {
|
|
45
|
-
const value2 = v.dicid + "-" + v.info;
|
|
46
|
-
return { value: value2, label: value2 };
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const getUrlList = async () => {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
try {
|
|
54
|
-
const keyFieldList = ((_a = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a.list) || [];
|
|
55
|
-
const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
|
|
56
|
-
if (!keyFieldList.length) {
|
|
57
|
-
message.error(langId === "10001" ? "请配置key-field" : "Please configure key-field");
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (!commonRequestWidthParams)
|
|
61
|
-
return;
|
|
62
|
-
const response = await commonRequestWidthParams(
|
|
63
|
-
{
|
|
64
|
-
PageName: "dns_relay",
|
|
65
|
-
Controlname: "CallActionUrl",
|
|
66
|
-
InterfaceType: ""
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
70
|
-
...actionUrlExtraParams
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
if (response == null ? void 0 : response.data) {
|
|
74
|
-
const data = response == null ? void 0 : response.data;
|
|
75
|
-
const list2 = data == null ? void 0 : data.list;
|
|
76
|
-
let urlData = [];
|
|
77
|
-
if (Array.isArray(data)) {
|
|
78
|
-
urlData = data;
|
|
79
|
-
}
|
|
80
|
-
if (Array.isArray(list2)) {
|
|
81
|
-
urlData = list2;
|
|
82
|
-
}
|
|
83
|
-
const urlOptions = urlData.map((val) => ({
|
|
84
|
-
label: handleUrlOptions(val, delimiter, keyFieldList),
|
|
85
|
-
value: handleUrlOptions(val, delimiter, keyFieldList)
|
|
86
|
-
}));
|
|
87
|
-
setList([...urlOptions]);
|
|
88
|
-
}
|
|
89
|
-
} catch (error) {
|
|
90
|
-
message.error(langId === "10001" ? "加载选项失败" : "Failed to load options");
|
|
91
|
-
} finally {
|
|
92
|
-
}
|
|
25
|
+
handleLoadOptions();
|
|
26
|
+
}, [item.inputType, item.classify, item.data, item.options]);
|
|
27
|
+
const handleLoadOptions = async () => {
|
|
28
|
+
const list2 = await handleSelectOptions({
|
|
29
|
+
commonRequestWidthParams,
|
|
30
|
+
commonRequest,
|
|
31
|
+
interfaceTypeDict,
|
|
32
|
+
interfaceTypeSysDict,
|
|
33
|
+
actionUrlKey,
|
|
34
|
+
actionUrlExtraParams,
|
|
35
|
+
item
|
|
36
|
+
});
|
|
37
|
+
setList(list2);
|
|
93
38
|
};
|
|
94
39
|
return /* @__PURE__ */ jsx(
|
|
95
40
|
Radio.Group,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IformConfigItem, IformItemStyle } from '
|
|
2
|
+
import { IformConfigItem, IformItemStyle } from '../DynamicForm/index.d';
|
|
3
3
|
import { AxiosResponse } from 'axios';
|
|
4
4
|
import { FormListFieldData, UploadFile } from 'antd';
|
|
5
5
|
import { FormInstance } from 'react-vant';
|
|
@@ -40,6 +40,6 @@ declare function useDynamicForm(props: IDynamicFormProps): {
|
|
|
40
40
|
formListField?: NestedFormListFieldData | undefined;
|
|
41
41
|
isShowLabel?: boolean | undefined;
|
|
42
42
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
43
|
-
handleSetFormItemInitialValue: (itemWithJson: IformConfigItem) => any;
|
|
43
|
+
handleSetFormItemInitialValue: (itemWithJson: import(".").IformConfigItem) => any;
|
|
44
44
|
};
|
|
45
45
|
export default useDynamicForm;
|
|
@@ -599,7 +599,6 @@ function useDynamicForm(props) {
|
|
|
599
599
|
}
|
|
600
600
|
case "range-picker":
|
|
601
601
|
return /* @__PURE__ */ jsx(Calendar, { type: "range", children: (val, actions) => {
|
|
602
|
-
form.setFieldValue(item.attrid, val);
|
|
603
602
|
return /* @__PURE__ */ jsx(
|
|
604
603
|
Cell,
|
|
605
604
|
{
|
|
@@ -613,7 +612,6 @@ function useDynamicForm(props) {
|
|
|
613
612
|
} });
|
|
614
613
|
case "multiple-date-picker":
|
|
615
614
|
return /* @__PURE__ */ jsx(Calendar, { type: "multiple", children: (val, actions) => {
|
|
616
|
-
form.setFieldValue(item.attrid, val);
|
|
617
615
|
return /* @__PURE__ */ jsx(
|
|
618
616
|
Cell,
|
|
619
617
|
{
|
|
@@ -29,7 +29,7 @@ export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
|
29
29
|
* @param param0
|
|
30
30
|
* @returns
|
|
31
31
|
*/
|
|
32
|
-
export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item,
|
|
32
|
+
export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, }: {
|
|
33
33
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
34
34
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
35
35
|
interfaceTypeDict?: string | undefined;
|
|
@@ -37,7 +37,6 @@ export declare const handleSelectOptions: ({ commonRequestWidthParams, commonReq
|
|
|
37
37
|
actionUrlKey?: string | undefined;
|
|
38
38
|
actionUrlExtraParams?: object | undefined;
|
|
39
39
|
item: Ijson;
|
|
40
|
-
langConfig?: any[] | undefined;
|
|
41
40
|
}) => Promise<any[]>;
|
|
42
41
|
/**
|
|
43
42
|
* 单层详情数据对应到单个属性集
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const react = require("react");
|
|
4
4
|
const antd = require("antd");
|
|
5
|
+
const func = require("../../DynamicForm/func");
|
|
5
6
|
const MyCheckbox = (props) => {
|
|
6
7
|
const {
|
|
7
8
|
item,
|
|
@@ -19,77 +20,23 @@ const MyCheckbox = (props) => {
|
|
|
19
20
|
actionUrlExtraParams,
|
|
20
21
|
langId
|
|
21
22
|
} = props;
|
|
22
|
-
|
|
23
|
+
antd.App.useApp();
|
|
23
24
|
const [list, setList] = react.useState([]);
|
|
24
25
|
const [val, setVal] = react.useState(value || []);
|
|
25
26
|
react.useEffect(() => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!id) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const res = await commonRequest(interfaceType, { asctypeid: id });
|
|
43
|
-
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
44
|
-
const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
|
|
45
|
-
setList(
|
|
46
|
-
arr.map((v) => {
|
|
47
|
-
const value2 = v.dicid + "-" + v.info;
|
|
48
|
-
return { value: value2, label: value2 };
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const getUrlList = async () => {
|
|
54
|
-
var _a, _b;
|
|
55
|
-
try {
|
|
56
|
-
const keyFieldList = ((_a = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a.list) || [];
|
|
57
|
-
const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
|
|
58
|
-
if (!keyFieldList.length) {
|
|
59
|
-
message.error(langId === "10001" ? "请配置key-field" : "Please configure key-field");
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const response = await commonRequestWidthParams(
|
|
63
|
-
{
|
|
64
|
-
PageName: "dns_relay",
|
|
65
|
-
Controlname: "CallActionUrl",
|
|
66
|
-
InterfaceType: ""
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
70
|
-
...actionUrlExtraParams
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
if (response == null ? void 0 : response.data) {
|
|
74
|
-
const data = response == null ? void 0 : response.data;
|
|
75
|
-
const list2 = data == null ? void 0 : data.list;
|
|
76
|
-
let urlData = [];
|
|
77
|
-
if (Array.isArray(data)) {
|
|
78
|
-
urlData = data;
|
|
79
|
-
}
|
|
80
|
-
if (Array.isArray(list2)) {
|
|
81
|
-
urlData = list2;
|
|
82
|
-
}
|
|
83
|
-
const urlOptions = urlData.map((val2) => ({
|
|
84
|
-
label: handleUrlOptions(val2, delimiter, keyFieldList),
|
|
85
|
-
value: handleUrlOptions(val2, delimiter, keyFieldList)
|
|
86
|
-
}));
|
|
87
|
-
setList([...urlOptions]);
|
|
88
|
-
}
|
|
89
|
-
} catch (error) {
|
|
90
|
-
message.error(langId === "10001" ? "加载选项失败" : "Failed to load options");
|
|
91
|
-
} finally {
|
|
92
|
-
}
|
|
27
|
+
handleLoadOptions();
|
|
28
|
+
}, [item.inputType, item.classify, item.data, item.options]);
|
|
29
|
+
const handleLoadOptions = async () => {
|
|
30
|
+
const list2 = await func.handleSelectOptions({
|
|
31
|
+
commonRequestWidthParams,
|
|
32
|
+
commonRequest,
|
|
33
|
+
interfaceTypeDict,
|
|
34
|
+
interfaceTypeSysDict,
|
|
35
|
+
actionUrlKey,
|
|
36
|
+
actionUrlExtraParams,
|
|
37
|
+
item
|
|
38
|
+
});
|
|
39
|
+
setList(list2);
|
|
93
40
|
};
|
|
94
41
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
42
|
antd.Checkbox.Group,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RadioChangeEvent } from 'antd';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
|
-
import { Ijson } from '
|
|
3
|
+
import { Ijson } from '../../DynamicForm/index.d';
|
|
4
4
|
export interface IMYRadio {
|
|
5
5
|
onChange?: (e: RadioChangeEvent) => void;
|
|
6
6
|
value?: string | number;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const antd = require("antd");
|
|
4
4
|
const react = require("react");
|
|
5
|
+
const func = require("../../DynamicForm/func");
|
|
5
6
|
const MyRadio = (props) => {
|
|
6
7
|
const {
|
|
7
8
|
item,
|
|
@@ -19,78 +20,22 @@ const MyRadio = (props) => {
|
|
|
19
20
|
actionUrlExtraParams,
|
|
20
21
|
langId
|
|
21
22
|
} = props;
|
|
22
|
-
|
|
23
|
+
antd.App.useApp();
|
|
23
24
|
const [list, setList] = react.useState([]);
|
|
24
25
|
react.useEffect(() => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!id) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const res = await commonRequest(interfaceType, { asctypeid: id });
|
|
42
|
-
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
43
|
-
const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
|
|
44
|
-
setList(
|
|
45
|
-
arr.map((v) => {
|
|
46
|
-
const value2 = v.dicid + "-" + v.info;
|
|
47
|
-
return { value: value2, label: value2 };
|
|
48
|
-
})
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const getUrlList = async () => {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
try {
|
|
55
|
-
const keyFieldList = ((_a = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a.list) || [];
|
|
56
|
-
const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
|
|
57
|
-
if (!keyFieldList.length) {
|
|
58
|
-
message.error(langId === "10001" ? "请配置key-field" : "Please configure key-field");
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (!commonRequestWidthParams)
|
|
62
|
-
return;
|
|
63
|
-
const response = await commonRequestWidthParams(
|
|
64
|
-
{
|
|
65
|
-
PageName: "dns_relay",
|
|
66
|
-
Controlname: "CallActionUrl",
|
|
67
|
-
InterfaceType: ""
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
71
|
-
...actionUrlExtraParams
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
if (response == null ? void 0 : response.data) {
|
|
75
|
-
const data = response == null ? void 0 : response.data;
|
|
76
|
-
const list2 = data == null ? void 0 : data.list;
|
|
77
|
-
let urlData = [];
|
|
78
|
-
if (Array.isArray(data)) {
|
|
79
|
-
urlData = data;
|
|
80
|
-
}
|
|
81
|
-
if (Array.isArray(list2)) {
|
|
82
|
-
urlData = list2;
|
|
83
|
-
}
|
|
84
|
-
const urlOptions = urlData.map((val) => ({
|
|
85
|
-
label: handleUrlOptions(val, delimiter, keyFieldList),
|
|
86
|
-
value: handleUrlOptions(val, delimiter, keyFieldList)
|
|
87
|
-
}));
|
|
88
|
-
setList([...urlOptions]);
|
|
89
|
-
}
|
|
90
|
-
} catch (error) {
|
|
91
|
-
message.error(langId === "10001" ? "加载选项失败" : "Failed to load options");
|
|
92
|
-
} finally {
|
|
93
|
-
}
|
|
26
|
+
handleLoadOptions();
|
|
27
|
+
}, [item.inputType, item.classify, item.data, item.options]);
|
|
28
|
+
const handleLoadOptions = async () => {
|
|
29
|
+
const list2 = await func.handleSelectOptions({
|
|
30
|
+
commonRequestWidthParams,
|
|
31
|
+
commonRequest,
|
|
32
|
+
interfaceTypeDict,
|
|
33
|
+
interfaceTypeSysDict,
|
|
34
|
+
actionUrlKey,
|
|
35
|
+
actionUrlExtraParams,
|
|
36
|
+
item
|
|
37
|
+
});
|
|
38
|
+
setList(list2);
|
|
94
39
|
};
|
|
95
40
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
41
|
antd.Radio.Group,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IformConfigItem, IformItemStyle } from '
|
|
2
|
+
import { IformConfigItem, IformItemStyle } from '../DynamicForm/index.d';
|
|
3
3
|
import { AxiosResponse } from 'axios';
|
|
4
4
|
import { FormListFieldData, UploadFile } from 'antd';
|
|
5
5
|
import { FormInstance } from 'react-vant';
|
|
@@ -40,6 +40,6 @@ declare function useDynamicForm(props: IDynamicFormProps): {
|
|
|
40
40
|
formListField?: NestedFormListFieldData | undefined;
|
|
41
41
|
isShowLabel?: boolean | undefined;
|
|
42
42
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
43
|
-
handleSetFormItemInitialValue: (itemWithJson: IformConfigItem) => any;
|
|
43
|
+
handleSetFormItemInitialValue: (itemWithJson: import(".").IformConfigItem) => any;
|
|
44
44
|
};
|
|
45
45
|
export default useDynamicForm;
|
|
@@ -600,7 +600,6 @@ function useDynamicForm(props) {
|
|
|
600
600
|
}
|
|
601
601
|
case "range-picker":
|
|
602
602
|
return /* @__PURE__ */ jsxRuntime.jsx(reactVant.Calendar, { type: "range", children: (val, actions) => {
|
|
603
|
-
form.setFieldValue(item.attrid, val);
|
|
604
603
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
605
604
|
reactVant.Cell,
|
|
606
605
|
{
|
|
@@ -614,7 +613,6 @@ function useDynamicForm(props) {
|
|
|
614
613
|
} });
|
|
615
614
|
case "multiple-date-picker":
|
|
616
615
|
return /* @__PURE__ */ jsxRuntime.jsx(reactVant.Calendar, { type: "multiple", children: (val, actions) => {
|
|
617
|
-
form.setFieldValue(item.attrid, val);
|
|
618
616
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
619
617
|
reactVant.Cell,
|
|
620
618
|
{
|