szld-libs 0.4.18 → 0.4.20

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) {
@@ -78,6 +78,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
78
78
  initialValue = [];
79
79
  }
80
80
  }
81
+ 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") {
82
+ initialValue = dayjs(initialValue);
83
+ }
81
84
  if (itemWithJson.attrtype === 1) {
82
85
  initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
83
86
  }
@@ -19,6 +19,8 @@ export interface IformConfigItem {
19
19
 
20
20
  export interface Ijson {
21
21
  hidden?: boolean; // 是否隐藏属性
22
+ 'auto-generate'?: boolean; // 是否自动生成时间
23
+ 'auto-generate-type'?: string; // 自动生成时间类型
22
24
  'instance-source-number'?: string; // 实例来源编号,配合instance-url使用
23
25
  'max-tag-count'?: number; // 最大标签数量
24
26
  readonly: boolean; // 是否只读属性
@@ -554,7 +554,6 @@ function useDynamicForm(props) {
554
554
  langId,
555
555
  onChange: (val) => {
556
556
  if (val && typeof val === "object" && !Array.isArray(val)) {
557
- alert(JSON.stringify(val));
558
557
  form.setFieldsValue({
559
558
  ...form.getFieldsValue(),
560
559
  ...val
@@ -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) {
@@ -80,6 +80,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
80
80
  initialValue = [];
81
81
  }
82
82
  }
83
+ 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") {
84
+ initialValue = dayjs(initialValue);
85
+ }
83
86
  if (itemWithJson.attrtype === 1) {
84
87
  initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
85
88
  }
@@ -19,6 +19,8 @@ export interface IformConfigItem {
19
19
 
20
20
  export interface Ijson {
21
21
  hidden?: boolean; // 是否隐藏属性
22
+ 'auto-generate'?: boolean; // 是否自动生成时间
23
+ 'auto-generate-type'?: string; // 自动生成时间类型
22
24
  'instance-source-number'?: string; // 实例来源编号,配合instance-url使用
23
25
  'max-tag-count'?: number; // 最大标签数量
24
26
  readonly: boolean; // 是否只读属性
@@ -555,7 +555,6 @@ function useDynamicForm(props) {
555
555
  langId,
556
556
  onChange: (val) => {
557
557
  if (val && typeof val === "object" && !Array.isArray(val)) {
558
- alert(JSON.stringify(val));
559
558
  form.setFieldsValue({
560
559
  ...form.getFieldsValue(),
561
560
  ...val
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.4.18",
4
+ "version": "0.4.20",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",