szld-libs 0.4.23 → 0.4.25

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.
@@ -18,6 +18,8 @@ export interface IformConfigItem {
18
18
  }
19
19
 
20
20
  export interface Ijson {
21
+ 'auto-generate'?: boolean; // 是否自动生成
22
+ 'auto-generate-type'?: string; // 自动生成类型
21
23
  'instance-source-number'?: string; // 实例来源编号,配合instance-url使用
22
24
  'field-names'?: string; // 级联选择的自定义字段名
23
25
  'search-field'?: any; // 是否搜索字段
@@ -0,0 +1,8 @@
1
+ import { CalendarProps, CalendarType } from 'react-vant';
2
+ declare const StringCompatibleCalendar: (props: {
3
+ value?: string | string[] | undefined;
4
+ onChange?: ((date: string | string[]) => void) | undefined;
5
+ langId: string;
6
+ type?: CalendarType | undefined;
7
+ } & CalendarProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default StringCompatibleCalendar;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const reactVant = require("react-vant");
4
+ const dayjs = require("dayjs");
5
+ const react = require("react");
6
+ const StringCompatibleCalendar = (props) => {
7
+ const { value, onChange, langId, type, ...restProps } = props;
8
+ const [internalValue, setInternalValue] = react.useState(() => {
9
+ if (!value)
10
+ return void 0;
11
+ if (Array.isArray(value)) {
12
+ return value.map((v) => {
13
+ if (typeof v === "string") {
14
+ return dayjs(v).toDate();
15
+ }
16
+ return v;
17
+ });
18
+ }
19
+ if (typeof value === "string") {
20
+ if (type === "multiple") {
21
+ return value.split(",").map((v) => {
22
+ if (typeof v === "string") {
23
+ return dayjs(v).toDate();
24
+ }
25
+ return v;
26
+ });
27
+ }
28
+ return dayjs(value).toDate();
29
+ }
30
+ return value;
31
+ });
32
+ react.useEffect(() => {
33
+ if (!value) {
34
+ setInternalValue(void 0);
35
+ return;
36
+ }
37
+ if (Array.isArray(value)) {
38
+ setInternalValue(value.map((v) => typeof v === "string" ? dayjs(v).toDate() : v));
39
+ } else if (typeof value === "string") {
40
+ setInternalValue(dayjs(value).toDate());
41
+ } else {
42
+ setInternalValue(value);
43
+ }
44
+ }, [value]);
45
+ const handleChange = (date) => {
46
+ if (!onChange)
47
+ return;
48
+ if (Array.isArray(date)) {
49
+ const strArr = date.map((d) => dayjs(d).format("YYYY-MM-DD"));
50
+ onChange(strArr);
51
+ } else {
52
+ const str = dayjs(date).format("YYYY-MM-DD");
53
+ onChange(str);
54
+ }
55
+ };
56
+ return /* @__PURE__ */ jsxRuntime.jsx(reactVant.Calendar, { type, value: internalValue, onConfirm: handleChange, children: (val, actions) => {
57
+ const valType = typeof val;
58
+ if (valType === "string") {
59
+ val = val.split("~");
60
+ if (val.length === 1) {
61
+ val = [val[0], val[1]];
62
+ }
63
+ }
64
+ return /* @__PURE__ */ jsxRuntime.jsx(
65
+ reactVant.Cell,
66
+ {
67
+ style: { padding: 0 },
68
+ value: val ? val.map(
69
+ (el) => dayjs(el).format("YYYY-MM-DD")
70
+ ).join("~") : langId === "10001" ? "请选择日期" : "Please select a date",
71
+ onClick: (e) => {
72
+ actions.open();
73
+ }
74
+ }
75
+ );
76
+ } });
77
+ };
78
+ module.exports = StringCompatibleCalendar;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -16,6 +16,7 @@ const MyUpload = require("./myUpload");
16
16
  const MyRadio = require("./myRadio");
17
17
  const antd = require("antd");
18
18
  const reactVant = require("react-vant");
19
+ const StringCompatibleCalendar = require("./myCalendar");
19
20
  dayjs.extend(isoWeek);
20
21
  function useDynamicForm(props) {
21
22
  const {
@@ -602,48 +603,27 @@ function useDynamicForm(props) {
602
603
  );
603
604
  }
604
605
  case "range-picker":
605
- return /* @__PURE__ */ jsxRuntime.jsx(reactVant.Calendar, { type: "range", readOnly: readonly, children: (val, actions) => {
606
- const valType = typeof val;
607
- if (valType === "string") {
608
- val = val.split("~");
609
- if (val.length === 1) {
610
- val = [val[0], val[1]];
606
+ return /* @__PURE__ */ jsxRuntime.jsx(
607
+ StringCompatibleCalendar,
608
+ {
609
+ langId,
610
+ value: formatValue,
611
+ type: "range",
612
+ onChange: (date) => {
611
613
  }
612
614
  }
613
- return /* @__PURE__ */ jsxRuntime.jsx(
614
- reactVant.Cell,
615
- {
616
- style: { padding: 0 },
617
- value: val ? val.map(
618
- (el) => dayjs(el).format("YYYY-MM-DD")
619
- ).join("~") : langId === "10001" ? "请选择日期" : "Please select a date",
620
- onClick: (e) => {
621
- actions.open();
622
- }
623
- }
624
- );
625
- } });
615
+ );
626
616
  case "multiple-date-picker":
627
- return /* @__PURE__ */ jsxRuntime.jsx(reactVant.Calendar, { type: "multiple", children: (val, actions) => {
628
- const valType = typeof val;
629
- if (valType === "string") {
630
- val = val.split(",");
631
- }
632
- return /* @__PURE__ */ jsxRuntime.jsx(
633
- reactVant.Cell,
634
- {
635
- style: { padding: 0 },
636
- value: val ? val.map(
637
- (el) => dayjs(el).format("YYYY-MM-DD")
638
- ).join(",") : langId === "10001" ? "请选择日期" : "Please select a date",
639
- onClick: () => {
640
- if (!readonly) {
641
- actions.open();
642
- }
643
- }
617
+ return /* @__PURE__ */ jsxRuntime.jsx(
618
+ StringCompatibleCalendar,
619
+ {
620
+ langId,
621
+ value: formatValue,
622
+ type: "multiple",
623
+ onChange: (date) => {
644
624
  }
645
- );
646
- } });
625
+ }
626
+ );
647
627
  case "radio":
648
628
  return /* @__PURE__ */ jsxRuntime.jsx(
649
629
  MyRadio,
package/lib/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const services = require("./services");
4
+ const method = require("./utils/method");
4
5
  const main = require("./main");
5
6
  const reactRouterDom = require("react-router-dom");
6
7
  const antd = require("antd");
8
+ const reactVant = require("react-vant");
7
9
  const react = require("react");
8
10
  const ReactDOM = require("react-dom/client");
9
11
  const zhCN = require("antd/es/locale/zh_CN");
@@ -15,20 +17,29 @@ const tableDetail = "";
15
17
  dayjs.locale("zh-cn");
16
18
  const Demo = () => {
17
19
  const formRef = react.useRef(null);
18
- const [form] = antd.Form.useForm();
20
+ const [form] = reactVant.Form.useForm();
19
21
  const [list, setList] = react.useState([]);
20
22
  const [langId, setLangId] = react.useState("");
21
23
  const onValuesChange = async (values, allValues) => {
22
24
  };
23
25
  react.useEffect(() => {
24
- setList(mock.attrList);
26
+ setList(method.handleAttrList(mock.attrList));
27
+ setTimeout(() => {
28
+ form.setFieldsValue({
29
+ customFormList: [
30
+ {
31
+ "30BDE6E7977E40069B55DDE61C8795AE": ["2026-05-21", "2026-05-28"]
32
+ }
33
+ ]
34
+ });
35
+ }, 2e3);
25
36
  }, []);
26
37
  const onFinish = async (values) => {
27
38
  };
28
39
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
29
40
  /* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
30
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form, { form, onValuesChange, onFinish, children: /* @__PURE__ */ jsxRuntime.jsx(
31
- main.DynamicForm,
41
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsx(reactVant.Form, { form, onValuesChange, onFinish, children: /* @__PURE__ */ jsxRuntime.jsx(
42
+ main.DynamicFormMobile,
32
43
  {
33
44
  formConfig: list,
34
45
  readonly: false,
@@ -41,6 +52,7 @@ const Demo = () => {
41
52
  commonRequest: services.commonRequest,
42
53
  instructionShowMode: "icon",
43
54
  ref: formRef,
55
+ formShowType: "table",
44
56
  langId
45
57
  }
46
58
  ) }) }),
package/lib/mock/index.js CHANGED
@@ -4,270 +4,78 @@ const baseAttrList = [];
4
4
  const attrList = [
5
5
  {
6
6
  xh: 1,
7
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
7
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
8
8
  astype: 0,
9
- tname: "tcdkpz_table",
10
- attrid: "452A52271CB640E8A7EBA64114E41823",
11
- attrname: "套餐编号",
9
+ tname: "tsyy_table2",
10
+ attrid: "30BDE6E7977E40069B55DDE61C8795AE",
11
+ attrname: "Dates",
12
12
  attrtype: 0,
13
- info: '{"input":"text","dataType":"string","length":100,"auto-generate":true,"auto-generate-type":"guid","hidden":true}',
13
+ info: '{"readonly":false,"input":"range-picker","range-picker-save":"single","dataType":"string","length":1000,"input-width":240,"must":true}',
14
14
  info_base64: 0,
15
- createtime: "2026-05-20 15:03:42",
15
+ createtime: "2026-02-11 15:12:26",
16
16
  attrvalue: "",
17
- serialnum: 0,
18
- children: [],
19
- json: {
20
- input: "text",
21
- dataType: "string",
22
- length: 100,
23
- "auto-generate": true,
24
- "auto-generate-type": "guid",
25
- hidden: true
26
- }
17
+ serialnum: 1,
18
+ children: []
27
19
  },
28
20
  {
29
21
  xh: 2,
30
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
22
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
31
23
  astype: 0,
32
- tname: "tcdkpz_table",
33
- attrid: "8B8A0AE3A5EB498982E03F4EA937A3E0",
34
- attrname: "顺序号",
24
+ tname: "tsyy_table2",
25
+ attrid: "38A7DADC6D64492D83DA607EC121A02D",
26
+ attrname: "How Many Times",
35
27
  attrtype: 0,
36
- info: '{"input":"number","dataType":"int","must":true}',
28
+ info: '{"input":"text","dataType":"string","length":10,"input-width":140,"must":true}',
37
29
  info_base64: 0,
38
- createtime: "2026-05-22 14:56:07",
30
+ createtime: "2026-02-11 15:12:26",
39
31
  attrvalue: "",
40
- serialnum: 1,
41
- children: [],
42
- json: {
43
- input: "number",
44
- dataType: "int",
45
- must: true
46
- }
32
+ serialnum: 2,
33
+ children: []
47
34
  },
48
35
  {
49
36
  xh: 3,
50
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
37
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
51
38
  astype: 0,
52
- tname: "tcdkpz_table",
53
- attrid: "A8D4CF41106F4E1F8090A767F962A744",
54
- attrname: "套餐说明",
39
+ tname: "tsyy_table2",
40
+ attrid: "7BB9BE8A96824CCF89B721C8F1AF9F38",
41
+ attrname: "Feeding Time",
55
42
  attrtype: 0,
56
- info: '{"input":"text","dataType":"string","length":200,"must":true}',
43
+ info: '{"input":"select","dataType":"string","length":100,"inputType":"local","data":["7:00am – 7:30am", "7:30am – 8:00am", "8:00am – 8:30am", "8:30am – 9:00am", "9:00am – 9:30am", "9:30am – 10:00am", "10:00am – 10:30am", "10:30am – 11:00am", "11:00am – 11:30am", "11:30am – 12:00pm", "12:00pm – 12:30pm", "12:30pm – 1:00pm", "1:00pm – 1:30pm", "1:30pm – 2:00pm", "2:00pm – 2:30pm", "2:30pm – 3:00pm", "3:00pm – 3:30pm", "3:30pm – 4:00pm", "4:00pm – 4:30pm", "4:30pm – 5:00pm", "5:00pm – 5:30pm", "5:30pm – 6:00pm", "6:00pm – 6:30pm", "6:30pm – 7:00pm", "7:00pm – 7:30pm", "7:30pm – 8:00pm"],"must":true}',
57
44
  info_base64: 0,
58
- createtime: "2026-05-20 15:03:42",
45
+ createtime: "2026-02-11 15:12:26",
59
46
  attrvalue: "",
60
- serialnum: 2,
61
- children: [],
62
- json: {
63
- input: "text",
64
- dataType: "string",
65
- length: 200,
66
- must: true
67
- }
47
+ serialnum: 3,
48
+ children: []
68
49
  },
69
50
  {
70
51
  xh: 4,
71
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
52
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
72
53
  astype: 0,
73
- tname: "tcdkpz_table",
74
- attrid: "350AF384E18C490D862A3B930A7DED8B",
75
- attrname: "关联服务编号",
54
+ tname: "tsyy_table2",
55
+ attrid: "665F59E637664037939512C9877EAD75",
56
+ attrname: "Meds Info",
76
57
  attrtype: 0,
77
- info: '{"input":"text","dataType":"string","length":100,"must":true,"hidden":true}',
58
+ info: '{"input":"text","dataType":"string","length":500,"input-width":240}',
78
59
  info_base64: 0,
79
- createtime: "2026-05-20 15:03:42",
60
+ createtime: "2026-02-11 15:12:26",
80
61
  attrvalue: "",
81
- serialnum: 3,
82
- children: [],
83
- json: {
84
- input: "text",
85
- dataType: "string",
86
- length: 100,
87
- must: true,
88
- hidden: true
89
- }
62
+ serialnum: 4,
63
+ children: []
90
64
  },
91
65
  {
92
66
  xh: 5,
93
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
94
- astype: 0,
95
- tname: "tcdkpz_table",
96
- attrid: "06DDAB9B8DC34A6FB65602238FF35DAD",
97
- attrname: "关联服务名称",
98
- attrtype: 0,
99
- info: '{"input":"select","inputType":"instance-url","dataType":"string","length":100,"instance-source-number":"5000245","key-field":{"06DDAB9B8DC34A6FB65602238FF35DAD":{"list":["003AB3221AE84161B87368F67FD7F4F4"],"delimiter":"-"},"350AF384E18C490D862A3B930A7DED8B":{"list":["B4604AEB3C3C46239958C90C98911839"],"delimiter":","}}}',
100
- info_base64: 0,
101
- createtime: "2026-05-25 16:00:07",
102
- attrvalue: "",
103
- serialnum: 4,
104
- children: [],
105
- json: {
106
- input: "select",
107
- inputType: "instance-url",
108
- dataType: "string",
109
- length: 100,
110
- "instance-source-number": "5000245",
111
- "key-field": {
112
- "06DDAB9B8DC34A6FB65602238FF35DAD": {
113
- list: ["003AB3221AE84161B87368F67FD7F4F4"],
114
- delimiter: "-"
115
- },
116
- "350AF384E18C490D862A3B930A7DED8B": {
117
- list: ["B4604AEB3C3C46239958C90C98911839"],
118
- delimiter: ","
119
- }
120
- }
121
- }
122
- },
123
- {
124
- xh: 6,
125
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
67
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
126
68
  astype: 0,
127
- tname: "tcdkpz_table",
128
- attrid: "78B7A74ECE664836917FEB4502965E14",
129
- attrname: "关联房型编号",
69
+ tname: "tsyy_table2",
70
+ attrid: "290CF33D2AAD45399987987FAB80900B",
71
+ attrname: "Feeding Instruction",
130
72
  attrtype: 0,
131
- info: '{"input":"text","dataType":"string","length":100,"hidden":true}',
73
+ info: '{"input":"text","dataType":"string","length":500,"input-width":340}',
132
74
  info_base64: 0,
133
- createtime: "2026-05-25 16:00:16",
75
+ createtime: "2026-02-11 15:12:26",
134
76
  attrvalue: "",
135
77
  serialnum: 5,
136
- children: [],
137
- json: {
138
- input: "text",
139
- dataType: "string",
140
- length: 100,
141
- hidden: true
142
- }
143
- },
144
- {
145
- xh: 7,
146
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
147
- astype: 0,
148
- tname: "tcdkpz_table",
149
- attrid: "AFFAD31706E84259B4A3FF71F0752362",
150
- attrname: "关联房型名称",
151
- attrtype: 0,
152
- info: '{"input":"text","inputType":"instance-url","dataType":"string","length":100,"instance-source-number":5000033,"key-field":{"AFFAD31706E84259B4A3FF71F0752362":{"list":["DCC3C536A7BC41A2B972CA8779FC3CAC"],"delimiter":"-"},"78B7A74ECE664836917FEB4502965E14":{"list":["1710D157CDFF46A7A4E4501095C8ACBE"],"delimiter":","}}}',
153
- info_base64: 0,
154
- createtime: "2026-05-25 16:00:36",
155
- attrvalue: "",
156
- serialnum: 6,
157
- children: [],
158
- json: {
159
- input: "text",
160
- inputType: "instance-url",
161
- dataType: "string",
162
- length: 100,
163
- "instance-source-number": 5000033,
164
- "key-field": {
165
- AFFAD31706E84259B4A3FF71F0752362: {
166
- list: ["DCC3C536A7BC41A2B972CA8779FC3CAC"],
167
- delimiter: "-"
168
- },
169
- "78B7A74ECE664836917FEB4502965E14": {
170
- list: ["1710D157CDFF46A7A4E4501095C8ACBE"],
171
- delimiter: ","
172
- }
173
- }
174
- }
175
- },
176
- {
177
- xh: 8,
178
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
179
- astype: 0,
180
- tname: "tcdkpz_table",
181
- attrid: "571CDE321CE74DA48B5FC74537551689",
182
- attrname: "可抵扣天(晚)数",
183
- attrtype: 0,
184
- info: '{"input":"number","dataType":"int","must":true}',
185
- info_base64: 0,
186
- createtime: "2026-05-20 15:03:42",
187
- attrvalue: "",
188
- serialnum: 7,
189
- children: [],
190
- json: {
191
- input: "number",
192
- dataType: "int",
193
- must: true
194
- }
195
- },
196
- {
197
- xh: 9,
198
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
199
- astype: 0,
200
- tname: "tcdkpz_table",
201
- attrid: "0EFC42CF4F9946DDA52C754F545E963A",
202
- attrname: "套餐金额",
203
- attrtype: 0,
204
- info: '{"input":"text","dataType":"string","length":"100","must":true}',
205
- info_base64: 0,
206
- createtime: "2026-05-20 15:03:42",
207
- attrvalue: "",
208
- serialnum: 8,
209
- children: [],
210
- json: {
211
- input: "text",
212
- dataType: "string",
213
- length: "100",
214
- must: true
215
- }
216
- },
217
- {
218
- xh: 10,
219
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
220
- astype: 0,
221
- tname: "tcdkpz_table",
222
- attrid: "E5560CDEC6E3467C87BB5EEBEA4A9A5B",
223
- attrname: "是否启用",
224
- attrtype: 0,
225
- info: '{"input":"select","dataType":"string","length":100,"inputType":"local","must":true,"options":[{"label":"是","value":"5000024-1"},{"label":"否","value":"5000024-2"}]}',
226
- info_base64: 0,
227
- createtime: "2026-05-21 09:51:28",
228
- attrvalue: "",
229
- serialnum: 9,
230
- children: [],
231
- json: {
232
- input: "select",
233
- dataType: "string",
234
- length: 100,
235
- inputType: "local",
236
- must: true,
237
- options: [
238
- {
239
- label: "是",
240
- value: "5000024-1"
241
- },
242
- {
243
- label: "否",
244
- value: "5000024-2"
245
- }
246
- ]
247
- }
248
- },
249
- {
250
- xh: 11,
251
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
252
- astype: 0,
253
- tname: "tcdkpz_table",
254
- attrid: "B602827557DB4F87B760FA243FCFB581",
255
- attrname: "创建时间",
256
- attrtype: 0,
257
- info: '{"input":"time-picker","dataType":"datetime","must":true,"auto-generate":true,"auto-generate-type":"currenttime","hidden":true}',
258
- info_base64: 0,
259
- createtime: "2026-05-20 15:03:42",
260
- attrvalue: "",
261
- serialnum: 10,
262
- children: [],
263
- json: {
264
- input: "time-picker",
265
- dataType: "datetime",
266
- must: true,
267
- "auto-generate": true,
268
- "auto-generate-type": "currenttime",
269
- hidden: true
270
- }
78
+ children: []
271
79
  }
272
80
  ];
273
81
  const langConfig = [
@@ -35,22 +35,6 @@ const handleSubmitForm = (originalData, allValues) => {
35
35
  const { attr_list = [] } = updatedData;
36
36
  const { isMobile = false, guid, isListToObj = false, isAutoFill = true, onlyNumber = "" } = originalData;
37
37
  let uploadedFiles = [];
38
- if (isAutoFill) {
39
- (_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
40
- var _a2, _b, _c, _d, _e, _f;
41
- if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"])) {
42
- if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
43
- v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
44
- }
45
- if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "guid") {
46
- v.attrvalue = onlyNumber || guid || "";
47
- }
48
- }
49
- if ((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["default"]) {
50
- v.attrvalue = (_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"];
51
- }
52
- });
53
- }
54
38
  const processAttrList = (attrList, values) => {
55
39
  try {
56
40
  const attrMap = new Map(attrList.map((item, index) => [item.attrid, index]));
@@ -176,6 +160,23 @@ const handleSubmitForm = (originalData, allValues) => {
176
160
  if (updatedData.attr_list && Array.isArray(updatedData.attr_list)) {
177
161
  processAttrList(attr_list, allValues);
178
162
  }
163
+ if (isAutoFill) {
164
+ (_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
165
+ var _a2, _b, _c, _d, _e, _f;
166
+ const attrvalue = (v == null ? void 0 : v.attrvalue) || "";
167
+ if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"]) && !attrvalue) {
168
+ if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
169
+ v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
170
+ }
171
+ if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "guid" && !attrvalue) {
172
+ v.attrvalue = onlyNumber || guid || "";
173
+ }
174
+ }
175
+ if (((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["default"]) && !attrvalue) {
176
+ v.attrvalue = (_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"];
177
+ }
178
+ });
179
+ }
179
180
  return {
180
181
  updatedData: isListToObj ? handleAttrListToObj(updatedData.attr_list || []) : updatedData,
181
182
  uploadedFiles
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.4.23",
4
+ "version": "0.4.25",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",