szld-libs 0.3.23 → 0.3.26

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.
Files changed (31) hide show
  1. package/dist/szld-components.es.js +14042 -14328
  2. package/dist/szld-components.umd.js +54 -54
  3. package/es/components/DynamicForm/func.d.ts +1 -11
  4. package/es/components/DynamicForm/func.js +0 -90
  5. package/es/components/DynamicForm/index.d.ts +1 -0
  6. package/es/components/DynamicForm/mySelect/index.js +2 -1
  7. package/es/components/DynamicForm/useDynamicForm.js +7 -5
  8. package/es/components/DynamicFormMobile/func.d.ts +1 -11
  9. package/es/components/DynamicFormMobile/func.js +0 -90
  10. package/es/components/DynamicFormMobile/index.d.ts +1 -0
  11. package/es/components/DynamicFormMobile/mySelect/index.js +1 -1
  12. package/es/hooks/useDetailRender.js +1 -1
  13. package/es/hooks/useUniversalTable.d.ts +1 -1
  14. package/es/index.css +1 -1
  15. package/es/mock/index.js +3 -2
  16. package/es/utils/method.js +9 -4
  17. package/lib/components/DynamicForm/func.d.ts +1 -11
  18. package/lib/components/DynamicForm/func.js +0 -90
  19. package/lib/components/DynamicForm/index.d.ts +1 -0
  20. package/lib/components/DynamicForm/mySelect/index.js +2 -1
  21. package/lib/components/DynamicForm/useDynamicForm.js +7 -5
  22. package/lib/components/DynamicFormMobile/func.d.ts +1 -11
  23. package/lib/components/DynamicFormMobile/func.js +0 -90
  24. package/lib/components/DynamicFormMobile/index.d.ts +1 -0
  25. package/lib/components/DynamicFormMobile/mySelect/index.js +2 -2
  26. package/lib/hooks/useDetailRender.js +1 -1
  27. package/lib/hooks/useUniversalTable.d.ts +1 -1
  28. package/lib/index.css +1 -1
  29. package/lib/mock/index.js +3 -2
  30. package/lib/utils/method.js +9 -4
  31. package/package.json +2 -2
@@ -1,6 +1,5 @@
1
- import { IformConfigItem, Ijson } from './index.d';
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
  * 处理表单项目初始值
@@ -18,15 +17,6 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
18
17
  * @param param0
19
18
  * @returns
20
19
  */
21
- export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, }: {
22
- commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
23
- commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
24
- interfaceTypeDict?: string | undefined;
25
- interfaceTypeSysDict?: string | undefined;
26
- actionUrlKey?: string | undefined;
27
- actionUrlExtraParams?: object | undefined;
28
- item: Ijson;
29
- }) => Promise<any[]>;
30
20
  /**
31
21
  * attrList 格式的单层数组 处理成对象{attrid:attrname}
32
22
  */
@@ -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";
@@ -93,94 +92,6 @@ const handleUrlOptions = (val, delimiter, list) => {
93
92
  });
94
93
  return arr.join(delimiter || "-");
95
94
  };
