szld-libs 0.3.43 → 0.3.46
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 +10404 -10542
- package/dist/szld-components.umd.js +40 -40
- package/es/components/DynamicForm/func.d.ts +1 -18
- package/es/components/DynamicForm/func.js +0 -101
- 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 +2 -1
- package/es/components/DynamicForm/useDynamicForm.js +2 -2
- package/es/components/DynamicFormMobile/func.d.ts +1 -18
- package/es/components/DynamicFormMobile/func.js +0 -101
- package/es/components/DynamicFormMobile/mySelect/index.js +1 -1
- package/es/utils/method.d.ts +5 -0
- package/es/utils/method.js +5 -1
- package/lib/components/DynamicForm/func.d.ts +1 -18
- package/lib/components/DynamicForm/func.js +0 -101
- package/lib/components/DynamicForm/myCheckbox/index.js +2 -2
- package/lib/components/DynamicForm/myRadio/index.js +2 -2
- package/lib/components/DynamicForm/mySelect/index.js +2 -1
- package/lib/components/DynamicForm/useDynamicForm.js +6 -6
- package/lib/components/DynamicFormMobile/func.d.ts +1 -18
- package/lib/components/DynamicFormMobile/func.js +0 -101
- package/lib/components/DynamicFormMobile/mySelect/index.js +2 -2
- package/lib/utils/method.d.ts +5 -0
- package/lib/utils/method.js +6 -2
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IformConfigItem
|
|
1
|
+
import { IformConfigItem } from './index.d';
|
|
2
2
|
import { RangePickerProps } from 'antd/es/date-picker';
|
|
3
|
-
import { AxiosResponse } from 'axios';
|
|
4
3
|
export declare const handleGetPlaceholder: (itemWithJson: IformConfigItem, langId?: string) => string;
|
|
5
4
|
/**
|
|
6
5
|
* 处理表单项目初始值
|
|
@@ -19,19 +18,3 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
|
|
|
19
18
|
export declare const handleGetSingleAttrListObj: (children: any[]) => {
|
|
20
19
|
[key: string]: any;
|
|
21
20
|
}[];
|
|
22
|
-
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
23
|
-
/**
|
|
24
|
-
* 根据属性项配置处理成下拉数据
|
|
25
|
-
* @param param0
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, langConfig, }: {
|
|
29
|
-
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
30
|
-
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
31
|
-
interfaceTypeDict?: string | undefined;
|
|
32
|
-
interfaceTypeSysDict?: string | undefined;
|
|
33
|
-
actionUrlKey?: string | undefined;
|
|
34
|
-
actionUrlExtraParams?: object | undefined;
|
|
35
|
-
item: Ijson;
|
|
36
|
-
langConfig?: any[] | undefined;
|
|
37
|
-
}) => Promise<any[]>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
|
-
import { message } from "antd";
|
|
3
2
|
const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
4
3
|
const { input = "" } = (itemWithJson == null ? void 0 : itemWithJson.json) || {};
|
|
5
4
|
let placeholderCn = "请输入", placeholderEn = "Please input";
|
|
@@ -113,110 +112,10 @@ const handleGetSingleAttrListObj = (children) => {
|
|
|
113
112
|
});
|
|
114
113
|
return dealList(children);
|
|
115
114
|
};
|
|
116
|
-
const getTitle = (langConfig, dataID) => {
|
|
117
|
-
const titleData = langConfig.find((x) => (x == null ? void 0 : x.dataid) === dataID);
|
|
118
|
-
return (titleData == null ? void 0 : titleData.content) ?? dataID;
|
|
119
|
-
};
|
|
120
|
-
const handleSelectOptions = async ({
|
|
121
|
-
commonRequestWidthParams,
|
|
122
|
-
commonRequest,
|
|
123
|
-
interfaceTypeDict = "YLZDDictList",
|
|
124
|
-
interfaceTypeSysDict = "YLZDSysConfigList",
|
|
125
|
-
actionUrlKey = "action-url",
|
|
126
|
-
actionUrlExtraParams = {},
|
|
127
|
-
item,
|
|
128
|
-
langConfig
|
|
129
|
-
}) => {
|
|
130
|
-
var _a;
|
|
131
|
-
let options = [];
|
|
132
|
-
const getDict = async (interfaceType) => {
|
|
133
|
-
var _a2;
|
|
134
|
-
let list = [];
|
|
135
|
-
if (item.classify) {
|
|
136
|
-
try {
|
|
137
|
-
const response = await commonRequest(interfaceType, {
|
|
138
|
-
asctypeid: item.classify
|
|
139
|
-
});
|
|
140
|
-
if (((_a2 = response == null ? void 0 : response.data) == null ? void 0 : _a2.list) && Array.isArray(response.data.list)) {
|
|
141
|
-
list = response.data.list.map((dictItem) => ({
|
|
142
|
-
label: `${dictItem.dicid || ""}-${dictItem.info || ""}`,
|
|
143
|
-
value: `${dictItem.dicid || ""}-${dictItem.info || ""}`
|
|
144
|
-
}));
|
|
145
|
-
}
|
|
146
|
-
} catch (error) {
|
|
147
|
-
message.error("加载选项失败");
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return list;
|
|
151
|
-
};
|
|
152
|
-
const getUrlOptions = async () => {
|
|
153
|
-
var _a2, _b;
|
|
154
|
-
try {
|
|
155
|
-
const keyFieldList = ((_a2 = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a2.list) || [];
|
|
156
|
-
const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
|
|
157
|
-
const fileNames = item == null ? void 0 : item["field-names"];
|
|
158
|
-
if (!keyFieldList.length) {
|
|
159
|
-
message.error("请配置key-field");
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const response = await commonRequestWidthParams(
|
|
163
|
-
{
|
|
164
|
-
PageName: "dns_relay",
|
|
165
|
-
Controlname: "CallActionUrl",
|
|
166
|
-
InterfaceType: ""
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
170
|
-
...actionUrlExtraParams
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
if (response == null ? void 0 : response.data) {
|
|
174
|
-
const data = response == null ? void 0 : response.data;
|
|
175
|
-
const list = (data == null ? void 0 : data.list) || [];
|
|
176
|
-
let urlData = [];
|
|
177
|
-
if (Array.isArray(data)) {
|
|
178
|
-
urlData = data;
|
|
179
|
-
}
|
|
180
|
-
if (Array.isArray(list)) {
|
|
181
|
-
urlData = list;
|
|
182
|
-
}
|
|
183
|
-
if (fileNames) {
|
|
184
|
-
options = urlData;
|
|
185
|
-
} else {
|
|
186
|
-
options = urlData.map((val) => ({
|
|
187
|
-
label: handleUrlOptions(val, delimiter, keyFieldList),
|
|
188
|
-
value: handleUrlOptions(val, delimiter, keyFieldList)
|
|
189
|
-
}));
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
} catch (error) {
|
|
193
|
-
message.error("加载选项失败");
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
if (item.inputType === "local") {
|
|
197
|
-
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
198
|
-
label: (langConfig == null ? void 0 : langConfig.length) ? getTitle(langConfig, val) : val,
|
|
199
|
-
value: val
|
|
200
|
-
}))) || [];
|
|
201
|
-
if (item.options && Array.isArray(item.options)) {
|
|
202
|
-
options = item.options;
|
|
203
|
-
}
|
|
204
|
-
} else if (item.inputType === "dictionary") {
|
|
205
|
-
options = await getDict(interfaceTypeDict);
|
|
206
|
-
} else if (item.inputType === "system-dictionary") {
|
|
207
|
-
options = await getDict(interfaceTypeSysDict);
|
|
208
|
-
}
|
|
209
|
-
if (item.inputType === "url" && (item == null ? void 0 : item["action-url"])) {
|
|
210
|
-
await getUrlOptions();
|
|
211
|
-
}
|
|
212
|
-
return options;
|
|
213
|
-
};
|
|
214
115
|
export {
|
|
215
116
|
disabledDate,
|
|
216
|
-
getTitle,
|
|
217
117
|
handleGetPlaceholder,
|
|
218
118
|
handleGetSingleAttrListObj,
|
|
219
|
-
handleSelectOptions,
|
|
220
119
|
handleSetFormItemInitialValue,
|
|
221
120
|
handleUrlOptions
|
|
222
121
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { handleSelectOptions } from "../../../utils/method";
|
|
2
3
|
import { useState, useEffect } from "react";
|
|
3
4
|
import { Checkbox } from "antd";
|
|
4
|
-
import { handleSelectOptions } from "../func";
|
|
5
5
|
const MyCheckbox = (props) => {
|
|
6
6
|
const {
|
|
7
7
|
item,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { handleSelectOptions } from "../../../utils/method";
|
|
2
3
|
import { Radio } from "antd";
|
|
3
4
|
import { useState, useEffect } from "react";
|
|
4
|
-
import { handleSelectOptions } from "../func";
|
|
5
5
|
const MyRadio = (props) => {
|
|
6
6
|
const {
|
|
7
7
|
item,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { handleSelectOptions
|
|
2
|
+
import { handleSelectOptions } from "../../../utils/method";
|
|
3
|
+
import { handleGetPlaceholder } from "../func";
|
|
3
4
|
import { useState, useEffect } from "react";
|
|
4
5
|
import { Select } from "antd";
|
|
5
6
|
const MySelect = ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
2
|
import { MinusSquareOutlined, PlusSquareOutlined, CloseOutlined, InfoCircleOutlined } from "@ant-design/icons";
|
|
3
|
-
import { handleSetFormItemInitialValue,
|
|
4
|
-
import { handleUrlOptions, getJson, base64ToString } from "../../utils/method";
|
|
3
|
+
import { handleSetFormItemInitialValue, handleGetPlaceholder, disabledDate } from "./func";
|
|
4
|
+
import { getTitle, handleUrlOptions, getJson, base64ToString } from "../../utils/method";
|
|
5
5
|
import SelectModelBackfillFormItem from "./selectModelBackfillFormItem";
|
|
6
6
|
import { useRef, useEffect, useCallback, Fragment } from "react";
|
|
7
7
|
import isoWeek from "dayjs/plugin/isoWeek";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IformConfigItem
|
|
1
|
+
import { IformConfigItem } from './index.d';
|
|
2
2
|
import { RangePickerProps } from 'antd/es/date-picker';
|
|
3
|
-
import { AxiosResponse } from 'axios';
|
|
4
3
|
export declare const handleGetPlaceholder: (itemWithJson: IformConfigItem, langId?: string) => string;
|
|
5
4
|
/**
|
|
6
5
|
* 处理表单项目初始值
|
|
@@ -19,19 +18,3 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
|
|
|
19
18
|
export declare const handleGetSingleAttrListObj: (children: any[]) => {
|
|
20
19
|
[key: string]: any;
|
|
21
20
|
}[];
|
|
22
|
-
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
23
|
-
/**
|
|
24
|
-
* 根据属性项配置处理成下拉数据
|
|
25
|
-
* @param param0
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, langConfig, }: {
|
|
29
|
-
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
30
|
-
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
31
|
-
interfaceTypeDict?: string | undefined;
|
|
32
|
-
interfaceTypeSysDict?: string | undefined;
|
|
33
|
-
actionUrlKey?: string | undefined;
|
|
34
|
-
actionUrlExtraParams?: object | undefined;
|
|
35
|
-
item: Ijson;
|
|
36
|
-
langConfig?: any[] | undefined;
|
|
37
|
-
}) => Promise<any[]>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import dayjs from "dayjs";
|
|
2
|
-
import { message } from "antd";
|
|
3
2
|
const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
4
3
|
const { input = "" } = (itemWithJson == null ? void 0 : itemWithJson.json) || {};
|
|
5
4
|
let placeholderCn = "请输入", placeholderEn = "Please input";
|
|
@@ -113,110 +112,10 @@ const handleGetSingleAttrListObj = (children) => {
|
|
|
113
112
|
});
|
|
114
113
|
return dealList(children);
|
|
115
114
|
};
|
|
116
|
-
const getTitle = (langConfig, dataID) => {
|
|
117
|
-
const titleData = langConfig.find((x) => (x == null ? void 0 : x.dataid) === dataID);
|
|
118
|
-
return (titleData == null ? void 0 : titleData.content) ?? dataID;
|
|
119
|
-
};
|
|
120
|
-
const handleSelectOptions = async ({
|
|
121
|
-
commonRequestWidthParams,
|
|
122
|
-
commonRequest,
|
|
123
|
-
interfaceTypeDict = "YLZDDictList",
|
|
124
|
-
interfaceTypeSysDict = "YLZDSysConfigList",
|
|
125
|
-
actionUrlKey = "action-url",
|
|
126
|
-
actionUrlExtraParams = {},
|
|
127
|
-
item,
|
|
128
|
-
langConfig
|
|
129
|
-
}) => {
|
|
130
|
-
var _a;
|
|
131
|
-
let options = [];
|
|
132
|
-
const getDict = async (interfaceType) => {
|
|
133
|
-
var _a2;
|
|
134
|
-
let list = [];
|
|
135
|
-
if (item.classify) {
|
|
136
|
-
try {
|
|
137
|
-
const response = await commonRequest(interfaceType, {
|
|
138
|
-
asctypeid: item.classify
|
|
139
|
-
});
|
|
140
|
-
if (((_a2 = response == null ? void 0 : response.data) == null ? void 0 : _a2.list) && Array.isArray(response.data.list)) {
|
|
141
|
-
list = response.data.list.map((dictItem) => ({
|
|
142
|
-
label: `${dictItem.dicid || ""}-${dictItem.info || ""}`,
|
|
143
|
-
value: `${dictItem.dicid || ""}-${dictItem.info || ""}`
|
|
144
|
-
}));
|
|
145
|
-
}
|
|
146
|
-
} catch (error) {
|
|
147
|
-
message.error("加载选项失败");
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return list;
|
|
151
|
-
};
|
|
152
|
-
const getUrlOptions = async () => {
|
|
153
|
-
var _a2, _b;
|
|
154
|
-
try {
|
|
155
|
-
const keyFieldList = ((_a2 = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a2.list) || [];
|
|
156
|
-
const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
|
|
157
|
-
const fileNames = item == null ? void 0 : item["field-names"];
|
|
158
|
-
if (!keyFieldList.length) {
|
|
159
|
-
message.error("请配置key-field");
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const response = await commonRequestWidthParams(
|
|
163
|
-
{
|
|
164
|
-
PageName: "dns_relay",
|
|
165
|
-
Controlname: "CallActionUrl",
|
|
166
|
-
InterfaceType: ""
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
170
|
-
...actionUrlExtraParams
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
if (response == null ? void 0 : response.data) {
|
|
174
|
-
const data = response == null ? void 0 : response.data;
|
|
175
|
-
const list = (data == null ? void 0 : data.list) || [];
|
|
176
|
-
let urlData = [];
|
|
177
|
-
if (Array.isArray(data)) {
|
|
178
|
-
urlData = data;
|
|
179
|
-
}
|
|
180
|
-
if (Array.isArray(list)) {
|
|
181
|
-
urlData = list;
|
|
182
|
-
}
|
|
183
|
-
if (fileNames) {
|
|
184
|
-
options = urlData;
|
|
185
|
-
} else {
|
|
186
|
-
options = urlData.map((val) => ({
|
|
187
|
-
label: handleUrlOptions(val, delimiter, keyFieldList),
|
|
188
|
-
value: handleUrlOptions(val, delimiter, keyFieldList)
|
|
189
|
-
}));
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
} catch (error) {
|
|
193
|
-
message.error("加载选项失败");
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
if (item.inputType === "local") {
|
|
197
|
-
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
198
|
-
label: (langConfig == null ? void 0 : langConfig.length) ? getTitle(langConfig, val) : val,
|
|
199
|
-
value: val
|
|
200
|
-
}))) || [];
|
|
201
|
-
if (item.options && Array.isArray(item.options)) {
|
|
202
|
-
options = item.options;
|
|
203
|
-
}
|
|
204
|
-
} else if (item.inputType === "dictionary") {
|
|
205
|
-
options = await getDict(interfaceTypeDict);
|
|
206
|
-
} else if (item.inputType === "system-dictionary") {
|
|
207
|
-
options = await getDict(interfaceTypeSysDict);
|
|
208
|
-
}
|
|
209
|
-
if (item.inputType === "url" && (item == null ? void 0 : item["action-url"])) {
|
|
210
|
-
await getUrlOptions();
|
|
211
|
-
}
|
|
212
|
-
return options;
|
|
213
|
-
};
|
|
214
115
|
export {
|
|
215
116
|
disabledDate,
|
|
216
|
-
getTitle,
|
|
217
117
|
handleGetPlaceholder,
|
|
218
118
|
handleGetSingleAttrListObj,
|
|
219
|
-
handleSelectOptions,
|
|
220
119
|
handleSetFormItemInitialValue,
|
|
221
120
|
handleUrlOptions
|
|
222
121
|
};
|
|
@@ -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 "../../../utils/method";
|
|
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,
|
|
@@ -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,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IformConfigItem
|
|
1
|
+
import { IformConfigItem } from './index.d';
|
|
2
2
|
import { RangePickerProps } from 'antd/es/date-picker';
|
|
3
|
-
import { AxiosResponse } from 'axios';
|
|
4
3
|
export declare const handleGetPlaceholder: (itemWithJson: IformConfigItem, langId?: string) => string;
|
|
5
4
|
/**
|
|
6
5
|
* 处理表单项目初始值
|
|
@@ -19,19 +18,3 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
|
|
|
19
18
|
export declare const handleGetSingleAttrListObj: (children: any[]) => {
|
|
20
19
|
[key: string]: any;
|
|
21
20
|
}[];
|
|
22
|
-
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
23
|
-
/**
|
|
24
|
-
* 根据属性项配置处理成下拉数据
|
|
25
|
-
* @param param0
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, langConfig, }: {
|
|
29
|
-
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
30
|
-
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
31
|
-
interfaceTypeDict?: string | undefined;
|
|
32
|
-
interfaceTypeSysDict?: string | undefined;
|
|
33
|
-
actionUrlKey?: string | undefined;
|
|
34
|
-
actionUrlExtraParams?: object | undefined;
|
|
35
|
-
item: Ijson;
|
|
36
|
-
langConfig?: any[] | undefined;
|
|
37
|
-
}) => Promise<any[]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const dayjs = require("dayjs");
|
|
4
|
-
const antd = require("antd");
|
|
5
4
|
const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
6
5
|
const { input = "" } = (itemWithJson == null ? void 0 : itemWithJson.json) || {};
|
|
7
6
|
let placeholderCn = "请输入", placeholderEn = "Please input";
|
|
@@ -115,108 +114,8 @@ const handleGetSingleAttrListObj = (children) => {
|
|
|
115
114
|
});
|
|
116
115
|
return dealList(children);
|
|
117
116
|
};
|
|
118
|
-
const getTitle = (langConfig, dataID) => {
|
|
119
|
-
const titleData = langConfig.find((x) => (x == null ? void 0 : x.dataid) === dataID);
|
|
120
|
-
return (titleData == null ? void 0 : titleData.content) ?? dataID;
|
|
121
|
-
};
|
|
122
|
-
const handleSelectOptions = async ({
|
|
123
|
-
commonRequestWidthParams,
|
|
124
|
-
commonRequest,
|
|
125
|
-
interfaceTypeDict = "YLZDDictList",
|
|
126
|
-
interfaceTypeSysDict = "YLZDSysConfigList",
|
|
127
|
-
actionUrlKey = "action-url",
|
|
128
|
-
actionUrlExtraParams = {},
|
|
129
|
-
item,
|
|
130
|
-
langConfig
|
|
131
|
-
}) => {
|
|
132
|
-
var _a;
|
|
133
|
-
let options = [];
|
|
134
|
-
const getDict = async (interfaceType) => {
|
|
135
|
-
var _a2;
|
|
136
|
-
let list = [];
|
|
137
|
-
if (item.classify) {
|
|
138
|
-
try {
|
|
139
|
-
const response = await commonRequest(interfaceType, {
|
|
140
|
-
asctypeid: item.classify
|
|
141
|
-
});
|
|
142
|
-
if (((_a2 = response == null ? void 0 : response.data) == null ? void 0 : _a2.list) && Array.isArray(response.data.list)) {
|
|
143
|
-
list = response.data.list.map((dictItem) => ({
|
|
144
|
-
label: `${dictItem.dicid || ""}-${dictItem.info || ""}`,
|
|
145
|
-
value: `${dictItem.dicid || ""}-${dictItem.info || ""}`
|
|
146
|
-
}));
|
|
147
|
-
}
|
|
148
|
-
} catch (error) {
|
|
149
|
-
antd.message.error("加载选项失败");
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return list;
|
|
153
|
-
};
|
|
154
|
-
const getUrlOptions = async () => {
|
|
155
|
-
var _a2, _b;
|
|
156
|
-
try {
|
|
157
|
-
const keyFieldList = ((_a2 = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a2.list) || [];
|
|
158
|
-
const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
|
|
159
|
-
const fileNames = item == null ? void 0 : item["field-names"];
|
|
160
|
-
if (!keyFieldList.length) {
|
|
161
|
-
antd.message.error("请配置key-field");
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
const response = await commonRequestWidthParams(
|
|
165
|
-
{
|
|
166
|
-
PageName: "dns_relay",
|
|
167
|
-
Controlname: "CallActionUrl",
|
|
168
|
-
InterfaceType: ""
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
172
|
-
...actionUrlExtraParams
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
if (response == null ? void 0 : response.data) {
|
|
176
|
-
const data = response == null ? void 0 : response.data;
|
|
177
|
-
const list = (data == null ? void 0 : data.list) || [];
|
|
178
|
-
let urlData = [];
|
|
179
|
-
if (Array.isArray(data)) {
|
|
180
|
-
urlData = data;
|
|
181
|
-
}
|
|
182
|
-
if (Array.isArray(list)) {
|
|
183
|
-
urlData = list;
|
|
184
|
-
}
|
|
185
|
-
if (fileNames) {
|
|
186
|
-
options = urlData;
|
|
187
|
-
} else {
|
|
188
|
-
options = urlData.map((val) => ({
|
|
189
|
-
label: handleUrlOptions(val, delimiter, keyFieldList),
|
|
190
|
-
value: handleUrlOptions(val, delimiter, keyFieldList)
|
|
191
|
-
}));
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
} catch (error) {
|
|
195
|
-
antd.message.error("加载选项失败");
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
if (item.inputType === "local") {
|
|
199
|
-
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
200
|
-
label: (langConfig == null ? void 0 : langConfig.length) ? getTitle(langConfig, val) : val,
|
|
201
|
-
value: val
|
|
202
|
-
}))) || [];
|
|
203
|
-
if (item.options && Array.isArray(item.options)) {
|
|
204
|
-
options = item.options;
|
|
205
|
-
}
|
|
206
|
-
} else if (item.inputType === "dictionary") {
|
|
207
|
-
options = await getDict(interfaceTypeDict);
|
|
208
|
-
} else if (item.inputType === "system-dictionary") {
|
|
209
|
-
options = await getDict(interfaceTypeSysDict);
|
|
210
|
-
}
|
|
211
|
-
if (item.inputType === "url" && (item == null ? void 0 : item["action-url"])) {
|
|
212
|
-
await getUrlOptions();
|
|
213
|
-
}
|
|
214
|
-
return options;
|
|
215
|
-
};
|
|
216
117
|
exports.disabledDate = disabledDate;
|
|
217
|
-
exports.getTitle = getTitle;
|
|
218
118
|
exports.handleGetPlaceholder = handleGetPlaceholder;
|
|
219
119
|
exports.handleGetSingleAttrListObj = handleGetSingleAttrListObj;
|
|
220
|
-
exports.handleSelectOptions = handleSelectOptions;
|
|
221
120
|
exports.handleSetFormItemInitialValue = handleSetFormItemInitialValue;
|
|
222
121
|
exports.handleUrlOptions = handleUrlOptions;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const method = require("../../../utils/method");
|
|
3
4
|
const react = require("react");
|
|
4
5
|
const antd = require("antd");
|
|
5
|
-
const func = require("../func");
|
|
6
6
|
const MyCheckbox = (props) => {
|
|
7
7
|
const {
|
|
8
8
|
item,
|
|
@@ -26,7 +26,7 @@ const MyCheckbox = (props) => {
|
|
|
26
26
|
handleLoadOptions();
|
|
27
27
|
}, [item.inputType, item.classify, item.data, item.options]);
|
|
28
28
|
const handleLoadOptions = async () => {
|
|
29
|
-
const list2 = await
|
|
29
|
+
const list2 = await method.handleSelectOptions({
|
|
30
30
|
commonRequestWidthParams,
|
|
31
31
|
commonRequest,
|
|
32
32
|
interfaceTypeDict,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const method = require("../../../utils/method");
|
|
3
4
|
const antd = require("antd");
|
|
4
5
|
const react = require("react");
|
|
5
|
-
const func = require("../func");
|
|
6
6
|
const MyRadio = (props) => {
|
|
7
7
|
const {
|
|
8
8
|
item,
|
|
@@ -24,7 +24,7 @@ const MyRadio = (props) => {
|
|
|
24
24
|
handleLoadOptions();
|
|
25
25
|
}, [item.inputType, item.classify, item.data, item.options]);
|
|
26
26
|
const handleLoadOptions = async () => {
|
|
27
|
-
const list2 = await
|
|
27
|
+
const list2 = await method.handleSelectOptions({
|
|
28
28
|
commonRequestWidthParams,
|
|
29
29
|
commonRequest,
|
|
30
30
|
interfaceTypeDict,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const method = require("../../../utils/method");
|
|
3
4
|
const func = require("../func");
|
|
4
5
|
const react = require("react");
|
|
5
6
|
const antd = require("antd");
|
|
@@ -25,7 +26,7 @@ const MySelect = ({
|
|
|
25
26
|
}, [item.inputType, item.classify, item.data, item.options]);
|
|
26
27
|
const handleLoadOptions = async () => {
|
|
27
28
|
setLoading(true);
|
|
28
|
-
const list = await
|
|
29
|
+
const list = await method.handleSelectOptions({
|
|
29
30
|
commonRequestWidthParams,
|
|
30
31
|
commonRequest,
|
|
31
32
|
interfaceTypeDict,
|
|
@@ -140,7 +140,7 @@ function useDynamicForm(props) {
|
|
|
140
140
|
var _a, _b, _c, _d, _e;
|
|
141
141
|
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 10, vertical: instructionShowMode === "flex", align: "center", children: [
|
|
142
142
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: itemWithJson.attrname }),
|
|
143
|
-
((_a = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _a.instruction) && instructionShowMode === "icon" && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
143
|
+
((_a = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _a.instruction) && instructionShowMode === "icon" && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: method.getTitle(langConfig, (_b = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _b.instruction), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
144
144
|
icons.InfoCircleOutlined,
|
|
145
145
|
{
|
|
146
146
|
style: {
|
|
@@ -149,7 +149,7 @@ function useDynamicForm(props) {
|
|
|
149
149
|
cursor: "pointer"
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
) }) || /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: ((_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["instruction-color"]) ?? "red" }, children:
|
|
152
|
+
) }) || /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: ((_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["instruction-color"]) ?? "red" }, children: method.getTitle(langConfig, (_e = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _e.instruction) })
|
|
153
153
|
] });
|
|
154
154
|
};
|
|
155
155
|
const renderNestedFormList = react.useCallback(
|
|
@@ -296,7 +296,7 @@ function useDynamicForm(props) {
|
|
|
296
296
|
}
|
|
297
297
|
if (itemWithJson.attrtype === 0) {
|
|
298
298
|
const initialValue = func.handleSetFormItemInitialValue(itemWithJson);
|
|
299
|
-
const message2 =
|
|
299
|
+
const message2 = method.getTitle(langConfig, (_b = itemWithJson.json) == null ? void 0 : _b["default-prompt"]);
|
|
300
300
|
const placeholder = func.handleGetPlaceholder(itemWithJson, langId);
|
|
301
301
|
const { combinations = [] } = itemWithJson.json || {};
|
|
302
302
|
if (combinations == null ? void 0 : combinations.length) {
|
|
@@ -338,7 +338,7 @@ function useDynamicForm(props) {
|
|
|
338
338
|
...((_c2 = itemWithJson.json) == null ? void 0 : _c2.regexp) ? [
|
|
339
339
|
{
|
|
340
340
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
341
|
-
message:
|
|
341
|
+
message: method.getTitle(langConfig, (_d2 = itemWithJson.json) == null ? void 0 : _d2["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
342
342
|
}
|
|
343
343
|
] : []
|
|
344
344
|
],
|
|
@@ -378,7 +378,7 @@ function useDynamicForm(props) {
|
|
|
378
378
|
...((_f = itemWithJson.json) == null ? void 0 : _f.regexp) ? [
|
|
379
379
|
{
|
|
380
380
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
381
|
-
message:
|
|
381
|
+
message: method.getTitle(langConfig, (_g = itemWithJson.json) == null ? void 0 : _g["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
382
382
|
}
|
|
383
383
|
] : []
|
|
384
384
|
],
|
|
@@ -438,7 +438,7 @@ function useDynamicForm(props) {
|
|
|
438
438
|
const format = ((_a = item.json) == null ? void 0 : _a.format) || "";
|
|
439
439
|
const attrid = item.attrid;
|
|
440
440
|
const formatValue = func.handleSetFormItemInitialValue(item);
|
|
441
|
-
const message2 =
|
|
441
|
+
const message2 = method.getTitle(langConfig, (_b = item.json) == null ? void 0 : _b["default-prompt"]) || "";
|
|
442
442
|
const disableDateGoover = ((_c = item.json) == null ? void 0 : _c["disable-date-goover"]) || false;
|
|
443
443
|
const placeholder = func.handleGetPlaceholder(item, langId);
|
|
444
444
|
const params = item.json.length && {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IformConfigItem
|
|
1
|
+
import { IformConfigItem } from './index.d';
|
|
2
2
|
import { RangePickerProps } from 'antd/es/date-picker';
|
|
3
|
-
import { AxiosResponse } from 'axios';
|
|
4
3
|
export declare const handleGetPlaceholder: (itemWithJson: IformConfigItem, langId?: string) => string;
|
|
5
4
|
/**
|
|
6
5
|
* 处理表单项目初始值
|
|
@@ -19,19 +18,3 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
|
|
|
19
18
|
export declare const handleGetSingleAttrListObj: (children: any[]) => {
|
|
20
19
|
[key: string]: any;
|
|
21
20
|
}[];
|
|
22
|
-
export declare const getTitle: (langConfig: any[], dataID?: string) => any;
|
|
23
|
-
/**
|
|
24
|
-
* 根据属性项配置处理成下拉数据
|
|
25
|
-
* @param param0
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, langConfig, }: {
|
|
29
|
-
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
30
|
-
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
31
|
-
interfaceTypeDict?: string | undefined;
|
|
32
|
-
interfaceTypeSysDict?: string | undefined;
|
|
33
|
-
actionUrlKey?: string | undefined;
|
|
34
|
-
actionUrlExtraParams?: object | undefined;
|
|
35
|
-
item: Ijson;
|
|
36
|
-
langConfig?: any[] | undefined;
|
|
37
|
-
}) => Promise<any[]>;
|