zhytech-ui 1.2.13 → 1.2.15

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 (23) hide show
  1. package/README.md +11 -0
  2. package/dist/src/components/dynamicForm/components/application/department/index.d.ts +93 -0
  3. package/dist/src/components/dynamicForm/components/application/department/propsEditor.vue.d.ts +2 -0
  4. package/dist/src/components/dynamicForm/components/application/department/renderer.vue.d.ts +98 -0
  5. package/dist/src/components/dynamicForm/components/application/index.d.ts +2 -1
  6. package/dist/src/components/dynamicForm/components/common/componentSetting.vue.d.ts +11 -0
  7. package/dist/src/components/dynamicForm/components/common/httpSetting.vue.d.ts +34 -0
  8. package/dist/src/components/dynamicForm/types/componentAttribute/application/departmentAttribute.d.ts +17 -0
  9. package/dist/src/components/dynamicForm/types/componentAttribute/application/employeeAttribute.d.ts +1 -1
  10. package/dist/src/components/dynamicForm/types/componentAttribute/application/postAttribute.d.ts +1 -1
  11. package/dist/src/components/dynamicForm/types/componentAttribute/base/inputAttribute.d.ts +12 -0
  12. package/dist/src/components/dynamicForm/types/componentAttribute/baseAttribute.d.ts +3 -10
  13. package/dist/src/components/dynamicForm/types/componentAttribute/index.d.ts +2 -1
  14. package/dist/src/components/dynamicForm/types/enum.d.ts +21 -0
  15. package/dist/src/components/dynamicForm/types/httpSettingView.d.ts +34 -0
  16. package/dist/src/components/jsonViewer.vue.d.ts +86 -0
  17. package/dist/src/hooks/useUtils.d.ts +9 -0
  18. package/dist/src/index.d.ts +2 -1
  19. package/dist/src/utils/eventBus.d.ts +6 -0
  20. package/dist/style.css +1 -1
  21. package/dist/zhytech-ui.es.js +8981 -7151
  22. package/dist/zhytech-ui.umd.js +15 -11
  23. package/package.json +83 -81
package/README.md CHANGED
@@ -90,6 +90,17 @@ npm install --legacy-peer-deps
90
90
 
91
91
  > #### 版本更新清单:
92
92
 
93
+ **V 1.2.15**
94
+ ```html
95
+ 1.新增jsonViewer组件,用于查看json格式数据
96
+ 2.zhy-dynamic-form组件的input组件新增支持设置动态请求数据
97
+ ```
98
+
99
+ **V 1.2.14**
100
+ ```html
101
+ 1.调整zhy-dynamic-form组件的单选、多选组件的选项支持设置分数,getData方法返回数据时,包含选项的分数
102
+ ```
103
+
93
104
  **V 1.2.13**
