szld-libs 0.4.24 → 0.4.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.
@@ -34,7 +34,7 @@ const handleGetPlaceholder = (itemWithJson, langId) => {
34
34
  return defaultMessage;
35
35
  };
36
36
  const handleSetFormItemInitialValue = (itemWithJson) => {
37
- var _a, _b, _c, _d;
37
+ var _a, _b, _c, _d, _e, _f;
38
38
  const inputType = (_a = itemWithJson.json) == null ? void 0 : _a.input;
39
39
  let initialValue = itemWithJson.attrvalue || ((_b = itemWithJson.json) == null ? void 0 : _b.default) || "";
40
40
  if (inputType === "label" && initialValue) {
@@ -77,6 +77,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
77
77
  initialValue = [];
78
78
  }
79
79
  }
80
+ if (inputType === "time-picker" && !initialValue && ((_e = itemWithJson.json) == null ? void 0 : _e["auto-generate"]) && ((_f = itemWithJson.json) == null ? void 0 : _f["auto-generate-type"]) === "currenttime") {
81
+ initialValue = dayjs().format("YYYY-MM-DD HH:mm:ss:ss");
82
+ }
80
83
  if (itemWithJson.attrtype === 1) {
81
84
  initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
82
85
  }
@@ -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; // 是否搜索字段
@@ -56,7 +56,8 @@ const DynamicForm = forwardRef((props, ref) => {
56
56
  CustomModalComponent,
57
57
  hideAttrList,
58
58
  langId,
59
- getTitle
59
+ getTitle,
60
+ formListItemName
60
61
  });
61
62
  useImperativeHandle(ref, () => ({
62
63
  getDelFileList: () => {
@@ -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,79 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Calendar, Cell } from "react-vant";
3
+ import dayjs from "dayjs";
4
+ import { useState, useEffect } from "react";
5
+ const StringCompatibleCalendar = (props) => {
6
+ const { value, onChange, langId, type } = props;
7
+ const [internalValue, setInternalValue] = useState(() => {
8
+ if (!value)
9
+ return void 0;
10
+ if (Array.isArray(value)) {
11
+ return value.map((v) => {
12
+ if (typeof v === "string") {
13
+ return dayjs(v).toDate();
14
+ }
15
+ return v;
16
+ });
17
+ }
18
+ if (typeof value === "string") {
19
+ if (type === "multiple") {
20
+ return value.split(",").map((v) => {
21
+ if (typeof v === "string") {
22
+ return dayjs(v).toDate();
23
+ }
24
+ return v;
25
+ });
26
+ }
27
+ return dayjs(value).toDate();
28
+ }
29
+ return value;
30
+ });
31
+ useEffect(() => {
32
+ if (!value) {
33
+ setInternalValue(void 0);
34
+ return;
35
+ }
36
+ if (Array.isArray(value)) {
37
+ setInternalValue(value.map((v) => typeof v === "string" ? dayjs(v).toDate() : v));
38
+ } else if (typeof value === "string") {
39
+ setInternalValue(dayjs(value).toDate());
40
+ } else {
41
+ setInternalValue(value);
42
+ }
43
+ }, [value]);
44
+ const handleChange = (date) => {
45
+ if (!onChange)
46
+ return;
47
+ if (Array.isArray(date)) {
48
+ const strArr = date.map((d) => dayjs(d).format("YYYY-MM-DD"));
49
+ onChange(strArr);
50
+ } else {
51
+ const str = dayjs(date).format("YYYY-MM-DD");
52
+ onChange(str);
53
+ }
54
+ };
55
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Calendar, { type, value: internalValue, onConfirm: handleChange, children: (val, actions) => {
56
+ const valType = typeof val;
57
+ if (valType === "string") {
58
+ val = val.split("~");
59
+ if (val.length === 1) {
60
+ val = [val[0], val[1]];
61
+ }
62
+ }
63
+ return /* @__PURE__ */ jsx(
64
+ Cell,
65
+ {
66
+ style: { padding: 0 },
67
+ value: val ? val.map(
68
+ (el) => dayjs(el).format("YYYY-MM-DD")
69
+ ).join("~") : langId === "10001" ? "请选择日期" : "Please select a date",
70
+ onClick: (e) => {
71
+ actions.open();
72
+ }
73
+ }
74
+ );
75
+ } }) });
76
+ };
77
+ export {
78
+ StringCompatibleCalendar as default
79
+ };
@@ -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>
@@ -21,6 +21,7 @@ interface IDynamicFormProps {
21
21
  hideAttrList?: string[];
22
22
  langId?: string;
23
23
  getTitle?: (pageID: string, dataID: string) => string;
24
+ formListItemName?: string;
24
25
  }
