zhytech-ui 1.0.35 → 1.0.37

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 (26) hide show
  1. package/README.md +19 -7
  2. package/dist/src/components/dynamicForm/components/base/date/index.d.ts +102 -0
  3. package/dist/src/components/dynamicForm/components/base/date/propsEditor.vue.d.ts +2 -0
  4. package/dist/src/components/dynamicForm/components/base/date/renderer.vue.d.ts +113 -0
  5. package/dist/src/components/dynamicForm/components/base/hooks/useDatetimeType.d.ts +15 -0
  6. package/dist/src/components/dynamicForm/components/base/index.d.ts +4 -1
  7. package/dist/src/components/dynamicForm/components/base/inputNumber/index.d.ts +107 -0
  8. package/dist/src/components/dynamicForm/components/base/inputNumber/propsEditor.vue.d.ts +2 -0
  9. package/dist/src/components/dynamicForm/components/base/inputNumber/renderer.vue.d.ts +113 -0
  10. package/dist/src/components/dynamicForm/components/base/time/index.d.ts +102 -0
  11. package/dist/src/components/dynamicForm/components/base/time/propsEditor.vue.d.ts +2 -0
  12. package/dist/src/components/dynamicForm/components/base/time/renderer.vue.d.ts +113 -0
  13. package/dist/src/components/dynamicForm/formRenderer.vue.d.ts +8 -2
  14. package/dist/src/components/dynamicForm/types/abnormalCheckView.d.ts +18 -0
  15. package/dist/src/components/dynamicForm/types/componentAttribute/base/datetimeAttribute.d.ts +54 -0
  16. package/dist/src/components/dynamicForm/types/componentAttribute/base/inputNumberAttribute.d.ts +27 -0
  17. package/dist/src/components/dynamicForm/types/componentAttribute/baseAttribute.d.ts +16 -0
  18. package/dist/src/components/dynamicForm/types/componentAttribute/index.d.ts +3 -1
  19. package/dist/src/components/dynamicForm/types/datetimeTypeView.d.ts +26 -0
  20. package/dist/src/components/dynamicForm/types/relevanceConditionView.d.ts +21 -0
  21. package/dist/src/types/enum.d.ts +61 -0
  22. package/dist/src/utils/dayjs.d.ts +129 -0
  23. package/dist/style.css +1 -1
  24. package/dist/zhytech-ui.es.js +6208 -4416
  25. package/dist/zhytech-ui.umd.js +4 -4
  26. package/package.json +76 -74
@@ -0,0 +1,113 @@
1
+ import { baseAttribute, editAttribute, datetimeAttribute } from '../../../types/componentAttribute/index';
2
+ type componentType = baseAttribute & editAttribute & datetimeAttribute;
3
+ declare const _default: import('vue').DefineComponent<{
4
+ /**
5
+ * 是否为设计模式
6
+ */
7
+ isDesigner: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
11
+ /**
12
+ * 是否禁用
13
+ */
14
+ disabled: {
15
+ type: BooleanConstructor;
16
+ default: boolean;
17
+ };
18
+ /**
19
+ * 是否只读
20
+ */
21
+ readonly: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ /**
26
+ * 组件ID
27
+ */
28
+ componentID: {
29
+ type: (StringConstructor | NumberConstructor)[];
30
+ required: true;
31
+ };
32
+ /**
33
+ * 表单数据
34
+ */
35
+ datas: {
36
+ type: globalThis.PropType<Record<string, any>>;
37
+ required: true;
38
+ };
39
+ /**
40
+ * 组件属性
41
+ */
42
+ componentProps: {
43
+ type: globalThis.PropType<componentType>;
44
+ required: true;
45
+ };
46
+ /**
47
+ * 是否项目说明/答案解析
48
+ */
49
+ showDescription: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
53
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
54
+ "update:datas": (...args: any[]) => void;
55
+ }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
56
+ /**
57
+ * 是否为设计模式
58
+ */
59
+ isDesigner: {
60
+ type: BooleanConstructor;
61
+ default: boolean;
62
+ };
63
+ /**
64
+ * 是否禁用
65
+ */
66
+ disabled: {
67
+ type: BooleanConstructor;
68
+ default: boolean;
69
+ };
70
+ /**
71
+ * 是否只读
72
+ */
73
+ readonly: {
74
+ type: BooleanConstructor;
75
+ default: boolean;
76
+ };
77
+ /**
78
+ * 组件ID
79
+ */
80
+ componentID: {
81
+ type: (StringConstructor | NumberConstructor)[];
82
+ required: true;
83
+ };
84
+ /**
85
+ * 表单数据
86
+ */
87
+ datas: {
88
+ type: globalThis.PropType<Record<string, any>>;
89
+ required: true;
90
+ };
91
+ /**
92
+ * 组件属性
93
+ */
94
+ componentProps: {
95
+ type: globalThis.PropType<componentType>;
96
+ required: true;
97
+ };
98
+ /**
99
+ * 是否项目说明/答案解析
100
+ */
101
+ showDescription: {
102
+ type: BooleanConstructor;
103
+ default: boolean;
104
+ };
105
+ }>> & {
106
+ "onUpdate:datas"?: ((...args: any[]) => any) | undefined;
107
+ }, {
108
+ disabled: boolean;
109
+ readonly: boolean;
110
+ showDescription: boolean;
111
+ isDesigner: boolean;
112
+ }, {}>;
113
+ export default _default;
@@ -52,12 +52,15 @@ declare const _default: import('vue').DefineComponent<{
52
52
  default: boolean;
53
53
  };