94
105
  ```html
95
106
  1.修复zhy-dynamic-renderer组件tabs组件无法添加子组件问题
@@ -0,0 +1,93 @@
1
+ import { default as baseComponent } from '../../../types/baseComponent';
2
+ import { baseAttribute, editAttribute, departmentAttribute } from '../../../types/componentAttribute/index';
3
+ import { filterConditionTypes } from '../../../../../types/enum';
4
+ type conditionType = keyof typeof filterConditionTypes;
5
+ declare class component extends baseComponent {
6
+ constructor();
7
+ /**
8
+ * @description: 获取校验规则
9
+ * @param componentProps
10
+ * @return
11
+ */
12
+ getRules(componentProps: Record<string, any>): {
13
+ required: any;
14
+ message: any;
15
+ }[];
16
+ /**
17
+ * @description: 获取过滤条件属性
18
+ * @param componentProps
19
+ * @return
20
+ */
21
+ getFilterConditionProps(componentProps: Record<string, any>): {
22
+ type: string;
23
+ options: any;
24
+ };
25
+ /**
26
+ * @description: 获取组件要排除的过滤条件集合
27
+ */
28
+ getExcludeFilterConditions(): conditionType[];
29
+ }
30
+ declare const _default: {
31
+ component: typeof component;
32
+ renderer: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
33
+ isDesigner: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ disabled: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ componentID: {
42
+ type: (StringConstructor | NumberConstructor)[];
43
+ required: true;
44
+ };
45
+ datas: {
46
+ type: PropType<Record<string, any>>;
47
+ required: true;
48
+ };
49
+ componentProps: {
50
+ type: PropType<baseAttribute & editAttribute & departmentAttribute>;
51
+ required: true;
52
+ };
53
+ showDescription: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
57
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
58
+ "update:datas": (...args: any[]) => void;
59
+ }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
60
+ isDesigner: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ disabled: {
65
+ type: BooleanConstructor;
66
+ default: boolean;
67
+ };
68
+ componentID: {
69
+ type: (StringConstructor | NumberConstructor)[];
70
+ required: true;
71
+ };
72
+ datas: {
73
+ type: PropType<Record<string, any>>;
74
+ required: true;
75
+ };
76
+ componentProps: {
77
+ type: PropType<baseAttribute & editAttribute & departmentAttribute>;
78
+ required: true;
79
+ };
80
+ showDescription: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
84
+ }>> & Readonly<{
85
+ "onUpdate:datas"?: ((...args: any[]) => any) | undefined;
86
+ }>, {
87
+ disabled: boolean;
88
+ showDescription: boolean;
89
+ isDesigner: boolean;
90
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
91
+ propEditor: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
92
+ };
93
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,98 @@
1
+ import { baseAttribute, editAttribute, departmentAttribute } from '../../../types/componentAttribute/index';
2
+ type componentType = baseAttribute & editAttribute & departmentAttribute;
3
+ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
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
+ * 组件ID
20
+ */
21
+ componentID: {
22
+ type: (StringConstructor | NumberConstructor)[];
23
+ required: true;
24
+ };
25
+ /**
26
+ * 表单数据
27
+ */
28
+ datas: {
29
+ type: PropType<Record<string, any>>;
30
+ required: true;
31
+ };
32
+ /**
33
+ * 组件属性
34
+ */
35
+ componentProps: {
36
+ type: PropType<componentType>;
37
+ required: true;
38
+ };
39
+ /**
40
+ * 是否项目说明/答案解析
41
+ */
42
+ showDescription: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
47
+ "update:datas": (...args: any[]) => void;
48
+ }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
49
+ /**
50
+ * 是否为设计模式
51
+ */
52
+ isDesigner: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ /**
57
+ * 是否禁用
58
+ */
59
+ disabled: {
60
+ type: BooleanConstructor;
61
+ default: boolean;
62
+ };
63
+ /**
64
+ * 组件ID
65
+ */
66
+ componentID: {
67
+ type: (StringConstructor | NumberConstructor)[];
68
+ required: true;
69
+ };
70
+ /**
71
+ * 表单数据
72
+ */
73
+ datas: {
74
+ type: PropType<Record<string, any>>;
75
+ required: true;
76
+ };
77
+ /**
78
+ * 组件属性
79
+ */
80
+ componentProps: {
81
+ type: PropType<componentType>;
82
+ required: true;
83
+ };
84
+ /**
85
+ * 是否项目说明/答案解析
86
+ */
87
+ showDescription: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
91
+ }>> & Readonly<{
92
+ "onUpdate:datas"?: ((...args: any[]) => any) | undefined;
93
+ }>, {
94
+ disabled: boolean;
95
+ showDescription: boolean;
96
+ isDesigner: boolean;
97
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
98
+ export default _default;
@@ -1,4 +1,5 @@
1
1
  import { default as employee } from './employee/index';
2
2
  import { default as grade } from './grade/index';
3
3
  import { default as post } from './post/index';
4
- export { employee, grade, post };
4
+ import { default as department } from './department/index';
5
+ export { employee, grade, post, department };
@@ -0,0 +1,11 @@
1
+ type __VLS_PublicProps = {
2
+ modelValue?: Record<string, any>;
3
+ };
4
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
5
+ "update:modelValue": (value: Record<string, any>) => any;
6
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
7
+ "onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
9
+ settingDropdown: unknown;
10
+ }, any>;
11
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import { eventTypeEnum } from '../../types/enum';
2
+ import { httpSettingView } from '../../types/httpSettingView';
3
+ type __VLS_Props = {
4
+ eventType: eventTypeEnum;
5
+ componentID: string;
6
+ };
7
+ type __VLS_PublicProps = {
8
+ modelValue?: httpSettingView[];
9
+ } & __VLS_Props;
10
+ declare function __VLS_template(): {
11
+ attrs: Partial<{}>;
12
+ slots: {
13
+ default?(_: {}): any;
14
+ };
15
+ refs: {
16
+ httpSettingForm: unknown;
17
+ };
18
+ rootEl: HTMLDivElement;
19
+ };
20
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
+ "update:modelValue": (value: httpSettingView[]) => any;
23
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
24
+ "onUpdate:modelValue"?: ((value: httpSettingView[]) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
26
+ httpSettingForm: unknown;
27
+ }, HTMLDivElement>;
28
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
29
+ export default _default;
30
+ type __VLS_WithTemplateSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @description: 部门(department)组件属性
3
+ */
4
+ export interface departmentAttribute {
5
+ /**
6
+ * 显示类型
7
+ */
8
+ type: "selector" | "cascader";
9
+ /**
10
+ * 是否可以多选
11
+ */
12
+ multiple: boolean;
13
+ /**
14
+ * 部门列表
15
+ */
16
+ options: Record<string, any>[];
17
+ }
@@ -21,7 +21,7 @@ export interface employeeAttribute {
21
21
  /**
22
22
  * displayType=selector时是否可以多选
23
23
  */
24
- multiple?: boolean;
24
+ multiple: boolean;
25
25
  /**
26
26
  * 人员列表
27
27
  */
@@ -21,7 +21,7 @@ export interface postAttribute {
21
21
  /**
22
22
  * displayType=selector时是否可以多选
23
23
  */
24
- multiple?: boolean;
24
+ multiple: boolean;
25
25
  /**
26
26
  * 岗位列表
27
27
  */
@@ -18,4 +18,16 @@ export interface inputAttribute {
18
18
  * 正则验证提示信息
19
19
  */
20
20
  patternMessage?: string;
21
+ /**
22
+ * 最小行数
23
+ */
24
+ min?: number;
25
+ /**
26
+ * 最大行数
27
+ */
28
+ max?: number;
29
+ /**
30
+ * 是否支持查询标记
31
+ */
32
+ queryFlag: boolean;
21
33
  }
@@ -1,3 +1,4 @@
1
+ import { httpSettingView } from '../httpSettingView';
1
2
  /**
2
3
  * @description: 组件基本属性类型
3
4
  */
@@ -91,15 +92,7 @@ export interface baseAttribute {
91
92
  */
92
93
  lineBreak?: boolean;
93
94
  /**
94
- * 获取数据接口
95
+ * HTTP请求设置
95
96
  */
96
- fetchDataInterface?: string;
97
- /**
98
- * 获取远端数据接口参数
99
- */
100
- dataInterfaceParameter?: Record<string, any>[];
101
- /**
102
- * 远端数据属性映射
103
- */
104
- dataAttributeMapping?: Record<string, string>;
97
+ httpSettings?: httpSettingView[];
105
98
  }
@@ -9,6 +9,7 @@ import { uploadAttribute } from './advanced/uploadAttribute';
9
9
  import { employeeAttribute } from './application/employeeAttribute';
10
10
  import { postAttribute } from './application/postAttribute';
11
11
  import { gradeAttribute } from './application/gradeAttribute';
12
+ import { departmentAttribute } from './application/departmentAttribute';
12
13
  import { groupLayoutAttribute } from './layout/groupLayoutAttribute';
13
14
  import { tabsLayoutAttribute } from './layout/tabsLayoutAttribute';
14
- export type { baseAttribute, editAttribute, checkboxAttribute, inputAttribute, radioAttribute, datetimeAttribute, inputNumberAttribute, uploadAttribute, employeeAttribute, postAttribute, gradeAttribute, groupLayoutAttribute, tabsLayoutAttribute };
15
+ export type { baseAttribute, editAttribute, checkboxAttribute, inputAttribute, radioAttribute, datetimeAttribute, inputNumberAttribute, uploadAttribute, employeeAttribute, postAttribute, gradeAttribute, departmentAttribute, groupLayoutAttribute, tabsLayoutAttribute };
@@ -63,6 +63,10 @@ export declare enum componentTypeEnum {
63
63
  * 岗位组件
64
64
  */
65
65
  POST = "post",
66
+ /**
67
+ * 部门组件
68
+ */
69
+ DEPARTMENT = "department",
66
70
  GROUP_LAYOUT = "groupLayout",
67
71
  /**
68
72
  * 页签
@@ -133,3 +137,20 @@ export declare enum relevanceType {
133
137
  */
134
138
  autoCancel = "\u81EA\u52A8\u53D6\u6D88"
135
139
  }
140
+ /**
141
+ * @description: 事件类型
142
+ */
143
+ export declare enum eventTypeEnum {
144
+ /**
145
+ * 改变事件
146
+ */
147
+ Change = "change",
148
+ /**
149
+ * 点击事件
150
+ */
151
+ Click = "click",
152
+ /**
153
+ * 查询事件
154
+ */
155
+ Query = "query"
156
+ }
@@ -0,0 +1,34 @@
1
+ import { eventTypeEnum } from './enum';
2
+ /**
3
+ * @description: HTTP请求设置
4
+ */
5
+ export interface httpSettingView {
6
+ /**
7
+ * HTTP请求类型
8
+ */
9
+ eventType: eventTypeEnum;
10
+ /**
11
+ * HTTP基础URL
12
+ */
13
+ baseUrl: string;
14
+ /**
15
+ * HTTP函数URL
16
+ */
17
+ functionUrl: string;
18
+ /**
19
+ * HTTP请求方法
20
+ */
21
+ method?: "post" | "get";
22
+ /**
23
+ * HTTP请求参数
24
+ */
25
+ parameters?: Record<string, any>[];
26
+ /**
27
+ * 是否映射到组件实例
28
+ */
29
+ dataMappingSelf?: boolean;
30
+ /**
31
+ * HTTP数据映射
32
+ */
33
+ dataMappings?: Record<string, string>[];
34
+ }
@@ -0,0 +1,86 @@
1
+ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
2
+ jsonData: {
3
+ type: ObjectConstructor;
4
+ default: () => {};
5
+ };
6
+ deep: {
7
+ type: NumberConstructor;
8
+ default: number;
9
+ };
10
+ showLength: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ highlightSelected: {
15
+ type: BooleanConstructor;
16
+ default: boolean;
17
+ };
18
+ showLineNumber: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ showIcon: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
26
+ virtual: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ height: {
31
+ type: NumberConstructor;
32
+ default: number;
33
+ };
34
+ editable: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
39
+ jsonData: {
40
+ type: ObjectConstructor;
41
+ default: () => {};
42
+ };
43
+ deep: {
44
+ type: NumberConstructor;
45
+ default: number;
46
+ };
47
+ showLength: {
48
+ type: BooleanConstructor;
49
+ default: boolean;
50
+ };
51
+ highlightSelected: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
55
+ showLineNumber: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
59
+ showIcon: {
60
+ type: BooleanConstructor;
61
+ default: boolean;
62
+ };
63
+ virtual: {
64
+ type: BooleanConstructor;
65
+ default: boolean;
66
+ };
67
+ height: {
68
+ type: NumberConstructor;
69
+ default: number;
70
+ };
71
+ editable: {
72
+ type: BooleanConstructor;
73
+ default: boolean;
74
+ };
75
+ }>> & Readonly<{}>, {
76
+ height: number;
77
+ deep: number;
78
+ jsonData: Record<string, any>;
79
+ showLength: boolean;
80
+ highlightSelected: boolean;
81
+ showLineNumber: boolean;
82
+ showIcon: boolean;
83
+ virtual: boolean;
84
+ editable: boolean;
85
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
86
+ export default _default;
@@ -1,3 +1,4 @@
1
+ import { httpSettingView } from '../components/dynamicForm/types/httpSettingView';
1
2
  export declare function useUtils(): {
2
3
  /**
3
4
  * @description: 计算表达式,实现eval函数功能,解决使用eval时编译报错
@@ -79,4 +80,12 @@ export declare function useUtils(): {
79
80
  * value: localStorage的value
80
81
  */
81
82
  session(key: string, value?: any): any;
83
+ /**
84
+ * @description: 调用api
85
+ * @param httpSetting 接口配置
86
+ * @param datas 接口参数替换数据
87
+ * @param autoDealResult 是否自动处理结果
88
+ * @return
89
+ */
90
+ callApi(httpSetting: httpSettingView, datas: Record<string, any>, autoDealResult?: boolean): Promise<Record<string, any>>;
82
91
  };
@@ -2,6 +2,7 @@ import { MessageType, filterConditionTypes, componentType } from './types/enum';
2
2
  import { dynamicFilter as zhyDynamicFilter, conditionType, filterConditionPropType, filterConditionType, filterItemType, propOptionType } from './components/dynamicFilter/index';
3
3
  import { documentView, dynamicFormData, formAttribute, dictionaryData, dictionaryItem, uploadOption, batchAddComponentParam, getFormTemplateMethod, formListView, searchParam, formDesigner as zhyFormDesigner, formRenderer as zhyFormRenderer } from './components/dynamicForm/index';
4
4
  import { icon as zhyIcon } from './components/icon/index';
5
+ import { default as zhyJsonViewer } from './components/jsonViewer.vue';
5
6
  import { filePreview as zhyFilePreview, fileView, filePreviewOption, videoConfigType, pdfOptionType } from './components/filePreview/index';
6
7
  import { richTextEditor as zhyRichTextEditor, richTextConfigOption } from './components/richTextEditor/index';
7
8
  import { verificationCode as zhyVerificationCode, vcodeConfigOption } from './components/verificationCode/index';
@@ -16,7 +17,7 @@ type selectOptionsView = SelectOptionsView;
16
17
  export type { optionView, selectOptionsView, conditionType, filterConditionPropType, filterConditionType, filterItemType, propOptionType, dynamicFormData, formAttribute, dictionaryData, dictionaryItem, uploadOption, documentView, batchAddComponentParam, getFormTemplateMethod, formListView, searchParam, fileView, filePreviewOption, videoConfigType, pdfOptionType, richTextConfigOption, vcodeConfigOption };
17
18
  export { MessageType, filterConditionTypes, componentType };
18
19
  export { setTheme };
19
- export { zhyFormDesigner, zhyFormRenderer, zhyDynamicFilter, zhyIcon, zhyFilePreview, zhyRichTextEditor, zhyVerificationCode };
20
+ export { zhyFormDesigner, zhyFormRenderer, zhyDynamicFilter, zhyIcon, zhyFilePreview, zhyRichTextEditor, zhyVerificationCode, zhyJsonViewer };
20
21
  declare const _default: {
21
22
  install: (app: any, options?: Record<string, any>) => void;
22
23
  };
@@ -0,0 +1,6 @@
1
+ type EventType = {
2
+ [propName: string]: any;
3
+ };
4
+ declare const _default: import('mitt').Emitter<EventType>;
5
+ export default _default;
6
+ export declare const UPDATE_DYNAMIC_FORM_DATAS_EVENTS = "updateDynamicFormDatas";