96
- const handleSelectOptions = async ({
97
- commonRequestWidthParams,
98
- commonRequest,
99
- interfaceTypeDict = "YLZDDictList",
100
- interfaceTypeSysDict = "YLZDSysConfigList",
101
- actionUrlKey = "action-url",
102
- actionUrlExtraParams = {},
103
- item
104
- }) => {
105
- var _a;
106
- let options = [];
107
- const getDict = async (interfaceType) => {
108
- var _a2;
109
- let list = [];
110
- if (item.classify) {
111
- try {
112
- const response = await commonRequest(interfaceType, {
113
- asctypeid: item.classify
114
- });
115
- if (((_a2 = response == null ? void 0 : response.data) == null ? void 0 : _a2.list) && Array.isArray(response.data.list)) {
116
- list = response.data.list.map((dictItem) => ({
117
- label: `${dictItem.dicid || ""}-${dictItem.info || ""}`,
118
- value: `${dictItem.dicid || ""}-${dictItem.info || ""}`
119
- }));
120
- }
121
- } catch (error) {
122
- message.error("加载选项失败");
123
- }
124
- }
125
- return list;
126
- };
127
- const getUrlOptions = async () => {
128
- var _a2, _b;
129
- try {
130
- const keyFieldList = ((_a2 = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a2.list) || [];
131
- const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
132
- if (!keyFieldList.length) {
133
- message.error("请配置key-field");
134
- return;
135
- }
136
- const response = await commonRequestWidthParams(
137
- {
138
- PageName: "dns_relay",
139
- Controlname: "CallActionUrl",
140
- InterfaceType: ""
141
- },
142
- {
143
- [actionUrlKey]: item == null ? void 0 : item["action-url"],
144
- ...actionUrlExtraParams
145
- }
146
- );
147
- if (response == null ? void 0 : response.data) {
148
- const data = response == null ? void 0 : response.data;
149
- const list = (data == null ? void 0 : data.list) || [];
150
- let urlData = [];
151
- if (Array.isArray(data)) {
152
- urlData = data;
153
- }
154
- if (Array.isArray(list)) {
155
- urlData = list;
156
- }
157
- options = urlData.map((val) => ({
158
- label: handleUrlOptions(val, delimiter, keyFieldList),
159
- value: handleUrlOptions(val, delimiter, keyFieldList)
160
- }));
161
- }
162
- } catch (error) {
163
- message.error("加载选项失败");
164
- }
165
- };
166
- if (item.inputType === "local") {
167
- options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
168
- label: val,
169
- value: val
170
- }))) || [];
171
- if (item.options && Array.isArray(item.options)) {
172
- options = item.options;
173
- }
174
- } else if (item.inputType === "dictionary") {
175
- options = await getDict(interfaceTypeDict);
176
- } else if (item.inputType === "system-dictionary") {
177
- options = await getDict(interfaceTypeSysDict);
178
- }
179
- if (item.inputType === "url" && (item == null ? void 0 : item["action-url"])) {
180
- await getUrlOptions();
181
- }
182
- return options;
183
- };
184
95
  const handleGetSingleAttrListObj = (children) => {
185
96
  if (!(children == null ? void 0 : children.length)) {
186
97
  return [];
@@ -205,7 +116,6 @@ export {
205
116
  disabledDate,
206
117
  handleGetPlaceholder,
207
118
  handleGetSingleAttrListObj,
208
- handleSelectOptions,
209
119
  handleSetFormItemInitialValue,
210
120
  handleUrlOptions
211
121
  };
@@ -18,6 +18,7 @@ export interface IformConfigItem {
18
18
  }
19
19
 
20
20
  export interface Ijson {
21
+ 'field-names'?: string; // 级联选择的自定义字段名
21
22
  'input-width'?: string; // 输入框宽度
22
23
  'action-url-extra-params'?: { [key: string]: any }; // 弹窗选择对应多个表单字段时,额外的参数
23
24
  'disable-date-goover'?: boolean; // 禁用日期选择器超出当前日期
@@ -1,5 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { handleSelectOptions, handleGetPlaceholder } from "../func";
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 = ({
@@ -429,18 +429,19 @@ function useDynamicForm(props) {
429
429
  defaultWidth = 358,
430
430
  customWidth = {}
431
431
  }) => {
432
- var _a, _b, _c, _d, _e;
432
+ var _a, _b, _c, _d, _e, _f;
433
433
  const mode = item.json.input || "text";
434
+ const format = ((_a = item.json) == null ? void 0 : _a.format) || "";
434
435
  const attrid = item.attrid;
435
436
  const formatValue = handleSetFormItemInitialValue(item);
436
- const message2 = ((_a = item.json) == null ? void 0 : _a["default-prompt"]) || "";
437
- const disableDateGoover = ((_b = item.json) == null ? void 0 : _b["disable-date-goover"]) || false;
437
+ const message2 = ((_b = item.json) == null ? void 0 : _b["default-prompt"]) || "";
438
+ const disableDateGoover = ((_c = item.json) == null ? void 0 : _c["disable-date-goover"]) || false;
438
439
  const placeholder = handleGetPlaceholder(item, langId);
439
440
  const params = item.json.length && {
440
441
  maxLength: item.json.length
441
442
  } || {};
442
443
  const itemStyle = formItemStyle.find((v) => v.type === mode);
443
- let inputWidth = (_c = item.json) == null ? void 0 : _c["input-width"];
444
+ let inputWidth = (_d = item.json) == null ? void 0 : _d["input-width"];
444
445
  if (inputWidth) {
445
446
  inputWidth = formShowType === "table" ? Number(inputWidth) - 32 : inputWidth;
446
447
  }
@@ -451,7 +452,7 @@ function useDynamicForm(props) {
451
452
  Input,
452
453
  {
453
454
  disabled: true,
454
- value: ((_d = item.json) == null ? void 0 : _d["label-value"]) || item.attrvalue || ((_e = item.json) == null ? void 0 : _e.default) || "-",
455
+ value: ((_e = item.json) == null ? void 0 : _e["label-value"]) || item.attrvalue || ((_f = item.json) == null ? void 0 : _f.default) || "-",
455
456
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
456
457
  }
457
458
  );
@@ -585,6 +586,7 @@ function useDynamicForm(props) {
585
586
  DatePicker,
586
587
  {
587
588
  showTime: mode === "time-picker",
589
+ format: format ? format : void 0,
588
590
  picker: pickerObj[mode] || "date",
589
591
  disabled: readonly,
590
592
  disabledDate: disabledDateFunc,
@@ -1,6 +1,5 @@
1
- import { IformConfigItem, Ijson } from './index.d';
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
  * 处理表单项目初始值
@@ -18,15 +17,6 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
18
17
  * @param param0
19
18
  * @returns
20
19
  */
21
- export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, }: {
22
- commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
23
- commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
24
- interfaceTypeDict?: string | undefined;
25
- interfaceTypeSysDict?: string | undefined;
26
- actionUrlKey?: string | undefined;
27
- actionUrlExtraParams?: object | undefined;
28
- item: Ijson;
29
- }) => Promise<any[]>;
30
20
  /**
31
21
  * attrList 格式的单层数组 处理成对象{attrid:attrname}
32
22
  */
@@ -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";
@@ -93,94 +92,6 @@ const handleUrlOptions = (val, delimiter, list) => {
93
92
  });
94
93
  return arr.join(delimiter || "-");
95
94
  };
96
- const handleSelectOptions = async ({
97
- commonRequestWidthParams,
98
- commonRequest,
99
- interfaceTypeDict = "YLZDDictList",
100
- interfaceTypeSysDict = "YLZDSysConfigList",
101
- actionUrlKey = "action-url",
102
- actionUrlExtraParams = {},
103
- item
104
- }) => {
105
- var _a;
106
- let options = [];
107
- const getDict = async (interfaceType) => {
108
- var _a2;
109
- let list = [];
110
- if (item.classify) {
111
- try {
112
- const response = await commonRequest(interfaceType, {
113
- asctypeid: item.classify
114
- });
115
- if (((_a2 = response == null ? void 0 : response.data) == null ? void 0 : _a2.list) && Array.isArray(response.data.list)) {
116
- list = response.data.list.map((dictItem) => ({
117
- label: `${dictItem.dicid || ""}-${dictItem.info || ""}`,
118
- value: `${dictItem.dicid || ""}-${dictItem.info || ""}`
119
- }));
120
- }
121
- } catch (error) {
122
- message.error("加载选项失败");
123
- }
124
- }
125
- return list;
126
- };
127
- const getUrlOptions = async () => {
128
- var _a2, _b;
129
- try {
130
- const keyFieldList = ((_a2 = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a2.list) || [];
131
- const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
132
- if (!keyFieldList.length) {
133
- message.error("请配置key-field");
134
- return;
135
- }
136
- const response = await commonRequestWidthParams(
137
- {
138
- PageName: "dns_relay",
139
- Controlname: "CallActionUrl",
140
- InterfaceType: ""
141
- },
142
- {
143
- [actionUrlKey]: item == null ? void 0 : item["action-url"],
144
- ...actionUrlExtraParams
145
- }
146
- );
147
- if (response == null ? void 0 : response.data) {
148
- const data = response == null ? void 0 : response.data;
149
- const list = (data == null ? void 0 : data.list) || [];
150
- let urlData = [];
151
- if (Array.isArray(data)) {
152
- urlData = data;
153
- }
154
- if (Array.isArray(list)) {
155
- urlData = list;
156
- }
157
- options = urlData.map((val) => ({
158
- label: handleUrlOptions(val, delimiter, keyFieldList),
159
- value: handleUrlOptions(val, delimiter, keyFieldList)
160
- }));
161
- }
162
- } catch (error) {
163
- message.error("加载选项失败");
164
- }
165
- };
166
- if (item.inputType === "local") {
167
- options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
168
- label: val,
169
- value: val
170
- }))) || [];
171
- if (item.options && Array.isArray(item.options)) {
172
- options = item.options;
173
- }
174
- } else if (item.inputType === "dictionary") {
175
- options = await getDict(interfaceTypeDict);
176
- } else if (item.inputType === "system-dictionary") {
177
- options = await getDict(interfaceTypeSysDict);
178
- }
179
- if (item.inputType === "url" && (item == null ? void 0 : item["action-url"])) {
180
- await getUrlOptions();
181
- }
182
- return options;
183
- };
184
95
  const handleGetSingleAttrListObj = (children) => {
185
96
  if (!(children == null ? void 0 : children.length)) {
186
97
  return [];
@@ -205,7 +116,6 @@ export {
205
116
  disabledDate,
206
117
  handleGetPlaceholder,
207
118
  handleGetSingleAttrListObj,
208
- handleSelectOptions,
209
119
  handleSetFormItemInitialValue,
210
120
  handleUrlOptions
211
121
  };
@@ -18,6 +18,7 @@ export interface IformConfigItem {
18
18
  }
19
19
 
20
20
  export interface Ijson {
21
+ 'field-names'?: string; // 级联选择的自定义字段名
21
22
  'search-field'?: any; // 是否搜索字段
22
23
  'action-url-extra-params'?: { [key: string]: any }; // 弹窗选择对应多个表单字段时,额外的参数
23
24
  'disable-date-goover'?: boolean; // 禁用日期选择器超出当前日期
@@ -1,6 +1,6 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { Field, Popup, Checkbox, Picker } from "react-vant";
3
- import { handleSelectOptions } from "../func";
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";
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
- import { getJson, base64ToString } from "szld-libs/lib/utils/method";
3
2
  import { App, Row, Col, Flex, Table, Space, Image } from "antd";
4
3
  import { handleSetTableRowColor } from "../utils/szxkFunc";
4
+ import { getJson, base64ToString } from "../utils/method";
5
5
  import { useMemoizedFn } from "ahooks";
6
6
  import { Fragment } from "react";
7
7
  function useDetailRender({
@@ -23,7 +23,7 @@ declare function useUniversalTable(): {
23
23
  searchText?: string | undefined;
24
24
  resetText?: string | undefined;
25
25
  }) => Promise<{
26
- formItems: import("szld-libs/lib/components/CreateForm").CreateFormItemProps<import("szld-libs/lib/components/CreateForm").ValueType>[];
26
+ formItems: CreateFormProps;
27
27
  selList: any[];
28
28
  }>;
29
29
  handleUniversalDelete: ({ commonRequest, refresh, interfaceType, record, configData, }: {
package/es/index.css CHANGED
@@ -4,7 +4,7 @@
4
4
  }
5
5
  .custom-form-body .custom-form-list {
6
6
  position: relative;
7
- width: 1188px;
7
+ width: 1300px;
8
8
  overflow-x: auto;
9
9
  background-color: #004d32;
10
10
  }
package/es/mock/index.js CHANGED
@@ -53,7 +53,7 @@ const attrList = [
53
53
  attrid: "7BB9BE8A96824CCF89B721C8F1AF9F38",
54
54
  attrname: "Feeding Time",
55
55
  attrtype: 0,
56
- info: '{"input":"second-picker","dataType":"string","length":200,"input-width":240}',
56
+ info: '{\r\n "input": "second-picker",\r\n "dataType": "string",\r\n "length": 200,\r\n "input-width": 240,\r\n "format": "HH:mm"\r\n}',
57
57
  info_base64: 0,
58
58
  createtime: "2026-02-11 15:12:26",
59
59
  attrvalue: "",
@@ -63,7 +63,8 @@ const attrList = [
63
63
  input: "second-picker",
64
64
  dataType: "string",
65
65
  length: 200,
66
- "input-width": 240
66
+ "input-width": 240,
67
+ format: "HH:mm"
67
68
  }
68
69
  },
69
70
  {
@@ -477,6 +477,7 @@ const handleSelectOptions = async ({
477
477
  try {
478
478
  const keyFieldList = ((_a2 = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a2.list) || [];
479
479
  const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
480
+ const fileNames = item == null ? void 0 : item["field-names"];
480
481
  if (!keyFieldList.length) {
481
482
  message.error("请配置key-field");
482
483
  return;
@@ -502,10 +503,14 @@ const handleSelectOptions = async ({
502
503
  if (Array.isArray(list)) {
503
504
  urlData = list;
504
505
  }
505
- options = urlData.map((val) => ({
506
- label: handleUrlOptions(val, delimiter, keyFieldList),
507
- value: handleUrlOptions(val, delimiter, keyFieldList)
508
- }));
506
+ if (fileNames) {
507
+ options = urlData;
508
+ } else {
509
+ options = urlData.map((val) => ({
510
+ label: handleUrlOptions(val, delimiter, keyFieldList),
511
+ value: handleUrlOptions(val, delimiter, keyFieldList)
512
+ }));
513
+ }
509
514
  }
510
515
  } catch (error) {
511
516
  message.error("加载选项失败");
@@ -1,6 +1,5 @@
1
- import { IformConfigItem, Ijson } from './index.d';
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
  * 处理表单项目初始值
@@ -18,15 +17,6 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
18
17
  * @param param0
19
18
  * @returns
20
19
  */
21
- export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, }: {
22
- commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
23
- commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
24
- interfaceTypeDict?: string | undefined;
25
- interfaceTypeSysDict?: string | undefined;
26
- actionUrlKey?: string | undefined;
27
- actionUrlExtraParams?: object | undefined;
28
- item: Ijson;
29
- }) => Promise<any[]>;
30
20
  /**
31
21
  * attrList 格式的单层数组 处理成对象{attrid:attrname}
32
22
  */
@@ -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";
@@ -95,94 +94,6 @@ const handleUrlOptions = (val, delimiter, list) => {
95
94
  });
96
95
  return arr.join(delimiter || "-");
97
96
  };
98
- const handleSelectOptions = async ({
99
- commonRequestWidthParams,
100
- commonRequest,
101
- interfaceTypeDict = "YLZDDictList",
102
- interfaceTypeSysDict = "YLZDSysConfigList",
103
- actionUrlKey = "action-url",
104
- actionUrlExtraParams = {},
105
- item
106
- }) => {
107
- var _a;
108
- let options = [];
109
- const getDict = async (interfaceType) => {
110
- var _a2;
111
- let list = [];
112
- if (item.classify) {
113
- try {
114
- const response = await commonRequest(interfaceType, {
115
- asctypeid: item.classify
116
- });
117
- if (((_a2 = response == null ? void 0 : response.data) == null ? void 0 : _a2.list) && Array.isArray(response.data.list)) {
118
- list = response.data.list.map((dictItem) => ({
119
- label: `${dictItem.dicid || ""}-${dictItem.info || ""}`,
120
- value: `${dictItem.dicid || ""}-${dictItem.info || ""}`
121
- }));
122
- }
123
- } catch (error) {
124
- antd.message.error("加载选项失败");
125
- }
126
- }
127
- return list;
128
- };
129
- const getUrlOptions = async () => {
130
- var _a2, _b;
131
- try {
132
- const keyFieldList = ((_a2 = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a2.list) || [];
133
- const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
134
- if (!keyFieldList.length) {
135
- antd.message.error("请配置key-field");
136
- return;
137
- }
138
- const response = await commonRequestWidthParams(
139
- {
140
- PageName: "dns_relay",
141
- Controlname: "CallActionUrl",
142
- InterfaceType: ""
143
- },
144
- {
145
- [actionUrlKey]: item == null ? void 0 : item["action-url"],
146
- ...actionUrlExtraParams
147
- }
148
- );
149
- if (response == null ? void 0 : response.data) {
150
- const data = response == null ? void 0 : response.data;
151
- const list = (data == null ? void 0 : data.list) || [];
152
- let urlData = [];
153
- if (Array.isArray(data)) {
154
- urlData = data;
155
- }
156
- if (Array.isArray(list)) {
157
- urlData = list;
158
- }
159
- options = urlData.map((val) => ({
160
- label: handleUrlOptions(val, delimiter, keyFieldList),
161
- value: handleUrlOptions(val, delimiter, keyFieldList)
162
- }));
163
- }
164
- } catch (error) {
165
- antd.message.error("加载选项失败");
166
- }
167
- };
168
- if (item.inputType === "local") {
169
- options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
170
- label: val,
171
- value: val
172
- }))) || [];
173
- if (item.options && Array.isArray(item.options)) {
174
- options = item.options;
175
- }
176
- } else if (item.inputType === "dictionary") {
177
- options = await getDict(interfaceTypeDict);
178
- } else if (item.inputType === "system-dictionary") {
179
- options = await getDict(interfaceTypeSysDict);
180
- }
181
- if (item.inputType === "url" && (item == null ? void 0 : item["action-url"])) {
182
- await getUrlOptions();
183
- }
184
- return options;
185
- };
186
97
  const handleGetSingleAttrListObj = (children) => {
187
98
  if (!(children == null ? void 0 : children.length)) {
188
99
  return [];
@@ -206,6 +117,5 @@ const handleGetSingleAttrListObj = (children) => {
206
117
  exports.disabledDate = disabledDate;
207
118
  exports.handleGetPlaceholder = handleGetPlaceholder;
208
119
  exports.handleGetSingleAttrListObj = handleGetSingleAttrListObj;
209
- exports.handleSelectOptions = handleSelectOptions;
210
120
  exports.handleSetFormItemInitialValue = handleSetFormItemInitialValue;
211
121
  exports.handleUrlOptions = handleUrlOptions;
@@ -18,6 +18,7 @@ export interface IformConfigItem {
18
18
  }
19
19
 
20
20
  export interface Ijson {
21
+ 'field-names'?: string; // 级联选择的自定义字段名
21
22
  'input-width'?: string; // 输入框宽度
22
23
  'action-url-extra-params'?: { [key: string]: any }; // 弹窗选择对应多个表单字段时,额外的参数
23
24
  'disable-date-goover'?: boolean; // 禁用日期选择器超出当前日期
@@ -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");
@@ -24,7 +25,7 @@ const MySelect = ({
24
25
  }, [item.inputType, item.classify, item.data, item.options]);
25
26
  const handleLoadOptions = async () => {
26
27
  setLoading(true);
27
- const list = await func.handleSelectOptions({
28
+ const list = await method.handleSelectOptions({
28
29
  commonRequestWidthParams,
29
30
  commonRequest,
30
31
  interfaceTypeDict,
@@ -430,18 +430,19 @@ function useDynamicForm(props) {
430
430
  defaultWidth = 358,
431
431
  customWidth = {}
432
432
  }) => {
433
- var _a, _b, _c, _d, _e;
433
+ var _a, _b, _c, _d, _e, _f;
434
434
  const mode = item.json.input || "text";
435
+ const format = ((_a = item.json) == null ? void 0 : _a.format) || "";
435
436
  const attrid = item.attrid;
436
437
  const formatValue = func.handleSetFormItemInitialValue(item);
437
- const message2 = ((_a = item.json) == null ? void 0 : _a["default-prompt"]) || "";
438
- const disableDateGoover = ((_b = item.json) == null ? void 0 : _b["disable-date-goover"]) || false;
438
+ const message2 = ((_b = item.json) == null ? void 0 : _b["default-prompt"]) || "";
439
+ const disableDateGoover = ((_c = item.json) == null ? void 0 : _c["disable-date-goover"]) || false;
439
440
  const placeholder = func.handleGetPlaceholder(item, langId);
440
441
  const params = item.json.length && {
441
442
  maxLength: item.json.length
442
443
  } || {};
443
444
  const itemStyle = formItemStyle.find((v) => v.type === mode);
444
- let inputWidth = (_c = item.json) == null ? void 0 : _c["input-width"];
445
+ let inputWidth = (_d = item.json) == null ? void 0 : _d["input-width"];
445
446
  if (inputWidth) {
446
447
  inputWidth = formShowType === "table" ? Number(inputWidth) - 32 : inputWidth;
447
448
  }
@@ -452,7 +453,7 @@ function useDynamicForm(props) {
452
453
  antd.Input,
453
454
  {
454
455
  disabled: true,
455
- value: ((_d = item.json) == null ? void 0 : _d["label-value"]) || item.attrvalue || ((_e = item.json) == null ? void 0 : _e.default) || "-",
456
+ value: ((_e = item.json) == null ? void 0 : _e["label-value"]) || item.attrvalue || ((_f = item.json) == null ? void 0 : _f.default) || "-",
456
457
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
457
458
  }
458
459
  );
@@ -586,6 +587,7 @@ function useDynamicForm(props) {
586
587
  antd.DatePicker,
587
588
  {
588
589
  showTime: mode === "time-picker",
590
+ format: format ? format : void 0,
589
591
  picker: pickerObj[mode] || "date",
590
592
  disabled: readonly,
591
593
  disabledDate: disabledDateFunc,
@@ -1,6 +1,5 @@
1
- import { IformConfigItem, Ijson } from './index.d';
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
  * 处理表单项目初始值
@@ -18,15 +17,6 @@ export declare const handleUrlOptions: (val: any, delimiter: string, list: any[]
18
17
  * @param param0
19
18
  * @returns
20
19
  */
21
- export declare const handleSelectOptions: ({ commonRequestWidthParams, commonRequest, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, item, }: {
22
- commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
23
- commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
24
- interfaceTypeDict?: string | undefined;
25
- interfaceTypeSysDict?: string | undefined;
26
- actionUrlKey?: string | undefined;
27
- actionUrlExtraParams?: object | undefined;
28
- item: Ijson;
29
- }) => Promise<any[]>;
30
20
  /**
31
21
  * attrList 格式的单层数组 处理成对象{attrid:attrname}
32
22
  */