zyf-model-engine 0.0.1 → 0.0.2
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/build/getEnv.d.ts +13 -0
- package/build/plugins.d.ts +7 -0
- package/build/proxy.d.ts +11 -0
- package/index.html +2 -100
- package/manifest.webmanifest +1 -0
- package/package.json +3 -94
- package/registerSW.js +1 -0
- package/src/api/config/servicePort.d.ts +2 -0
- package/src/api/enums/httpEnum.d.ts +29 -0
- package/src/api/helper/axiosCancel.d.ts +21 -0
- package/src/api/helper/axiosFileCancel.d.ts +27 -0
- package/src/api/helper/checkStatus.d.ts +6 -0
- package/src/api/index.d.ts +26 -0
- package/src/api/interface/index.d.ts +18 -0
- package/src/components/CTree/interface/index.d.ts +6 -0
- package/src/components/Grid/interface/index.d.ts +5 -0
- package/src/components/ProTable/interface/index.d.ts +66 -0
- package/src/config/index.d.ts +5 -0
- package/src/config/nprogress.d.ts +3 -0
- package/src/config/piniaPersist.d.ts +10 -0
- package/src/config/serviceLoading.d.ts +5 -0
- package/src/enums/httpEnum.d.ts +19 -0
- package/src/hooks/interface/index.d.ts +30 -0
- package/src/hooks/useOnline.d.ts +6 -0
- package/src/hooks/useTable.d.ts +47 -0
- package/src/main.d.ts +1 -0
- package/src/stores/commonStore.d.ts +2 -0
- package/src/stores/index.d.ts +2 -0
- package/src/stores/interface/index.d.ts +1 -0
- package/src/utils/color.d.ts +28 -0
- package/src/utils/commonUtils.d.ts +63 -0
- package/src/utils/errorHandler.d.ts +5 -0
- package/src/utils/is.d.ts +82 -0
- package/src/utils/layoutUtils.d.ts +44 -0
- package/src/utils/localUtils.d.ts +24 -0
- package/src/utils/serviceDict.d.ts +7 -0
- package/style.css +1 -0
- package/sw.js +1 -0
- package/vite.config.d.ts +2 -0
- package/workbox-3e911b1d.js +1 -0
- package/zyf-model-engine.mjs +45118 -0
- package/zyf-model-engine.umd.js +81 -0
- package/.editorconfig +0 -15
- package/.env +0 -13
- package/.env.development +0 -20
- package/.env.production +0 -25
- package/.env.test +0 -25
- package/.eslintignore +0 -15
- package/.eslintrc-auto-import.json +0 -65
- package/.eslintrc.cjs +0 -66
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -5
- package/.prettierignore +0 -9
- package/.prettierrc.cjs +0 -41
- package/.stylelintignore +0 -4
- package/.stylelintrc.cjs +0 -40
- package/.vscode/extensions.json +0 -14
- package/.vscode/settings.json +0 -92
- package/CHANGELOG.md +0 -246
- package/LICENSE +0 -21
- package/README.md +0 -205
- package/auto-imports.d.ts +0 -132
- package/build/getEnv.ts +0 -46
- package/build/plugins.ts +0 -138
- package/build/proxy.ts +0 -28
- package/commitlint.config.cjs +0 -84
- package/components.d.ts +0 -28
- package/lint-staged.config.cjs +0 -8
- package/postcss.config.cjs +0 -5
- package/src/App.vue +0 -16
- package/src/api/config/servicePort.ts +0 -3
- package/src/api/enums/httpEnum.ts +0 -35
- package/src/api/helper/axiosCancel.ts +0 -50
- package/src/api/helper/axiosFileCancel.ts +0 -62
- package/src/api/helper/checkStatus.ts +0 -97
- package/src/api/index.ts +0 -142
- package/src/api/interface/index.ts +0 -27
- package/src/assets/global-icons/icon-demo.svg +0 -1
- package/src/assets/iconfont/iconfont.scss +0 -44
- package/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/assets/images/empty-img.png +0 -0
- package/src/assets/option-icons/add.svg +0 -1
- package/src/assets/option-icons/check.svg +0 -1
- package/src/assets/option-icons/config.svg +0 -1
- package/src/assets/option-icons/del.svg +0 -1
- package/src/assets/option-icons/detail.svg +0 -1
- package/src/assets/option-icons/edit.svg +0 -2
- package/src/assets/option-icons/export.svg +0 -1
- package/src/assets/option-icons/folder.svg +0 -1
- package/src/assets/option-icons/full-screen.svg +0 -1
- package/src/assets/option-icons/more.svg +0 -1
- package/src/assets/option-icons/return.svg +0 -1
- package/src/assets/option-icons/search.svg +0 -1
- package/src/components/CSvgIcon/index.scss +0 -23
- package/src/components/CSvgIcon/index.vue +0 -74
- package/src/components/CTree/index.scss +0 -48
- package/src/components/CTree/index.vue +0 -176
- package/src/components/CTree/interface/index.ts +0 -6
- package/src/components/Dialog/index.scss +0 -74
- package/src/components/Dialog/index.vue +0 -87
- package/src/components/Empty/index.scss +0 -16
- package/src/components/Empty/index.vue +0 -43
- package/src/components/Grid/components/GridItem.vue +0 -68
- package/src/components/Grid/index.vue +0 -167
- package/src/components/Grid/interface/index.ts +0 -6
- package/src/components/Loading/index.scss +0 -67
- package/src/components/Loading/index.vue +0 -13
- package/src/components/Overflow/index.vue +0 -76
- package/src/components/ProTable/components/ColSetting.vue +0 -45
- package/src/components/ProTable/components/Pagination.vue +0 -29
- package/src/components/ProTable/components/SearchForm/components/SearchFormItem.vue +0 -93
- package/src/components/ProTable/components/SearchForm/index.scss +0 -12
- package/src/components/ProTable/components/SearchForm/index.vue +0 -91
- package/src/components/ProTable/components/TableColumn.vue +0 -56
- package/src/components/ProTable/index.scss +0 -14
- package/src/components/ProTable/index.vue +0 -274
- package/src/components/ProTable/interface/index.ts +0 -86
- package/src/components/ScrollBox/index.vue +0 -44
- package/src/components/SvgIcon/index.vue +0 -20
- package/src/components/Tabs/index.vue +0 -142
- package/src/config/index.ts +0 -12
- package/src/config/nprogress.ts +0 -12
- package/src/config/piniaPersist.ts +0 -19
- package/src/config/serviceLoading.ts +0 -45
- package/src/enums/httpEnum.ts +0 -24
- package/src/hooks/interface/index.ts +0 -32
- package/src/hooks/useOnline.ts +0 -27
- package/src/hooks/useTable.ts +0 -167
- package/src/main.ts +0 -35
- package/src/plugins/button/button.vue +0 -56
- package/src/plugins/index.js +0 -26
- package/src/plugins/index.vue +0 -24
- package/src/plugins/msg/msg.vue +0 -56
- package/src/stores/commonStore.ts +0 -9
- package/src/stores/index.ts +0 -8
- package/src/stores/interface/index.ts +0 -1
- package/src/styles/common.scss +0 -87
- package/src/styles/element.scss +0 -233
- package/src/styles/reset.scss +0 -20
- package/src/styles/var.scss +0 -2
- package/src/typings/global.d.ts +0 -37
- package/src/typings/window.d.ts +0 -8
- package/src/utils/color.ts +0 -59
- package/src/utils/commonUtils.ts +0 -175
- package/src/utils/errorHandler.ts +0 -28
- package/src/utils/is.ts +0 -147
- package/src/utils/layoutUtils.ts +0 -83
- package/src/utils/localUtils.ts +0 -42
- package/src/utils/serviceDict.ts +0 -9
- package/src/vite-env.d.ts +0 -6
- package/tsconfig.json +0 -50
- package/vite.config.ts +0 -76
- /package/{public/logo.png → logo.png} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 生成唯一 uuid
|
|
3
|
+
* @returns {String}
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateUUID(): string;
|
|
6
|
+
/**
|
|
7
|
+
* @description 深拷贝
|
|
8
|
+
*/
|
|
9
|
+
export declare const deepClone: (obj: {
|
|
10
|
+
[k: string]: any;
|
|
11
|
+
}) => {
|
|
12
|
+
[k: string]: any;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 防抖
|
|
16
|
+
* @param fn {Function}
|
|
17
|
+
* @param delay {number}
|
|
18
|
+
*/
|
|
19
|
+
export declare function debounce<T>(fn: T, delay: number): () => void;
|
|
20
|
+
/**
|
|
21
|
+
* @description 日期转换
|
|
22
|
+
* @param {string} value
|
|
23
|
+
* @param {string} format
|
|
24
|
+
* @returns {string}
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatDate(value: string, format?: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* @description 生成随机数
|
|
29
|
+
* @param {Number} min 最小值
|
|
30
|
+
* @param {Number} max 最大值
|
|
31
|
+
* @returns {Number}
|
|
32
|
+
*/
|
|
33
|
+
export declare function randomNum(min: number, max: number): number;
|
|
34
|
+
/**
|
|
35
|
+
* @description 为对象添加level层级
|
|
36
|
+
*/
|
|
37
|
+
export declare const addLevel: (arr: Record<string, any>[], level?: number, attribute?: string) => void;
|
|
38
|
+
export declare function deepTraverse(obj: Record<string, any>, callback: (key: string, value: any) => any): void;
|
|
39
|
+
/**
|
|
40
|
+
* @description 将objB与objA的交集赋值给objA
|
|
41
|
+
* @param {Object} objA 要比较的对象一
|
|
42
|
+
* @param {Object} objB 要比较的对象二
|
|
43
|
+
*/
|
|
44
|
+
export declare const listAssign: (objA: Record<string, any>, objB: Record<string, any>) => Record<string, any>;
|
|
45
|
+
/**
|
|
46
|
+
* 判断两个对象是否相同
|
|
47
|
+
* @param {Object} a 要比较的对象一
|
|
48
|
+
* @param {Object} b 要比较的对象二
|
|
49
|
+
* @returns {Boolean} 相同返回 true,反之 false
|
|
50
|
+
*/
|
|
51
|
+
export declare function isObjectValueEqual(a: {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}, b: {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @description 传入两个数组返回两个数组的交集 只能判断简单数据类型
|
|
58
|
+
*/
|
|
59
|
+
export declare function arrayIntersection(arr1: any[], arr2: any[]): any[];
|
|
60
|
+
/**
|
|
61
|
+
* @description 文字size适配
|
|
62
|
+
*/
|
|
63
|
+
export declare function formatFontSize(fontsize: number): string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 判断值是某个类型
|
|
3
|
+
*/
|
|
4
|
+
export declare function is(val: unknown, type: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* @description 判断数据类型
|
|
7
|
+
* @param {*} val 需要判断类型的数据
|
|
8
|
+
* @returns {String}
|
|
9
|
+
*/
|
|
10
|
+
export declare function isType(val: any): any;
|
|
11
|
+
/**
|
|
12
|
+
* @description: 是否为空
|
|
13
|
+
*/
|
|
14
|
+
export declare const isEmpty: (val: any) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @description: 是否为函数
|
|
17
|
+
*/
|
|
18
|
+
export declare function isFunction<T = Function>(val: unknown): val is T;
|
|
19
|
+
/**
|
|
20
|
+
* @description: 是否已定义
|
|
21
|
+
*/
|
|
22
|
+
export declare const isDef: <T = unknown>(val?: T) => val is T;
|
|
23
|
+
/**
|
|
24
|
+
* @description: 是否未定义
|
|
25
|
+
*/
|
|
26
|
+
export declare const isUnDef: <T = unknown>(val?: T) => val is T;
|
|
27
|
+
/**
|
|
28
|
+
* @description: 是否为对象
|
|
29
|
+
*/
|
|
30
|
+
export declare const isObject: (val: any) => val is Record<any, any>;
|
|
31
|
+
/**
|
|
32
|
+
* @description: 是否为时间
|
|
33
|
+
*/
|
|
34
|
+
export declare function isDate(val: unknown): val is Date;
|
|
35
|
+
/**
|
|
36
|
+
* @description: 是否为数值
|
|
37
|
+
*/
|
|
38
|
+
export declare function isNumber(val: unknown): val is number;
|
|
39
|
+
/**
|
|
40
|
+
* @description: 是否为AsyncFunction
|
|
41
|
+
*/
|
|
42
|
+
export declare function isAsyncFunction<T = any>(val: unknown): val is Promise<T>;
|
|
43
|
+
/**
|
|
44
|
+
* @description: 是否为promise
|
|
45
|
+
*/
|
|
46
|
+
export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
|
|
47
|
+
/**
|
|
48
|
+
* @description: 是否为字符串
|
|
49
|
+
*/
|
|
50
|
+
export declare function isString(val: unknown): val is string;
|
|
51
|
+
/**
|
|
52
|
+
* @description: 是否为boolean类型
|
|
53
|
+
*/
|
|
54
|
+
export declare function isBoolean(val: unknown): val is boolean;
|
|
55
|
+
/**
|
|
56
|
+
* @description: 是否为数组
|
|
57
|
+
*/
|
|
58
|
+
export declare function isArray(val: any): val is Array<any>;
|
|
59
|
+
/**
|
|
60
|
+
* @description: 是否客户端
|
|
61
|
+
*/
|
|
62
|
+
export declare const isClient: () => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* @description: 是否为浏览器
|
|
65
|
+
*/
|
|
66
|
+
export declare const isWindow: (val: any) => val is Window;
|
|
67
|
+
/**
|
|
68
|
+
* @description: 是否为 element 元素
|
|
69
|
+
*/
|
|
70
|
+
export declare const isElement: (val: unknown) => val is Element;
|
|
71
|
+
/**
|
|
72
|
+
* @description: 是否为 null
|
|
73
|
+
*/
|
|
74
|
+
export declare function isNull(val: unknown): val is null;
|
|
75
|
+
/**
|
|
76
|
+
* @description: 是否为 null || undefined
|
|
77
|
+
*/
|
|
78
|
+
export declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* @description: 是否为 16 进制颜色
|
|
81
|
+
*/
|
|
82
|
+
export declare const isHexColor: (str: string) => boolean;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FieldNamesProps } from '../components/ProTable/interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description 格式化表格单元格默认值 (el-table-column)
|
|
5
|
+
* @param {Number} row 行
|
|
6
|
+
* @param {Number} col 列
|
|
7
|
+
* @param {*} callValue 当前单元格值
|
|
8
|
+
* @returns {String}
|
|
9
|
+
* */
|
|
10
|
+
export declare function formatTableColumn(row: number, col: number, callValue: any): any;
|
|
11
|
+
/**
|
|
12
|
+
* @description 处理值无数据情况
|
|
13
|
+
* @param {*} callValue 需要处理的值
|
|
14
|
+
* @returns {String}
|
|
15
|
+
* */
|
|
16
|
+
export declare function formatValue(callValue: any): any;
|
|
17
|
+
/**
|
|
18
|
+
* @description 处理 prop 为多级嵌套的情况,返回的数据 (列如: prop: user.name)
|
|
19
|
+
* @param {Object} row 当前行数据
|
|
20
|
+
* @param {String} prop 当前 prop
|
|
21
|
+
* @returns {*}
|
|
22
|
+
* */
|
|
23
|
+
export declare function handleRowAccordingToProp(row: {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}, prop: string): any;
|
|
26
|
+
/**
|
|
27
|
+
* @description 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop
|
|
28
|
+
* @param {String} prop 当前 prop
|
|
29
|
+
* @returns {String}
|
|
30
|
+
* */
|
|
31
|
+
export declare function handleProp(prop: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* @description 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)
|
|
34
|
+
* @param {String} callValue 当前单元格值
|
|
35
|
+
* @param {Array} enumData 字典列表
|
|
36
|
+
* @param {Array} fieldNames label && value && children 的 key 值
|
|
37
|
+
* @param {String} type 过滤类型(目前只有 tag)
|
|
38
|
+
* @returns {String}
|
|
39
|
+
* */
|
|
40
|
+
export declare function filterEnum(callValue: any, enumData?: any, fieldNames?: FieldNamesProps, type?: "tag"): any;
|
|
41
|
+
/**
|
|
42
|
+
* @description 递归查找 callValue 对应的 enum 值
|
|
43
|
+
* */
|
|
44
|
+
export declare function findItemNested(enumData: any, callValue: any, value: string, children: string): any;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 获取localStorage
|
|
3
|
+
* @param {String} key Storage名称
|
|
4
|
+
* @returns {String}
|
|
5
|
+
*/
|
|
6
|
+
export declare function localGet(key: string): any;
|
|
7
|
+
/**
|
|
8
|
+
* @description 存储localStorage
|
|
9
|
+
* @param {String} key Storage名称
|
|
10
|
+
* @param {*} value Storage值
|
|
11
|
+
* @returns {void}
|
|
12
|
+
*/
|
|
13
|
+
export declare function localSet(key: string, value: any): void;
|
|
14
|
+
/**
|
|
15
|
+
* @description 清除localStorage
|
|
16
|
+
* @param {String} key Storage名称
|
|
17
|
+
* @returns {void}
|
|
18
|
+
*/
|
|
19
|
+
export declare function localRemove(key: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* @description 清除所有localStorage
|
|
22
|
+
* @returns {void}
|
|
23
|
+
*/
|
|
24
|
+
export declare function localClear(): void;
|