zhytech-ui-mobile 1.0.2 → 1.0.3
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/dist/build/h5/style.css +1 -0
- package/dist/build/h5/zhytech-ui-mobile.es.js +19690 -0
- package/dist/build/h5/zhytech-ui-mobile.umd.js +6 -0
- package/package.json +6 -1
- package/.eslintignore +0 -11
- package/.eslintrc.cjs +0 -253
- package/.prettierignore +0 -0
- package/.prettierrc.json +0 -9
- package/.vscode/settings.json +0 -131
- package/index.html +0 -39
- package/shims-uni.d.ts +0 -7
- package/src/App.vue +0 -24
- package/src/components/dynamicForm/componentRenderer.vue +0 -207
- package/src/components/dynamicForm/components/advanced/index.ts +0 -13
- package/src/components/dynamicForm/components/advanced/upload.vue +0 -108
- package/src/components/dynamicForm/components/advanced/uploadImage.vue +0 -107
- package/src/components/dynamicForm/components/answerSheetPopup/answerSheetItem.vue +0 -58
- package/src/components/dynamicForm/components/answerSheetPopup/index.vue +0 -111
- package/src/components/dynamicForm/components/application/employee.vue +0 -140
- package/src/components/dynamicForm/components/application/grade.vue +0 -183
- package/src/components/dynamicForm/components/application/index.ts +0 -14
- package/src/components/dynamicForm/components/application/post.vue +0 -136
- package/src/components/dynamicForm/components/base/checkbox.vue +0 -143
- package/src/components/dynamicForm/components/base/index.ts +0 -15
- package/src/components/dynamicForm/components/base/input.vue +0 -99
- package/src/components/dynamicForm/components/base/label.vue +0 -29
- package/src/components/dynamicForm/components/base/radio.vue +0 -155
- package/src/components/dynamicForm/components/componentType.ts +0 -16
- package/src/components/dynamicForm/components/layout/groupLayout.vue +0 -103
- package/src/components/dynamicForm/components/layout/index.ts +0 -12
- package/src/components/dynamicForm/formRenderer.vue +0 -567
- package/src/components/dynamicForm/index.ts +0 -21
- package/src/components/dynamicForm/types/componentAttribute/advanced/uploadAttribute.ts +0 -35
- package/src/components/dynamicForm/types/componentAttribute/application/employeeAttribute.ts +0 -42
- package/src/components/dynamicForm/types/componentAttribute/application/gradeAttribute.ts +0 -54
- package/src/components/dynamicForm/types/componentAttribute/application/postAttribute.ts +0 -42
- package/src/components/dynamicForm/types/componentAttribute/base/checkboxAttribute.ts +0 -38
- package/src/components/dynamicForm/types/componentAttribute/base/inputAttribute.ts +0 -31
- package/src/components/dynamicForm/types/componentAttribute/base/radioAttribute.ts +0 -30
- package/src/components/dynamicForm/types/componentAttribute/baseAttribute.ts +0 -110
- package/src/components/dynamicForm/types/componentAttribute/editAttribute.ts +0 -70
- package/src/components/dynamicForm/types/componentAttribute/index.ts +0 -37
- package/src/components/dynamicForm/types/componentAttribute/layout/groupLayoutAttribute.ts +0 -39
- package/src/components/dynamicForm/types/documentView.ts +0 -110
- package/src/components/dynamicForm/types/enum.ts +0 -109
- package/src/components/dynamicForm/types/formAttribute.ts +0 -93
- package/src/components/dynamicForm/types/uploadOption.ts +0 -31
- package/src/env.d.ts +0 -8
- package/src/hooks/useMessage.ts +0 -44
- package/src/hooks/useToast.ts +0 -29
- package/src/hooks/useUtils.ts +0 -201
- package/src/index.ts +0 -59
- package/src/main.ts +0 -19
- package/src/manifest.json +0 -72
- package/src/pages/dynamicFormDemo.vue +0 -1260
- package/src/pages/dynamicFormExaminationDemo.vue +0 -567
- package/src/pages.json +0 -58
- package/src/shime-uni.d.ts +0 -6
- package/src/uni.scss +0 -76
- package/src/unocss/index.ts +0 -20
- package/src/unocss/rules.ts +0 -139
- package/src/unocss/shortcuts.ts +0 -53
- package/src/unocss/theme/index.ts +0 -13
- package/src/unocss/theme/themeOption/dark.ts +0 -35
- package/src/unocss/theme/themeOption/primary.ts +0 -33
- package/src/unocss/variants.ts +0 -110
- package/tsconfig.json +0 -19
- package/uno.config.ts +0 -63
- package/vite.config.ts +0 -83
- /package/{src → dist/build/h5}/static/iconfont/iconfont.css +0 -0
- /package/{src → dist/build/h5}/static/iconfont/iconfont.ttf +0 -0
- /package/{src → dist/build/h5}/static/iconfont/iconfont.woff +0 -0
- /package/{src → dist/build/h5}/static/iconfont/iconfont.woff2 +0 -0
- /package/{src → dist/build/h5}/static/scss/actionSheet.scss +0 -0
- /package/{src → dist/build/h5}/static/scss/button.scss +0 -0
- /package/{src → dist/build/h5}/static/scss/checkbox.scss +0 -0
- /package/{src → dist/build/h5}/static/scss/form.scss +0 -0
- /package/{src → dist/build/h5}/static/scss/index.scss +0 -0
- /package/{src → dist/build/h5}/static/scss/input.scss +0 -0
- /package/{src → dist/build/h5}/static/scss/picker.scss +0 -0
- /package/{src → dist/build/h5}/static/scss/radio.scss +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* FilePath : \src\components\dynamicForm\types\formAttribute.ts
|
|
3
|
-
* Author : 苏军志
|
|
4
|
-
* Date : 2024-03-04 16:55
|
|
5
|
-
* LastEditors : 苏军志
|
|
6
|
-
* LastEditTime : 2025-04-07 15:40
|
|
7
|
-
* Description : 表单相关类型
|
|
8
|
-
* CodeIterationRecord:
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @description: 动态表单属性类型
|
|
12
|
-
*/
|
|
13
|
-
export interface formAttribute {
|
|
14
|
-
/**
|
|
15
|
-
* 表单ID
|
|
16
|
-
*/
|
|
17
|
-
formID?: string;
|
|
18
|
-
/**
|
|
19
|
-
* 表单名称
|
|
20
|
-
*/
|
|
21
|
-
formName: string;
|
|
22
|
-
/**
|
|
23
|
-
* 表单类型 1:问卷表单;2:试卷表单
|
|
24
|
-
*/
|
|
25
|
-
formType: string;
|
|
26
|
-
/**
|
|
27
|
-
* 标题位置
|
|
28
|
-
*/
|
|
29
|
-
labelPosition: string;
|
|
30
|
-
/**
|
|
31
|
-
* 标题宽度
|
|
32
|
-
*/
|
|
33
|
-
labelWidth: number;
|
|
34
|
-
/**
|
|
35
|
-
* 大小
|
|
36
|
-
*/
|
|
37
|
-
size: string;
|
|
38
|
-
/**
|
|
39
|
-
* 栅格数量
|
|
40
|
-
*/
|
|
41
|
-
column: number;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* @description: 动态表单数据参数类型
|
|
45
|
-
*/
|
|
46
|
-
export interface dynamicFormData<T extends formAttribute | Record<string, any>> {
|
|
47
|
-
/**
|
|
48
|
-
* 表单属性
|
|
49
|
-
*/
|
|
50
|
-
props: T;
|
|
51
|
-
/**
|
|
52
|
-
* 表单中组件集合
|
|
53
|
-
*/
|
|
54
|
-
components: Record<string, any>[];
|
|
55
|
-
/**
|
|
56
|
-
* 表单数据
|
|
57
|
-
*/
|
|
58
|
-
datas: Record<string, any>;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* @description: 动态表单字典表参数类型
|
|
62
|
-
*/
|
|
63
|
-
export interface dictionaryItem {
|
|
64
|
-
/**
|
|
65
|
-
* 字典项目ID
|
|
66
|
-
*/
|
|
67
|
-
value: string;
|
|
68
|
-
/**
|
|
69
|
-
* 字典项目名称
|
|
70
|
-
*/
|
|
71
|
-
label: string;
|
|
72
|
-
/**
|
|
73
|
-
* 字典项目来源
|
|
74
|
-
*/
|
|
75
|
-
itemSourceType?: string;
|
|
76
|
-
/**
|
|
77
|
-
* 字典项目来源
|
|
78
|
-
*/
|
|
79
|
-
itemSourceTypeName?: string;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* @description: 动态表单字典表参数类型
|
|
83
|
-
*/
|
|
84
|
-
export interface dictionaryData {
|
|
85
|
-
/**
|
|
86
|
-
* 字典项目集合
|
|
87
|
-
*/
|
|
88
|
-
dictionaryItems: dictionaryItem[];
|
|
89
|
-
/**
|
|
90
|
-
* 字典项目来源映射map
|
|
91
|
-
*/
|
|
92
|
-
sourceTypeMap: Map<string, string>;
|
|
93
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* FilePath : \src\components\dynamicForm\types\uploadOption.ts
|
|
3
|
-
* Author : 苏军志
|
|
4
|
-
* Date : 2024-06-14 17:30
|
|
5
|
-
* LastEditors : 苏军志
|
|
6
|
-
* LastEditTime : 2025-08-26 15:04
|
|
7
|
-
* Description : 上传文件参数
|
|
8
|
-
* CodeIterationRecord:
|
|
9
|
-
*/
|
|
10
|
-
import type { documentView } from "./documentView";
|
|
11
|
-
/**
|
|
12
|
-
* @description: 上传文件参数
|
|
13
|
-
*/
|
|
14
|
-
export interface uploadOption {
|
|
15
|
-
/**
|
|
16
|
-
* 上传文件api接口
|
|
17
|
-
*/
|
|
18
|
-
serverApi: string;
|
|
19
|
-
/**
|
|
20
|
-
* 上传文件的请求头部
|
|
21
|
-
*/
|
|
22
|
-
headers?: Record<string, any>;
|
|
23
|
-
/**
|
|
24
|
-
* 是否自动上传
|
|
25
|
-
*/
|
|
26
|
-
autoUpload: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 上传文件时附加参数,如果autoUpload=true,必须传此参数
|
|
29
|
-
*/
|
|
30
|
-
params?: documentView;
|
|
31
|
-
}
|
package/src/env.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
|
|
3
|
-
declare module "*.vue" {
|
|
4
|
-
import { DefineComponent } from "vue";
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
6
|
-
const component: DefineComponent<{}, {}, any>;
|
|
7
|
-
export default component;
|
|
8
|
-
}
|
package/src/hooks/useMessage.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* FilePath : \src\hooks\useMessage.ts
|
|
3
|
-
* Author : 苏军志
|
|
4
|
-
* Date : 2025-08-26 16:24
|
|
5
|
-
* LastEditors : 苏军志
|
|
6
|
-
* LastEditTime : 2025-08-26 18:29
|
|
7
|
-
* Description : 弹窗提示
|
|
8
|
-
* CodeIterationRecord:
|
|
9
|
-
*/
|
|
10
|
-
import { useMessage as useMessageUtils } from "wot-design-uni";
|
|
11
|
-
|
|
12
|
-
export function useMessage() {
|
|
13
|
-
const message = useMessageUtils();
|
|
14
|
-
return {
|
|
15
|
-
/**
|
|
16
|
-
* @description: 显示提示信息
|
|
17
|
-
* @param messageContent 消息内容
|
|
18
|
-
* @return
|
|
19
|
-
*/
|
|
20
|
-
alert(messageContent: string) {
|
|
21
|
-
message.alert(messageContent);
|
|
22
|
-
},
|
|
23
|
-
/**
|
|
24
|
-
* @description: 显示确认信息
|
|
25
|
-
* @param messageContent 消息内容
|
|
26
|
-
* @param title 标题
|
|
27
|
-
* @param callback 回调方法
|
|
28
|
-
* @return
|
|
29
|
-
*/
|
|
30
|
-
confirm(messageContent: string, title: string, callback?: Function) {
|
|
31
|
-
message
|
|
32
|
-
.confirm({
|
|
33
|
-
msg: messageContent,
|
|
34
|
-
title: title
|
|
35
|
-
})
|
|
36
|
-
.then(() => {
|
|
37
|
-
return callback?.(true);
|
|
38
|
-
})
|
|
39
|
-
.catch(() => {
|
|
40
|
-
return callback?.(false);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
package/src/hooks/useToast.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* FilePath : \src\hooks\useToast.ts
|
|
3
|
-
* Author : 苏军志
|
|
4
|
-
* Date : 2025-08-26 16:24
|
|
5
|
-
* LastEditors : 苏军志
|
|
6
|
-
* LastEditTime : 2025-08-26 17:28
|
|
7
|
-
* Description : 消息提示
|
|
8
|
-
* CodeIterationRecord:
|
|
9
|
-
*/
|
|
10
|
-
import { useToast as useToastUtils } from "wot-design-uni";
|
|
11
|
-
|
|
12
|
-
export function useToast() {
|
|
13
|
-
const toast = useToastUtils();
|
|
14
|
-
return {
|
|
15
|
-
/**
|
|
16
|
-
* @description: 显示提示信息
|
|
17
|
-
* @param type 信息类型,可选值:success、error、warning、info
|
|
18
|
-
* @param messageContent 消息内容
|
|
19
|
-
* @param position 位置
|
|
20
|
-
* @return
|
|
21
|
-
*/
|
|
22
|
-
showToast(type: string, messageContent: string, position: string = "bottom") {
|
|
23
|
-
(toast as any)[type]({
|
|
24
|
-
msg: messageContent,
|
|
25
|
-
position: position
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
package/src/hooks/useUtils.ts
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* FilePath : \src\hooks\useUtils.ts
|
|
3
|
-
* Author : 苏军志
|
|
4
|
-
* Date : 2024-04-19 17:52
|
|
5
|
-
* LastEditors : 苏军志
|
|
6
|
-
* LastEditTime : 2025-08-26 17:25
|
|
7
|
-
* Description : 工具Hooks
|
|
8
|
-
* CodeIterationRecord:
|
|
9
|
-
*/
|
|
10
|
-
import { useToast } from "./useToast";
|
|
11
|
-
export function useUtils() {
|
|
12
|
-
const { showToast } = useToast();
|
|
13
|
-
/**
|
|
14
|
-
* @description: 判断参数是否为空
|
|
15
|
-
* @param T param
|
|
16
|
-
* @return
|
|
17
|
-
*/
|
|
18
|
-
const isEmpty = <T>(param: T) => {
|
|
19
|
-
if (param instanceof Array) {
|
|
20
|
-
return !param || param.length === 0;
|
|
21
|
-
}
|
|
22
|
-
if (param instanceof Object) {
|
|
23
|
-
return !param || Object.keys(param).length === 0;
|
|
24
|
-
}
|
|
25
|
-
if (typeof param === "boolean" || param instanceof Boolean) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
return !param && param !== 0;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* @description: 计算表达式,实现eval函数功能,解决使用eval时编译报错
|
|
32
|
-
* @param expression
|
|
33
|
-
* @return
|
|
34
|
-
*/
|
|
35
|
-
const computedExpression = (expression: string) => {
|
|
36
|
-
// 一个变量指向Function,防止有些前端编译工具报错
|
|
37
|
-
let fun = Function;
|
|
38
|
-
return new fun("return " + expression)();
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* @description: 判断是否是原始类型
|
|
42
|
-
* @param obj 对象
|
|
43
|
-
* @returns
|
|
44
|
-
*/
|
|
45
|
-
const isPrimitive = (obj: any) => {
|
|
46
|
-
return (typeof obj !== "object" && typeof obj !== "function") || obj === null;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* 将JavaScript对象转换为FormData对象,以便可以通过HTTP请求发送。
|
|
50
|
-
* @param {Object} objectToConvert - 要转换的JavaScript对象。
|
|
51
|
-
* @param {string} [rootName] - 在生成的FormData对象中,objectToConvert对象的属性的基础名称。
|
|
52
|
-
* @param {FormData} [existingFormData] - 可选的FormData对象,如果提供,将在此对象上添加新的字段。
|
|
53
|
-
* @returns {FormData} - 包含objectToConvert对象属性的FormData对象。
|
|
54
|
-
*/
|
|
55
|
-
const convertObjectToFormData = (objectToConvert: any, rootName?: string, existingFormData?: FormData) => {
|
|
56
|
-
let formData = existingFormData || new FormData();
|
|
57
|
-
if (rootName && isPrimitive(objectToConvert)) {
|
|
58
|
-
objectToConvert && formData.append(rootName, objectToConvert);
|
|
59
|
-
return formData;
|
|
60
|
-
}
|
|
61
|
-
for (let property in objectToConvert) {
|
|
62
|
-
if (!Object.prototype.hasOwnProperty.call(objectToConvert, property)) {
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
let formKey = rootName ? `${rootName}[${property}]` : property;
|
|
66
|
-
// 如果属性是一个File对象,直接添加到FormData
|
|
67
|
-
if (objectToConvert[property] instanceof File) {
|
|
68
|
-
formData.append(`${rootName}.${property}`, objectToConvert[property]);
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
// 如果属性是一个数组
|
|
72
|
-
if (Array.isArray(objectToConvert[property])) {
|
|
73
|
-
// 如果数组中的所有元素都是File对象,直接添加到FormData
|
|
74
|
-
if (objectToConvert[property].every((item: any) => item instanceof File)) {
|
|
75
|
-
objectToConvert[property].forEach((item: File) => {
|
|
76
|
-
formData.append(`${rootName}.${property}`, item);
|
|
77
|
-
});
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
// 否则,对数组中的每个元素进行递归处理
|
|
81
|
-
objectToConvert[property].forEach((item: any, index: number) => {
|
|
82
|
-
let arrayFormKey = `${formKey}[${index}]`;
|
|
83
|
-
convertObjectToFormData(item, arrayFormKey, formData);
|
|
84
|
-
});
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
// 如果属性是一个对象,进行递归处理
|
|
88
|
-
if (typeof objectToConvert[property] === "object") {
|
|
89
|
-
convertObjectToFormData(objectToConvert[property], formKey, formData);
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
// 如果属性是一个基本类型(如字符串、数字等),直接添加到FormData
|
|
93
|
-
objectToConvert[property] && formData.append(formKey, objectToConvert[property]);
|
|
94
|
-
}
|
|
95
|
-
return formData;
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* @description: 文件大小
|
|
99
|
-
*/
|
|
100
|
-
const maxSizeOptions: Record<string, Function> = {
|
|
101
|
-
kb: (size: number) => 1024 * size,
|
|
102
|
-
mb: (size: number) => 1024 * 1024 * size,
|
|
103
|
-
gb: (size: number) => 1024 * 1024 * 1024 * size
|
|
104
|
-
};
|
|
105
|
-
return {
|
|
106
|
-
/**
|
|
107
|
-
* @description: 判断是否是微信浏览器打开
|
|
108
|
-
* @return
|
|
109
|
-
*/
|
|
110
|
-
isWechatBrowser() {
|
|
111
|
-
if (!navigator?.userAgent) {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
const userAgent: string = navigator.userAgent.toLowerCase();
|
|
115
|
-
return userAgent.indexOf("micromessenger") !== -1;
|
|
116
|
-
},
|
|
117
|
-
/**
|
|
118
|
-
* @description: 计算表达式,实现eval函数功能,解决使用eval时编译报错
|
|
119
|
-
* @param expression
|
|
120
|
-
* @return
|
|
121
|
-
*/
|
|
122
|
-
computedExpression,
|
|
123
|
-
/**
|
|
124
|
-
* @description: 判断参数是否为空
|
|
125
|
-
* @param T param
|
|
126
|
-
* @return
|
|
127
|
-
*/
|
|
128
|
-
isEmpty,
|
|
129
|
-
/**
|
|
130
|
-
* @description: 判断参数是否为空
|
|
131
|
-
* @param T obj
|
|
132
|
-
* @param reserveEmptyArray 是否保留空数组,默认不保留
|
|
133
|
-
* @return
|
|
134
|
-
*/
|
|
135
|
-
removeEmptyAttribute(obj: Object, reserveEmptyArray?: boolean): Object {
|
|
136
|
-
return Object.entries(obj).reduce((acc: any, [key, value]) => {
|
|
137
|
-
const empty = isEmpty(value);
|
|
138
|
-
if (!empty || (empty && reserveEmptyArray && value instanceof Array)) {
|
|
139
|
-
acc[key] = value;
|
|
140
|
-
}
|
|
141
|
-
return acc;
|
|
142
|
-
}, {} as Object);
|
|
143
|
-
},
|
|
144
|
-
/**
|
|
145
|
-
* 将JavaScript对象转换为FormData对象,以便可以通过HTTP请求发送。
|
|
146
|
-
* @param {Object} objectToConvert - 要转换的JavaScript对象。
|
|
147
|
-
* @param {string} [rootName] - 在生成的FormData对象中,objectToConvert对象的属性的基础名称。
|
|
148
|
-
* @param {FormData} [existingFormData] - 可选的FormData对象,如果提供,将在此对象上添加新的字段。
|
|
149
|
-
* @returns {FormData} - 包含objectToConvert对象属性的FormData对象。
|
|
150
|
-
*/
|
|
151
|
-
convertObjectToFormData,
|
|
152
|
-
/**
|
|
153
|
-
* @description: 检查上传的文件是否合法
|
|
154
|
-
* @param file 要上传的文件
|
|
155
|
-
* @param files 已上传的文件
|
|
156
|
-
* @param size 文件限制大小
|
|
157
|
-
* @param unit 文件限制大小的单位
|
|
158
|
-
* @param isImage 是否为图片
|
|
159
|
-
* @return
|
|
160
|
-
*/
|
|
161
|
-
checkFile(file: any, files: [], size: number, unit: string, isImage: boolean) {
|
|
162
|
-
const fileSize = file.size;
|
|
163
|
-
const fileType = isImage ? "图片" : "文件";
|
|
164
|
-
if (!fileSize) {
|
|
165
|
-
// console.log(`无效${fileType},请重新选择!`);
|
|
166
|
-
showToast("error", `无效${fileType},请重新选择!`);
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
if (isImage && file.type.indexOf("image") === -1) {
|
|
170
|
-
// console.log("不是有效的图片文件或图片格式不支持,请重新选择!");
|
|
171
|
-
showToast("error", "不是有效的图片文件或图片格式不支持,请重新选择!");
|
|
172
|
-
return false;
|
|
173
|
-
}
|
|
174
|
-
const maxSize: number = maxSizeOptions[unit.toLowerCase()](size);
|
|
175
|
-
if (fileSize > maxSize) {
|
|
176
|
-
// 图片大小
|
|
177
|
-
// console.log(`最大可以上传${size}${unit}的${fileType},请重新选择!`);
|
|
178
|
-
showToast("error", `最大可以上传${size}${unit}的${fileType},请重新选择!`);
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
const index = files.findIndex((tempFile: Record<string, string>) => tempFile.name === file.name);
|
|
182
|
-
if (index !== -1) {
|
|
183
|
-
// console.log(`${fileType}重复,请重新选择!`);
|
|
184
|
-
showToast("error", `${fileType}重复,请重新选择!`);
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
return true;
|
|
188
|
-
},
|
|
189
|
-
/**
|
|
190
|
-
* @description: 将对象格式化为页面跳转参数字符串
|
|
191
|
-
* @param params
|
|
192
|
-
* @param any
|
|
193
|
-
* @return
|
|
194
|
-
*/
|
|
195
|
-
toQueryParams(params: Record<string, any>) {
|
|
196
|
-
return Object.keys(params)
|
|
197
|
-
.map((key) => `${key}=${params[key] ?? ""}`)
|
|
198
|
-
.join("&");
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* FilePath : \src\index.ts
|
|
3
|
-
* Author : 苏军志
|
|
4
|
-
* Date : 2024-08-24 18:50
|
|
5
|
-
* LastEditors : 苏军志
|
|
6
|
-
* LastEditTime : 2025-09-05 12:04
|
|
7
|
-
* Description : 组件库导出
|
|
8
|
-
* CodeIterationRecord:
|
|
9
|
-
*/
|
|
10
|
-
// eslint-disable-next-line id-match
|
|
11
|
-
import type { ConfigProviderThemeVars } from "wot-design-uni";
|
|
12
|
-
import "virtual:uno.css";
|
|
13
|
-
|
|
14
|
-
//#region --------------------导入组件及类型
|
|
15
|
-
import type {
|
|
16
|
-
dynamicFormData,
|
|
17
|
-
formAttribute,
|
|
18
|
-
dictionaryData,
|
|
19
|
-
dictionaryItem,
|
|
20
|
-
uploadOption,
|
|
21
|
-
documentView
|
|
22
|
-
} from "./components/dynamicForm/index";
|
|
23
|
-
import { formRenderer as zhyFormRenderer } from "./components/dynamicForm/index";
|
|
24
|
-
//#endregion
|
|
25
|
-
|
|
26
|
-
// #region --------------------导出组件、类型及方法
|
|
27
|
-
// 导出组件类型
|
|
28
|
-
export type { dynamicFormData, formAttribute, dictionaryData, dictionaryItem, uploadOption, documentView };
|
|
29
|
-
// 导出方法
|
|
30
|
-
// eslint-disable-next-line id-match
|
|
31
|
-
const setTheme = (options: ConfigProviderThemeVars) => (theme.value = { ...theme.value, ...options });
|
|
32
|
-
export { setTheme };
|
|
33
|
-
// 导出组件,实现按需引入
|
|
34
|
-
export { zhyFormRenderer };
|
|
35
|
-
// #region --------------------定义全局安装方法
|
|
36
|
-
const theme = ref<ConfigProviderThemeVars>({
|
|
37
|
-
// 主题色
|
|
38
|
-
colorTheme: "#4d80f0",
|
|
39
|
-
// 成功色
|
|
40
|
-
colorSuccess: "#34d19d",
|
|
41
|
-
// 警告色
|
|
42
|
-
colorWarning: "#f0883a",
|
|
43
|
-
// 危险出错色
|
|
44
|
-
colorDanger: "#fa4350"
|
|
45
|
-
});
|
|
46
|
-
const components = [zhyFormRenderer];
|
|
47
|
-
const install = function (app: any, options?: Record<string, any>) {
|
|
48
|
-
components.forEach((component) => {
|
|
49
|
-
app.component(component.name, component);
|
|
50
|
-
});
|
|
51
|
-
if (options?.theme) {
|
|
52
|
-
theme.value = options.theme as ConfigProviderThemeVars;
|
|
53
|
-
}
|
|
54
|
-
app.provide("theme", theme);
|
|
55
|
-
};
|
|
56
|
-
// #endregion
|
|
57
|
-
// 实现全局引入
|
|
58
|
-
export default { install };
|
|
59
|
-
// #endregion
|
package/src/main.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* FilePath : \src\main.ts
|
|
3
|
-
* Author : 苏军志
|
|
4
|
-
* Date : 2024-04-19 14:12
|
|
5
|
-
* LastEditors : 苏军志
|
|
6
|
-
* LastEditTime : 2025-09-06 09:16
|
|
7
|
-
* Description : 程序入口
|
|
8
|
-
* CodeIterationRecord:
|
|
9
|
-
*/
|
|
10
|
-
import { createSSRApp } from "vue";
|
|
11
|
-
import App from "./App.vue";
|
|
12
|
-
import zhytechUiMobile from "./index";
|
|
13
|
-
const theme = { colorTheme: "#4d80f0" };
|
|
14
|
-
export function createApp() {
|
|
15
|
-
const app = createSSRApp(App).use(zhytechUiMobile, { theme });
|
|
16
|
-
return {
|
|
17
|
-
app
|
|
18
|
-
};
|
|
19
|
-
}
|
package/src/manifest.json
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name" : "NursingManagementMobile",
|
|
3
|
-
"appid" : "__UNI__4A0336B",
|
|
4
|
-
"description" : "",
|
|
5
|
-
"versionName" : "1.0.0",
|
|
6
|
-
"versionCode" : "100",
|
|
7
|
-
"transformPx" : false,
|
|
8
|
-
/* 5+App特有相关 */
|
|
9
|
-
"app-plus" : {
|
|
10
|
-
"usingComponents" : true,
|
|
11
|
-
"nvueStyleCompiler" : "uni-app",
|
|
12
|
-
"compilerVersion" : 3,
|
|
13
|
-
"splashscreen" : {
|
|
14
|
-
"alwaysShowBeforeRender" : true,
|
|
15
|
-
"waiting" : true,
|
|
16
|
-
"autoclose" : true,
|
|
17
|
-
"delay" : 0
|
|
18
|
-
},
|
|
19
|
-
/* 模块配置 */
|
|
20
|
-
"modules" : {},
|
|
21
|
-
/* 应用发布信息 */
|
|
22
|
-
"distribute" : {
|
|
23
|
-
/* android打包配置 */
|
|
24
|
-
"android" : {
|
|
25
|
-
"permissions" : [
|
|
26
|
-
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
|
27
|
-
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
|
28
|
-
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
|
29
|
-
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
|
30
|
-
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
|
31
|
-
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
|
32
|
-
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
|
33
|
-
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
|
34
|
-
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
|
35
|
-
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
|
36
|
-
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
|
37
|
-
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
|
38
|
-
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
|
39
|
-
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
|
40
|
-
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
/* ios打包配置 */
|
|
44
|
-
"ios" : {},
|
|
45
|
-
/* SDK配置 */
|
|
46
|
-
"sdkConfigs" : {}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
/* 快应用特有相关 */
|
|
50
|
-
"quickapp" : {},
|
|
51
|
-
/* 小程序特有相关 */
|
|
52
|
-
"mp-weixin" : {
|
|
53
|
-
"appid" : "wxabaed18404474e3b",
|
|
54
|
-
"setting" : {
|
|
55
|
-
"urlCheck" : false
|
|
56
|
-
},
|
|
57
|
-
"usingComponents" : true
|
|
58
|
-
},
|
|
59
|
-
"mp-alipay" : {
|
|
60
|
-
"usingComponents" : true
|
|
61
|
-
},
|
|
62
|
-
"mp-baidu" : {
|
|
63
|
-
"usingComponents" : true
|
|
64
|
-
},
|
|
65
|
-
"mp-toutiao" : {
|
|
66
|
-
"usingComponents" : true
|
|
67
|
-
},
|
|
68
|
-
"uniStatistics" : {
|
|
69
|
-
"enable" : false
|
|
70
|
-
},
|
|
71
|
-
"vueVersion" : "3"
|
|
72
|
-
}
|