25
26
  type NestedFormListFieldData = FormListFieldData & {
26
27
  parentName?: (string | number)[];
@@ -14,7 +14,8 @@ import MySelect from "./mySelect";
14
14
  import MyUpload from "./myUpload";
15
15
  import MyRadio from "./myRadio";
16
16
  import { App, Col, Collapse, Card, Flex, Button, DatePicker, Tooltip } from "antd";
17
- import { Form, Input, Calendar, Cell, DatetimePicker } from "react-vant";
17
+ import { Form, Input, DatetimePicker } from "react-vant";
18
+ import StringCompatibleCalendar from "./myCalendar";
18
19
  dayjs.extend(isoWeek);
19
20
  function useDynamicForm(props) {
20
21
  const {
@@ -31,7 +32,8 @@ function useDynamicForm(props) {
31
32
  CustomModalComponent,
32
33
  hideAttrList = [],
33
34
  langId = "10001",
34
- getTitle
35
+ getTitle,
36
+ formListItemName = "customFormList"
35
37
  } = props;
36
38
  const formConfigRef = useRef([]);
37
39
  const { message } = App.useApp();
@@ -328,7 +330,8 @@ function useDynamicForm(props) {
328
330
  relatedid,
329
331
  form,
330
332
  defaultWidth: width,
331
- customWidth: { width: "100%" }
333
+ customWidth: { width: "100%" },
334
+ formListField
332
335
  })
333
336
  },
334
337
  index
@@ -369,7 +372,8 @@ function useDynamicForm(props) {
369
372
  radioAlign,
370
373
  relatedid,
371
374
  form,
372
- defaultWidth
375
+ defaultWidth,
376
+ formListField
373
377
  })
374
378
  },
375
379
  itemWithJson.attrid
@@ -411,11 +415,13 @@ function useDynamicForm(props) {
411
415
  relatedid,
412
416
  form,
413
417
  defaultWidth = 358,
414
- customWidth = {}
418
+ customWidth = {},
419
+ formListField
415
420
  }) => {
416
421
  var _a, _b, _c;
417
422
  const mode = item.json.input || "text";
418
423
  const attrid = item.attrid;
424
+ const formItemName = formListField ? Array.isArray(formListField.name) ? [...formListField.name, item.attrid] : [formListItemName, formListField.name, item.attrid] : item.attrid;
419
425
  const formatValue = handleSetFormItemInitialValue(item);
420
426
  const message2 = ((_a = item.json) == null ? void 0 : _a["default-prompt"]) || "";
421
427
  const placeholder = handleGetPlaceholder(item, langId);
@@ -601,48 +607,29 @@ function useDynamicForm(props) {
601
607
  );
602
608
  }
603
609
  case "range-picker":