54
54
  /**
55
- * 已选择组件集合,用于回显
55
+ * 批量导入时传入已选择组件集合
56
56
  */
57
57
  selectComponents: {
58
58
  type: globalThis.PropType<Record<string, any>[]>;
59
59
  default: () => never[];
60
60
  };
61
+ /**
62
+ * 隐藏标题
63
+ */
61
64
  hiddenTitle: {
62
65
  type: BooleanConstructor;
63
66
  default: boolean;
@@ -153,12 +156,15 @@ declare const _default: import('vue').DefineComponent<{
153
156
  default: boolean;
154
157
  };
155
158
  /**
156
- * 已选择组件集合,用于回显
159
+ * 批量导入时传入已选择组件集合
157
160
  */
158
161
  selectComponents: {
159
162
  type: globalThis.PropType<Record<string, any>[]>;
160
163
  default: () => never[];
161
164
  };
165
+ /**
166
+ * 隐藏标题
167
+ */
162
168
  hiddenTitle: {
163
169
  type: BooleanConstructor;
164
170
  default: boolean;
@@ -0,0 +1,18 @@
1
+ import { abnormalCheckType, checkLevelType } from '../../../types/enum';
2
+ type abnormalCheck = keyof typeof abnormalCheckType;
3
+ type checkLevel = keyof typeof checkLevelType;
4
+ export interface abnormalCheckView {
5
+ /**
6
+ * 类型
7
+ */
8
+ type: abnormalCheck;
9
+ /**
10
+ * 检核值
11
+ */
12
+ value: number;
13
+ /**
14
+ * 检核级别
15
+ */
16
+ level: checkLevel;
17
+ }
18
+ export {};
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @description:日期时间(date/time)独有属性
3
+ */
4
+ export interface datetimeAttribute {
5
+ /**
6
+ * @description: 日期时间类型:'year' | 'years' |'month' | 'months' | 'date' | 'dates' | 'datetime' | 'week' | 'datetimerange' | 'daterange' | 'monthrange' | 'yearrange'
7
+ *
8
+ */
9
+ datetimeType?: string;
10
+ /**
11
+ * 日期时间格式
12
+ */
13
+ format?: string;
14
+ /**
15
+ * 日期时间值格式
16
+ */
17
+ valueFormat?: string;
18
+ /**
19
+ * 最大时间
20
+ */
21
+ maxTime?: string;
22
+ /**
23
+ * 最小时间
24
+ */
25
+ minTime?: string;
26
+ /**
27
+ * 允许选择当前时间之前的年/月/周/天/小时/分钟
28
+ */
29
+ beforeTimeThreshold?: number;
30
+ /**
31
+ * 允许选择当前时间之后的年/月/周/天/小时/分钟
32
+ */
33
+ afterTimeThreshold?: number;
34
+ /**
35
+ * 日期/时间区间连接符
36
+ */
37
+ rangeSeparator?: string;
38
+ /**
39
+ * 是否为时间区间
40
+ */
41
+ isRange?: string;
42
+ /**
43
+ * 开始时间
44
+ */
45
+ startTime?: string;
46
+ /**
47
+ * 结束时间
48
+ */
49
+ endTime?: string;
50
+ /**
51
+ * 间隔时间
52
+ */
53
+ timeStep?: string;
54
+ }
@@ -0,0 +1,27 @@
1
+ import { abnormalCheckView } from '../../abnormalCheckView';
2
+ import { relevanceConditionView } from '../../relevanceConditionView';
3
+ /**
4
+ * @description: 数字框组件(inputNumber)独有属性
5
+ */
6
+ export interface inputNumberAttribute {
7
+ /**
8
+ * 单位
9
+ */
10
+ unit: string;
11
+ /**
12
+ * 是否允许输入文本
13
+ */
14
+ allowText: boolean;
15
+ /**
16
+ * 允许输入的文本
17
+ */
18
+ allowTextOptions?: string[];
19
+ /**
20
+ * 异常值检核列表
21
+ */
22
+ abnormalCheckList?: abnormalCheckView[];
23
+ /**
24
+ * 关联条件列表
25
+ */
26
+ relevanceConditionList?: relevanceConditionView[];
27
+ }
@@ -82,4 +82,20 @@ export interface baseAttribute {
82
82
  * 所属tabs组件的页签ID
83
83
  */
84
84
  pageID?: string;
85
+ /**
86
+ * 所属tabs组件的页签ID
87
+ */
88
+ componentWidth?: number;
89
+ /**
90
+ * 获取数据接口
91
+ */
92
+ fetchDataInterface?: string;
93
+ /**
94
+ * 获取远端数据接口参数
95
+ */
96
+ dataInterfaceParameter?: Record<string, any>[];
97
+ /**
98
+ * 远端数据属性映射
99
+ */
100
+ dataAttributeMapping?: Record<string, string>;
85
101
  }
@@ -8,5 +8,7 @@ import { postAttribute } from './application/postAttribute';
8
8
  import { checkboxAttribute } from './base/checkboxAttribute';
9
9
  import { inputAttribute } from './base/inputAttribute';
10
10
  import { radioAttribute } from './base/radioAttribute';
11
+ import { datetimeAttribute } from './base/datetimeAttribute';
12
+ import { inputNumberAttribute } from './base/inputNumberAttribute';
11
13
  import { editAttribute } from './editAttribute';
12
- export type { baseAttribute, groupLayoutAttribute, tabsLayoutAttribute, uploadAttribute, employeeAttribute, gradeAttribute, postAttribute, editAttribute, inputAttribute, radioAttribute, checkboxAttribute };
14
+ export type { baseAttribute, groupLayoutAttribute, tabsLayoutAttribute, uploadAttribute, employeeAttribute, gradeAttribute, postAttribute, editAttribute, inputAttribute, radioAttribute, checkboxAttribute, datetimeAttribute, inputNumberAttribute };
@@ -0,0 +1,26 @@
1
+ export interface datetimeTypeView {
2
+ /**
3
+ * 类型
4
+ */
5
+ type: string;
6
+ /**
7
+ * 类型名称
8
+ */
9
+ typeName: string;
10
+ /**
11
+ * 格式
12
+ */
13
+ format: string;
14
+ /**
15
+ * 单位
16
+ */
17
+ unit?: string;
18
+ /**
19
+ * 宽度
20
+ */
21
+ width?: number;
22
+ /**
23
+ * 类型对应的属性集合
24
+ */
25
+ props: string[];
26
+ }
@@ -0,0 +1,21 @@
1
+ import { relevanceType } from '../../../types/enum';
2
+ type relevance = keyof typeof relevanceType;
3
+ export interface relevanceConditionView {
4
+ /**
5
+ * 类型
6
+ */
7
+ type: relevance;
8
+ /**
9
+ * 上限值
10
+ */
11
+ upperLimit: number;
12
+ /**
13
+ * 下限值
14
+ */
15
+ lowerLimit: number;
16
+ /**
17
+ * 目标项目序号
18
+ */
19
+ targetItemID: string;
20
+ }
21
+ export {};
@@ -68,10 +68,71 @@ export declare enum filterConditionTypes {
68
68
  * @description: 组件类型
69
69
  */
70
70
  export declare enum componentType {
71
+ /**
72
+ * 输入框
73
+ */
71
74
  INPUT = "input",
75
+ /**
76
+ * 日期时间
77
+ */
72
78
  DATETIME = "datetime",
79
+ /**
80
+ * 日期
81
+ */
73
82
  DATE = "date",
83
+ /**
84
+ * 时间
85
+ */
74
86
  TIME = "time",
87
+ /**
88
+ * 下拉框
89
+ */
75
90
  SELECTOR = "selector",
91
+ /**
92
+ * 级联选择器
93
+ */
76
94
  CASCADER_SELECTOR = "cascaderSelector"
77
95
  }
96
+ /**
97
+ * @description: 异常值检核类型
98
+ */
99
+ export declare enum abnormalCheckType {
100
+ /**
101
+ * 上限
102
+ */
103
+ upperLimit = "\u4E0A\u9650\u503C",
104
+ /**
105
+ * 下限
106
+ */
107
+ lowerLimit = "\u4E0B\u9650\u503C",
108
+ /**
109
+ * 小数位数
110
+ */
111
+ decimalPlace = "\u5C0F\u6570\u4F4D"
112
+ }
113
+ /**
114
+ * @description: 异常值检核级别类型
115
+ */
116
+ export declare enum checkLevelType {
117
+ /**
118
+ * 错误
119
+ */
120
+ error = "\u9519\u8BEF",
121
+ /**
122
+ * 警告
123
+ */
124
+ warning = "\u8B66\u544A"
125
+ }
126
+ /**
127
+ * @description: 关联类型
128
+ */
129
+ export declare enum relevanceType {
130
+ /**
131
+ * 自动选择
132
+ */
133
+ autoSelect = "\u81EA\u52A8\u9009\u62E9",
134
+ /**
135
+ * 自动取消
136
+ */
137
+ autoCancel = "\u81EA\u52A8\u53D6\u6D88"
138
+ }
@@ -0,0 +1,129 @@
1
+ import { default as dayjs } from 'dayjs';
2
+ /**
3
+ * 校检日期格式是否为YYYY-MM-DD这种格式
4
+ * @param date
5
+ * @returns {boolean}
6
+ */
7
+ export declare function isValidDate(date: dayjs.ConfigType): boolean;
8
+ /**
9
+ * 校检日期格式是否为YYYY-MM-DD HH:mm:ss这种格式
10
+ * @param date
11
+ * @returns {boolean}
12
+ */
13
+ export declare function isValidDateTime(date: dayjs.ConfigType): boolean;
14
+ /**
15
+ * 格式化日期年月日,时间格式为format,默认YYYY-MM-DD
16
+ * @param date
17
+ * @param format
18
+ * @returns {string}
19
+ */
20
+ export declare function formatDate(date: dayjs.ConfigType, format?: string): string;
21
+ /**
22
+ * 获取当前日期年月日,时间格式为YYYY-MM-DD
23
+ * @param format
24
+ * @returns {string}
25
+ */
26
+ export declare function getCurrentDate(format?: string): string;
27
+ /**
28
+ * 获取当前日期年月日时分秒,时间格式为YYYY-MM-DD HH:mm:ss(24小时制,如果hh为小写表示为12小时制)
29
+ * @param format
30
+ * @returns {string}
31
+ */
32
+ export declare function getCurrentDateTime(format?: string): string;
33
+ /**
34
+ * 获取日期的毫秒数
35
+ * @param date
36
+ * @returns {string}
37
+ */
38
+ export declare function getmilliseconds(date?: dayjs.ConfigType): number;
39
+ /**
40
+ * 获取日期的指定值
41
+ * @param date
42
+ * @param dateType 为要获取日期类型,有如下类型:'minute','hour','day','month','year'这六种类型
43
+ * @returns {string}
44
+ */
45
+ export declare function getTimeByType(dateType: dayjs.ManipulateType, date?: dayjs.ConfigType): any;
46
+ /**
47
+ * 将传过来的日期加X日期且时间格式为YYYY-MM-DD这种格式,如:getXAfterDate('2023-11-11',1,'day'),结果为2023-11-12
48
+ * @param date:为传过来的日期
49
+ * @param num:在当前日期加num,类型为int
50
+ * @param dateType:为要加的日期类型,有如下类型:'minute','hour','day','week','month','year'这六种类型
51
+ * @returns {string}
52
+ */
53
+ export declare function getXAfterDate(date: dayjs.ConfigType, num: number, dateType: dayjs.ManipulateType): string;
54
+ /**
55
+ * 将传过来的日期加X日期且时间格式为YYYY-MM-DD HH:mm:ss这种格式,如:getXAfterDateTime('2023-11-11 10:23:45',1,'day'),结果为2023-11-12 10:23:45
56
+ * @param date:为传过来的日期
57
+ * @param num:在当前日期加num,类型为int
58
+ * @param dateType:为要加的日期类型,有如下类型:'minute','hour','day','week','month','year'这六种类型
59
+ * @returns {string}
60
+ */
61
+ export declare function getXAfterDateTime(date: dayjs.ConfigType, num: number, dateType: dayjs.ManipulateType): string;
62
+ /**
63
+ * 将传过来的日期减去X日期且时间格式为YYYY-MM-DD这种格式,如:getXBeforeDate('2023-11-11',1,'day'),结果为2023-11-10
64
+ * @param date:为传过来的日期
65
+ * @param num:在当前日期加num,类型为int
66
+ * @param dateType:为要加的日期类型,有如下类型:'minute','hour','day','week','month','year'这六种类型
67
+ * @returns {string}
68
+ */
69
+ export declare function getXBeforeDate(date: dayjs.ConfigType, num: number, dateType: dayjs.ManipulateType): string;
70
+ /**
71
+ * 将传过来的日期减去X日期且时间格式为YYYY-MM-DD HH:mm:ss这种格式,如:getXBeforeDateTime('2023-11-11 10:23:45',1,'day'),结果为2023-11-10 10:23:45
72
+ * @param date:为传过来的日期
73
+ * @param num:在当前日期加day,类型为int
74
+ * @param dateType:为要加的日期类型,有如下类型:'minute','hour','day','week','month','year'这六种类型
75
+ * @returns {string}
76
+ */
77
+ export declare function getXBeforeDateTime(date: dayjs.ConfigType, num: number, dateType: dayjs.ManipulateType): string;
78
+ /**
79
+ * 计算2个日期之间的差值
80
+ * @param startDate:开始日期
81
+ * @param endDate:结束日期,结束日期要比开始日期大
82
+ * @param dateType:日期类型,有如下类型:'minute','hour','day','week','month','year'这六种类型
83
+ * @returns {number}
84
+ */
85
+ export declare function getDateDiff(startDate: dayjs.ConfigType, endDate: dayjs.ConfigType, dateType: dayjs.ManipulateType): number;
86
+ /**
87
+ * 判断date1是否在date2之前,比如:date1:2023-01-01 13:30:23,date2:2022-12-01 13:30:23,结果为false
88
+ * @param date1
89
+ * @param date2
90
+ * @returns {boolean}
91
+ */
92
+ export declare function isBefore(date1: dayjs.ConfigType, date2: dayjs.ConfigType): boolean;
93
+ /**
94
+ * 判断date1是否在date2之后,比如:date1:2023-01-01 13:30:23,date2:2022-12-01 13:30:23,结果为true
95
+ * @param date1
96
+ * @param date2
97
+ * @returns {boolean}
98
+ */
99
+ export declare function isAfter(date1: dayjs.ConfigType, date2: dayjs.ConfigType): boolean;
100
+ /**
101
+ * 判断date1是否与date2相同,比如:date1:2023-01-01 13:30:23,date2:2022-12-01 13:30:23,结果为false
102
+ * @param date1
103
+ * @param date2
104
+ * @returns {boolean}
105
+ */
106
+ export declare function isSame(date1: dayjs.ConfigType, date2: dayjs.ConfigType): boolean;
107
+ /**
108
+ * 将传过来的日期转为当年的1月1号或者当月的1号或者当周的周一
109
+ * @param date:传过来日期
110
+ * @param dateType,日期类型,为:year,month,week这3种
111
+ * @returns {string}
112
+ */
113
+ export declare function getEarlyDaysDate(date: dayjs.ConfigType, dateType: dayjs.ManipulateType): string;
114
+ /**
115
+ * 将传过来的日期转为当年的12月31号或者当月的最后一天或者当周的周日
116
+ * @param date:传过来日期
117
+ * @param dateType,日期类型,为:year,month,week这3种
118
+ * @returns {string}
119
+ */
120
+ export declare function getLastDaysDate(date: dayjs.ConfigType, dateType: dayjs.ManipulateType): string;
121
+ /**
122
+ * 获取2个日期之间的所有日期,包括开始日期和结束日期,如:getIntermediateDate('2023-12-01','2023-12-15',1,'day'))
123
+ * @param startDate:开始日期
124
+ * @param endDate:结束日期要大于开始日期
125
+ * @param num:在开始日期上加num,int类型,如果dateType为day,num为1那么就是在开始日期上加一天
126
+ * @param dateType,日期类型,类型如下:'minute','hour','day','week','month','year'这六种类型
127
+ * @returns {*[]}
128
+ */
129
+ export declare function getIntermediateDate(startDate: dayjs.ConfigType, endDate: dayjs.ConfigType, num: number, dateType: dayjs.ManipulateType): (string | number | Date | dayjs.Dayjs | null | undefined)[];