zhytech-ui 1.0.8 → 1.0.10
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.
- package/README.md +19 -10
- package/dist/src/components/dynamicFilter/index.d.ts +4 -0
- package/dist/src/components/dynamicForm/types/baseComponent.d.ts +67 -0
- package/dist/src/components/icon/index.d.ts +2 -0
- package/dist/src/components/icon/index.vue.d.ts +31 -0
- package/dist/src/index.d.ts +4 -3
- package/dist/src/types/enum.d.ts +6 -6
- package/dist/src/utils/message.d.ts +34 -0
- package/dist/style.css +1 -1
- package/dist/zhytech-ui.es.js +5605 -5599
- package/dist/zhytech-ui.umd.js +14 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
# zhytechUI
|
|
2
|
-
**介绍:一个基于Vue3 + ElementPlus + TypeScript封装的公司内部组件库**
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
> ### 简介
|
|
4
|
+
一个基于Vue3 + ElementPlus + TypeScript封装的公司内部组件库
|
|
5
|
+
|
|
6
|
+
> ### 组件列表
|
|
7
|
+
#### 1、dynamicForm
|
|
6
8
|
此组件为动态表单组件,目前包含基础组件:文本、输入框、单选框、复选框、评分、文件上传、图片上传;高级组件:分组面板、公司人员选择组件、公司岗位选择组件。
|
|
7
9
|
通过拖拽设计表单或试卷,以减少开发时间,此组件提供一个表单设计器和表单渲染器。
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
#### 2、dynamicFilter
|
|
10
12
|
此组件为动态条件组件,支持传入多组项目、支持不同项目自定义不同的条件,支持子条件,支持无限嵌套
|
|
11
13
|
|
|
12
|
-
### 使用说明
|
|
13
|
-
|
|
14
|
+
> ### 使用说明
|
|
15
|
+
#### 1、安装
|
|
14
16
|
```ts
|
|
15
17
|
npm i zhytech-ui -S
|
|
16
18
|
```
|
|
@@ -18,10 +20,10 @@ npm i zhytech-ui -S
|
|
|
18
20
|
```ts
|
|
19
21
|
npm i zhytech-ui@latest -S
|
|
20
22
|
```
|
|
21
|
-
|
|
23
|
+
#### 2、引入使用
|
|
22
24
|
1)、按需引入:在要使用的页面添加下面代码即可
|
|
23
25
|
```ts
|
|
24
|
-
import {
|
|
26
|
+
import { ZhyFormDesigner, ZhyFormRenderer } from "zhytech-ui"
|
|
25
27
|
```
|
|
26
28
|
2)、全局引入:在项目内任何页面都不需要单独引入
|
|
27
29
|
```ts
|
|
@@ -30,8 +32,15 @@ import "../node_modules/zhytech-ui/dist/style.css";
|
|
|
30
32
|
createApp(app).use(zhytechUI)
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
#### 2、使用组件
|
|
36
|
+
```html
|
|
37
|
+
<zhy-form-designer :formData="formData"></zhy-form-designer>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> #### 注意:
|
|
41
|
+
1)、此组件库提供的所有组件在使用时均需要添加**zhy**前缀,如:zhy-form-designer
|
|
34
42
|
|
|
43
|
+
2)、此组件css样式依赖scss开发,使用者项目还需要添加scss依赖。
|
|
35
44
|
|
|
36
45
|
> #### 后续计划:
|
|
37
|
-
|
|
46
|
+
此组件库目前还处于雏形,后续会继续添加组件
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
type conditionType = keyof typeof filterConditionTypes;
|
|
2
|
+
export default class baseComponent {
|
|
3
|
+
/**
|
|
4
|
+
* @description: 是否为编辑类组件
|
|
5
|
+
*/
|
|
6
|
+
isEdit: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @description: 是否为输入型编辑类组件
|
|
9
|
+
*/
|
|
10
|
+
isInput: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @description: 类型
|
|
13
|
+
*/
|
|
14
|
+
type: string;
|
|
15
|
+
/**
|
|
16
|
+
* @description: 名称
|
|
17
|
+
*/
|
|
18
|
+
name: string;
|
|
19
|
+
/**
|
|
20
|
+
* @description: 组件唯一标识
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* @description: 业务字典项目编号
|
|
25
|
+
*/
|
|
26
|
+
itemID?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @description: 业务字典项目来源
|
|
29
|
+
*/
|
|
30
|
+
itemSourceType?: string;
|
|
31
|
+
/**
|
|
32
|
+
* @description: 组件校验条件
|
|
33
|
+
*/
|
|
34
|
+
rules: Record<string, any>[];
|
|
35
|
+
/**
|
|
36
|
+
* @description: 组件属性
|
|
37
|
+
*/
|
|
38
|
+
props: Record<string, any>;
|
|
39
|
+
/**
|
|
40
|
+
* @description: 组件要排除的过滤条件集合
|
|
41
|
+
* 参数说明:EQUALS:等于; NOT_EQUALS:不等于; GREATER_THAN:大于; LESS_THAN:小于;
|
|
42
|
+
* GREATER_THAN_OR_EQUALS:大于等于; LESS_THAN_OR_EQUALS:小于等于;
|
|
43
|
+
* EMPTY:为空; INCLUDES:包含; EXCLUDE:不包含; RANGE:范围
|
|
44
|
+
*/
|
|
45
|
+
excludeFilterConditions: conditionType[];
|
|
46
|
+
/**
|
|
47
|
+
* @description: 组件过滤参数
|
|
48
|
+
*/
|
|
49
|
+
filterConditionProps: Record<string, any> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* @description: 是否为布局组件
|
|
52
|
+
*/
|
|
53
|
+
isLayout: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @description:布局组件的子组件集合
|
|
56
|
+
*/
|
|
57
|
+
children: Record<string, any>[] | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* @description: 构造器
|
|
60
|
+
* @param type 组件类型
|
|
61
|
+
* @param name 组件名称
|
|
62
|
+
* @param isEdit 是否为编辑类组件,默认为false
|
|
63
|
+
* @param isInput 是否为输入型编辑类组件,默认为false
|
|
64
|
+
*/
|
|
65
|
+
constructor(type: string, name: string, isEdit?: boolean, isInput?: boolean);
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
|
2
|
+
name: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
size: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
color: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
15
|
+
name: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
color: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
}>>, {
|
|
28
|
+
color: string;
|
|
29
|
+
size: string;
|
|
30
|
+
}, {}>;
|
|
31
|
+
export default _default;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { conditionType, dynamicFilter } from './components/dynamicFilter/index';
|
|
2
|
-
import { batchAddComponentParam, documentView, dynamicFormData, formAttribute, GetFormTemplateMethod, uploadOption, formDesigner, formRenderer } from './components/dynamicForm/index';
|
|
1
|
+
import { conditionType, dynamicFilter as ZhyDynamicFilter } from './components/dynamicFilter/index';
|
|
2
|
+
import { batchAddComponentParam, documentView, dynamicFormData, formAttribute, GetFormTemplateMethod, uploadOption, formDesigner as ZhyFormDesigner, formRenderer as ZhyFormRenderer } from './components/dynamicForm/index';
|
|
3
|
+
import { icon as ZhyIcon } from './components/icon/index';
|
|
3
4
|
export type { conditionType, dynamicFormData, formAttribute, uploadOption, documentView, batchAddComponentParam, GetFormTemplateMethod };
|
|
4
|
-
export {
|
|
5
|
+
export { ZhyIcon, ZhyFormDesigner, ZhyFormRenderer, ZhyDynamicFilter };
|
|
5
6
|
declare const _default: {
|
|
6
7
|
install: (app: any, options?: Record<string, any> | undefined) => void;
|
|
7
8
|
};
|
package/dist/src/types/enum.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 消息类型
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
declare enum MessageType {
|
|
5
5
|
/**
|
|
6
6
|
* 成功消息
|
|
7
7
|
*/
|
|
8
|
-
success
|
|
8
|
+
success,
|
|
9
9
|
/**
|
|
10
10
|
* 警告消息
|
|
11
11
|
*/
|
|
12
|
-
warning
|
|
12
|
+
warning,
|
|
13
13
|
/**
|
|
14
14
|
* 错误消息
|
|
15
15
|
*/
|
|
16
|
-
error
|
|
16
|
+
error,
|
|
17
17
|
/**
|
|
18
18
|
* 普通消息
|
|
19
19
|
*/
|
|
20
|
-
info
|
|
20
|
+
info
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* 过滤条件组件类型
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
declare enum filterConditionTypes {
|
|
26
26
|
/**
|
|
27
27
|
* 等于=
|
|
28
28
|
*/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type MType = keyof typeof MessageType;
|
|
2
|
+
/**
|
|
3
|
+
* @description: 提示信息
|
|
4
|
+
* @param type 类型
|
|
5
|
+
* @param message 消息内容
|
|
6
|
+
* @return
|
|
7
|
+
*/
|
|
8
|
+
export declare const showMessage: (type: MType, message: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* @description: 弹窗
|
|
11
|
+
* @param type 类型
|
|
12
|
+
* @param message 消息内容
|
|
13
|
+
* @param title 消息标题
|
|
14
|
+
* @param btnName 按钮显示文字
|
|
15
|
+
* @return
|
|
16
|
+
*/
|
|
17
|
+
export declare const showAlert: (type: MType, message: string, title?: string, btnName?: string) => Promise<import('element-plus').MessageBoxData>;
|
|
18
|
+
/**
|
|
19
|
+
* @description: 确认弹窗
|
|
20
|
+
* @param message 消息内容
|
|
21
|
+
* @param title 消息标题
|
|
22
|
+
* @param callback 回调函数
|
|
23
|
+
* @param btnName 按钮显示文字
|
|
24
|
+
* @return
|
|
25
|
+
*/
|
|
26
|
+
export declare const confirmBox: (message: string, title: string, callback?: Function, btnName?: string) => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* @description: 删除确认框
|
|
29
|
+
* @param message 消息内容
|
|
30
|
+
* @param callback 回调韩式
|
|
31
|
+
* @return
|
|
32
|
+
*/
|
|
33
|
+
export declare const deleteConfirm: (message: string, callback: Function) => Promise<void>;
|
|
34
|
+
export {};
|