604
- return /* @__PURE__ */ jsx(Calendar, { type: "range", readOnly: readonly, children: (val, actions) => {
605
- const valType = typeof val;
606
- if (valType === "string") {
607
- val = val.split("~");
608
- if (val.length === 1) {
609
- val = [val[0], val[1]];
610
+ return /* @__PURE__ */ jsx(
611
+ StringCompatibleCalendar,
612
+ {
613
+ langId,
614
+ value: formatValue,
615
+ type: "range",
616
+ onChange: (date) => {
617
+ form.setFieldValue(formItemName, date);
610
618
  }
611
619
  }
612
- return /* @__PURE__ */ jsx(
613
- Cell,
614
- {
615
- style: { padding: 0 },
616
- value: val ? val.map(
617
- (el) => dayjs(el).format("YYYY-MM-DD")
618
- ).join("~") : langId === "10001" ? "请选择日期" : "Please select a date",
619
- onClick: (e) => {
620
- actions.open();
621
- }
622
- }
623
- );
624
- } });
620
+ );
625
621
  case "multiple-date-picker":
626
- return /* @__PURE__ */ jsx(Calendar, { type: "multiple", children: (val, actions) => {
627
- const valType = typeof val;
628
- if (valType === "string") {
629
- val = val.split(",");
630
- }
631
- return /* @__PURE__ */ jsx(
632
- Cell,
633
- {
634
- style: { padding: 0 },
635
- value: val ? val.map(
636
- (el) => dayjs(el).format("YYYY-MM-DD")
637
- ).join(",") : langId === "10001" ? "请选择日期" : "Please select a date",
638
- onClick: () => {
639
- if (!readonly) {
640
- actions.open();
641
- }
642
- }
622
+ return /* @__PURE__ */ jsx(
623
+ StringCompatibleCalendar,
624
+ {
625
+ langId,
626
+ value: formatValue,
627
+ type: "multiple",
628
+ onChange: (date) => {
629
+ form.setFieldValue(item.attrid, date);
643
630
  }
644
- );
645
- } });
631
+ }
632
+ );
646
633
  case "radio":
647
634
  return /* @__PURE__ */ jsx(
648
635
  MyRadio,
package/es/index.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { commonRequestWidthParams, uploadFormAction, commonRequest } from "./services";
3
- import { BackHeader, DynamicForm } from "./main";
3
+ import { handleAttrList } from "./utils/method";
4
+ import { BackHeader, DynamicFormMobile } from "./main";
4
5
  import { BrowserRouter } from "react-router-dom";
5
- import { ConfigProvider, App, Form } from "antd";
6
+ import { ConfigProvider, App } from "antd";
7
+ import { Form, Button } from "react-vant";
6
8
  import { useRef, useState, useEffect } from "react";
7
9
  import ReactDOM from "react-dom/client";
8
10
  import zhCN from "antd/es/locale/zh_CN";
9
11
  import { attrList } from "./mock";
10
12
  import dayjs from "dayjs";
11
- import "./utils/szxkFunc";
12
13
  const index = "";
13
14
  const tableDetail = "";
14
15
  dayjs.locale("zh-cn");
@@ -20,29 +21,35 @@ const Demo = () => {
20
21
  const onValuesChange = async (values, allValues) => {
21
22
  };
22
23
  useEffect(() => {
23
- setList(attrList);
24
+ setList(handleAttrList(attrList));
25
+ setTimeout(() => {
26
+ }, 2e3);
24
27
  }, []);
25
28
  const onFinish = async (values) => {
26
29
  };
27
30
  return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
28
31
  /* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
29
- /* @__PURE__ */ jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsx(Form, { form, onValuesChange, onFinish, children: /* @__PURE__ */ jsx(
30
- DynamicForm,
31
- {
32
- formConfig: list,
33
- readonly: false,
34
- form,
35
- relatedid: "guid",
36
- colNum: 1,
37
- defaultWidth: 358,
38
- commonRequestWidthParams,
39
- uploadAction: uploadFormAction,
40
- commonRequest,
41
- instructionShowMode: "icon",
42
- ref: formRef,
43
- langId
44
- }
45
- ) }) }),
32
+ /* @__PURE__ */ jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxs(Form, { form, onValuesChange, onFinish, children: [
33
+ /* @__PURE__ */ jsx(
34
+ DynamicFormMobile,
35
+ {
36
+ formConfig: list,
37
+ readonly: false,
38
+ form,
39
+ relatedid: "guid",
40
+ colNum: 1,
41
+ defaultWidth: 358,
42
+ commonRequestWidthParams,
43
+ uploadAction: uploadFormAction,
44
+ commonRequest,
45
+ instructionShowMode: "icon",
46
+ ref: formRef,
47
+ formShowType: "table",
48
+ langId
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsx(Form.Item, { name: "submit", style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx(Button, { round: true, nativeType: "submit", type: "primary", block: true, children: "提交" }) })
52
+ ] }) }),
46
53
  /* @__PURE__ */ jsxs("div", { children: [
47
54
  "2. 测试循环滚动组件",
48
55
  /* @__PURE__ */ jsx(
package/es/mock/index.js CHANGED
@@ -2,270 +2,78 @@ const baseAttrList = [];
2
2
  const attrList = [
3
3
  {
4
4
  xh: 1,
5
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
5
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
6
6
  astype: 0,
7
- tname: "tcdkpz_table",
8
- attrid: "452A52271CB640E8A7EBA64114E41823",
9
- attrname: "套餐编号",
7
+ tname: "tsyy_table2",
8
+ attrid: "30BDE6E7977E40069B55DDE61C8795AE",
9
+ attrname: "Dates",
10
10
  attrtype: 0,
11
- info: '{"input":"text","dataType":"string","length":100,"auto-generate":true,"auto-generate-type":"guid","hidden":true}',
11
+ info: '{"readonly":false,"input":"range-picker","range-picker-save":"single","dataType":"string","length":1000,"input-width":240,"must":true}',
12
12
  info_base64: 0,
13
- createtime: "2026-05-20 15:03:42",
13
+ createtime: "2026-02-11 15:12:26",
14
14
  attrvalue: "",
15
- serialnum: 0,
16
- children: [],
17
- json: {
18
- input: "text",
19
- dataType: "string",
20
- length: 100,
21
- "auto-generate": true,
22
- "auto-generate-type": "guid",
23
- hidden: true
24
- }
15
+ serialnum: 1,
16
+ children: []
25
17
  },
26
18
  {
27
19
  xh: 2,
28
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
20
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
29
21
  astype: 0,
30
- tname: "tcdkpz_table",
31
- attrid: "8B8A0AE3A5EB498982E03F4EA937A3E0",
32
- attrname: "顺序号",
22
+ tname: "tsyy_table2",
23
+ attrid: "38A7DADC6D64492D83DA607EC121A02D",
24
+ attrname: "How Many Times",
33
25
  attrtype: 0,
34
- info: '{"input":"number","dataType":"int","must":true}',
26
+ info: '{"input":"text","dataType":"string","length":10,"input-width":140,"must":true}',
35
27
  info_base64: 0,
36
- createtime: "2026-05-22 14:56:07",
28
+ createtime: "2026-02-11 15:12:26",
37
29
  attrvalue: "",
38
- serialnum: 1,
39
- children: [],
40
- json: {
41
- input: "number",
42
- dataType: "int",
43
- must: true
44
- }
30
+ serialnum: 2,
31
+ children: []
45
32
  },
46
33
  {
47
34
  xh: 3,
48
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
35
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
49
36
  astype: 0,
50
- tname: "tcdkpz_table",
51
- attrid: "A8D4CF41106F4E1F8090A767F962A744",
52
- attrname: "套餐说明",
37
+ tname: "tsyy_table2",
38
+ attrid: "7BB9BE8A96824CCF89B721C8F1AF9F38",
39
+ attrname: "Feeding Time",
53
40
  attrtype: 0,
54
- info: '{"input":"text","dataType":"string","length":200,"must":true}',
41
+ 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}',
55
42
  info_base64: 0,
56
- createtime: "2026-05-20 15:03:42",
43
+ createtime: "2026-02-11 15:12:26",
57
44
  attrvalue: "",
58
- serialnum: 2,
59
- children: [],
60
- json: {
61
- input: "text",
62
- dataType: "string",
63
- length: 200,
64
- must: true
65
- }
45
+ serialnum: 3,
46
+ children: []
66
47
  },
67
48
  {
68
49
  xh: 4,
69
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
50
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
70
51
  astype: 0,
71
- tname: "tcdkpz_table",
72
- attrid: "350AF384E18C490D862A3B930A7DED8B",
73
- attrname: "关联服务编号",
52
+ tname: "tsyy_table2",
53
+ attrid: "665F59E637664037939512C9877EAD75",
54
+ attrname: "Meds Info",
74
55
  attrtype: 0,
75
- info: '{"input":"text","dataType":"string","length":100,"must":true,"hidden":true}',
56
+ info: '{"input":"text","dataType":"string","length":500,"input-width":240}',
76
57
  info_base64: 0,
77
- createtime: "2026-05-20 15:03:42",
58
+ createtime: "2026-02-11 15:12:26",
78
59
  attrvalue: "",
79
- serialnum: 3,
80
- children: [],
81
- json: {
82
- input: "text",
83
- dataType: "string",
84
- length: 100,
85
- must: true,
86
- hidden: true
87
- }
60
+ serialnum: 4,
61
+ children: []
88
62
  },
89
63
  {
90
64
  xh: 5,
91
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
92
- astype: 0,
93
- tname: "tcdkpz_table",
94
- attrid: "06DDAB9B8DC34A6FB65602238FF35DAD",
95
- attrname: "关联服务名称",
96
- attrtype: 0,
97
- info: '{"input":"select","inputType":"instance-url","dataType":"string","length":100,"instance-source-number":"5000245","key-field":{"06DDAB9B8DC34A6FB65602238FF35DAD":{"list":["003AB3221AE84161B87368F67FD7F4F4"],"delimiter":"-"},"350AF384E18C490D862A3B930A7DED8B":{"list":["B4604AEB3C3C46239958C90C98911839"],"delimiter":","}}}',
98
- info_base64: 0,
99
- createtime: "2026-05-25 16:00:07",
100
- attrvalue: "",
101
- serialnum: 4,
102
- children: [],
103
- json: {
104
- input: "select",
105
- inputType: "instance-url",
106
- dataType: "string",
107
- length: 100,
108
- "instance-source-number": "5000245",
109
- "key-field": {
110
- "06DDAB9B8DC34A6FB65602238FF35DAD": {
111
- list: ["003AB3221AE84161B87368F67FD7F4F4"],
112
- delimiter: "-"
113
- },
114
- "350AF384E18C490D862A3B930A7DED8B": {
115
- list: ["B4604AEB3C3C46239958C90C98911839"],
116
- delimiter: ","
117
- }
118
- }
119
- }
120
- },
121
- {
122
- xh: 6,
123
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
65
+ asid: "06C6CE201AB44B2CAAB11C753374AA40",
124
66
  astype: 0,
125
- tname: "tcdkpz_table",
126
- attrid: "78B7A74ECE664836917FEB4502965E14",
127
- attrname: "关联房型编号",
67
+ tname: "tsyy_table2",
68
+ attrid: "290CF33D2AAD45399987987FAB80900B",
69
+ attrname: "Feeding Instruction",
128
70
  attrtype: 0,
129
- info: '{"input":"text","dataType":"string","length":100,"hidden":true}',
71
+ info: '{"input":"text","dataType":"string","length":500,"input-width":340}',
130
72
  info_base64: 0,
131
- createtime: "2026-05-25 16:00:16",
73
+ createtime: "2026-02-11 15:12:26",
132
74
  attrvalue: "",
133
75
  serialnum: 5,
134
- children: [],
135
- json: {
136
- input: "text",
137
- dataType: "string",
138
- length: 100,
139
- hidden: true
140
- }
141
- },
142
- {
143
- xh: 7,
144
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
145
- astype: 0,
146
- tname: "tcdkpz_table",
147
- attrid: "AFFAD31706E84259B4A3FF71F0752362",
148
- attrname: "关联房型名称",
149
- attrtype: 0,
150
- info: '{"input":"text","inputType":"instance-url","dataType":"string","length":100,"instance-source-number":5000033,"key-field":{"AFFAD31706E84259B4A3FF71F0752362":{"list":["DCC3C536A7BC41A2B972CA8779FC3CAC"],"delimiter":"-"},"78B7A74ECE664836917FEB4502965E14":{"list":["1710D157CDFF46A7A4E4501095C8ACBE"],"delimiter":","}}}',
151
- info_base64: 0,
152
- createtime: "2026-05-25 16:00:36",
153
- attrvalue: "",
154
- serialnum: 6,
155
- children: [],
156
- json: {
157
- input: "text",
158
- inputType: "instance-url",
159
- dataType: "string",
160
- length: 100,
161
- "instance-source-number": 5000033,
162
- "key-field": {
163
- AFFAD31706E84259B4A3FF71F0752362: {
164
- list: ["DCC3C536A7BC41A2B972CA8779FC3CAC"],
165
- delimiter: "-"
166
- },
167
- "78B7A74ECE664836917FEB4502965E14": {
168
- list: ["1710D157CDFF46A7A4E4501095C8ACBE"],
169
- delimiter: ","
170
- }
171
- }
172
- }
173
- },
174
- {
175
- xh: 8,
176
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
177
- astype: 0,
178
- tname: "tcdkpz_table",
179
- attrid: "571CDE321CE74DA48B5FC74537551689",
180
- attrname: "可抵扣天(晚)数",
181
- attrtype: 0,
182
- info: '{"input":"number","dataType":"int","must":true}',
183
- info_base64: 0,
184
- createtime: "2026-05-20 15:03:42",
185
- attrvalue: "",
186
- serialnum: 7,
187
- children: [],
188
- json: {
189
- input: "number",
190
- dataType: "int",
191
- must: true
192
- }
193
- },
194
- {
195
- xh: 9,
196
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
197
- astype: 0,
198
- tname: "tcdkpz_table",
199
- attrid: "0EFC42CF4F9946DDA52C754F545E963A",
200
- attrname: "套餐金额",
201
- attrtype: 0,
202
- info: '{"input":"text","dataType":"string","length":"100","must":true}',
203
- info_base64: 0,
204
- createtime: "2026-05-20 15:03:42",
205
- attrvalue: "",
206
- serialnum: 8,
207
- children: [],
208
- json: {
209
- input: "text",
210
- dataType: "string",
211
- length: "100",
212
- must: true
213
- }
214
- },
215
- {
216
- xh: 10,
217
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
218
- astype: 0,
219
- tname: "tcdkpz_table",
220
- attrid: "E5560CDEC6E3467C87BB5EEBEA4A9A5B",
221
- attrname: "是否启用",
222
- attrtype: 0,
223
- info: '{"input":"select","dataType":"string","length":100,"inputType":"local","must":true,"options":[{"label":"是","value":"5000024-1"},{"label":"否","value":"5000024-2"}]}',
224
- info_base64: 0,
225
- createtime: "2026-05-21 09:51:28",
226
- attrvalue: "",
227
- serialnum: 9,
228
- children: [],
229
- json: {
230
- input: "select",
231
- dataType: "string",
232
- length: 100,
233
- inputType: "local",
234
- must: true,
235
- options: [
236
- {
237
- label: "是",
238
- value: "5000024-1"
239
- },
240
- {
241
- label: "否",
242
- value: "5000024-2"
243
- }
244
- ]
245
- }
246
- },
247
- {
248
- xh: 11,
249
- asid: "A16FC2DAFC9F4786A0BCE4842F680B21",
250
- astype: 0,
251
- tname: "tcdkpz_table",
252
- attrid: "B602827557DB4F87B760FA243FCFB581",
253
- attrname: "创建时间",
254
- attrtype: 0,
255
- info: '{"input":"time-picker","dataType":"datetime","must":true,"auto-generate":true,"auto-generate-type":"currenttime","hidden":true}',
256
- info_base64: 0,
257
- createtime: "2026-05-20 15:03:42",
258
- attrvalue: "",
259
- serialnum: 10,
260
- children: [],
261
- json: {
262
- input: "time-picker",
263
- dataType: "datetime",
264
- must: true,
265
- "auto-generate": true,
266
- "auto-generate-type": "currenttime",
267
- hidden: true
268
- }
76
+ children: []
269
77
  }
270
78
  ];
271
79
  const langConfig = [
@@ -36,7 +36,7 @@ const handleGetPlaceholder = (itemWithJson, langId) => {
36
36
  return defaultMessage;
37
37
  };
38
38
  const handleSetFormItemInitialValue = (itemWithJson) => {
39
- var _a, _b, _c, _d;
39
+ var _a, _b, _c, _d, _e, _f;
40
40
  const inputType = (_a = itemWithJson.json) == null ? void 0 : _a.input;
41
41
  let initialValue = itemWithJson.attrvalue || ((_b = itemWithJson.json) == null ? void 0 : _b.default) || "";
42
42
  if (inputType === "label" && initialValue) {
@@ -79,6 +79,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
79
79
  initialValue = [];
80
80
  }
81
81
  }
82
+ if (inputType === "time-picker" && !initialValue && ((_e = itemWithJson.json) == null ? void 0 : _e["auto-generate"]) && ((_f = itemWithJson.json) == null ? void 0 : _f["auto-generate-type"]) === "currenttime") {
83
+ initialValue = dayjs().format("YYYY-MM-DD HH:mm:ss:ss");
84
+ }
82
85
  if (itemWithJson.attrtype === 1) {
83
86
  initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
84
87
  }