knt-shared 1.2.0 → 1.2.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/dist/components/Form/componentMap.d.ts +35 -0
- package/dist/components/Form/componentMap.d.ts.map +1 -1
- package/dist/components/Upload/BasicUpload.vue.d.ts +7 -4
- package/dist/components/Upload/BasicUpload.vue.d.ts.map +1 -1
- package/dist/components/Upload/types.d.ts +15 -0
- package/dist/components/Upload/types.d.ts.map +1 -1
- package/dist/index.cjs.js +113 -48
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +113 -48
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +40 -40
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
+
import { Input } from '@arco-design/web-vue';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* 组件映射表(使用对象以获得更好的类型推断)
|
|
@@ -786,6 +787,9 @@ export declare const componentMap: {
|
|
|
786
787
|
tip: {
|
|
787
788
|
type: import('vue').PropType<string>;
|
|
788
789
|
};
|
|
790
|
+
cardSize: {
|
|
791
|
+
type: import('vue').PropType<number>;
|
|
792
|
+
};
|
|
789
793
|
imagePreview: {
|
|
790
794
|
type: import('vue').PropType<boolean>;
|
|
791
795
|
default: boolean;
|
|
@@ -824,6 +828,10 @@ export declare const componentMap: {
|
|
|
824
828
|
type: import('vue').PropType<"text" | "outline" | "dashed" | "primary" | "secondary">;
|
|
825
829
|
default: string;
|
|
826
830
|
};
|
|
831
|
+
responseUrlKey: {
|
|
832
|
+
type: import('vue').PropType<string | ((fileItem: Input) => string)>;
|
|
833
|
+
default: undefined;
|
|
834
|
+
};
|
|
827
835
|
}>> & Readonly<{
|
|
828
836
|
onRegister?: ((uploadInstance: any) => any) | undefined;
|
|
829
837
|
onProgress?: ((percent: number, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
@@ -831,6 +839,8 @@ export declare const componentMap: {
|
|
|
831
839
|
"onUpdate:modelValue"?: ((value: string | string[] | import('..').UploadFileItem[]) => any) | undefined;
|
|
832
840
|
onChange?: ((fileList: import('..').UploadFileItem[]) => any) | undefined;
|
|
833
841
|
onSuccess?: ((response: any, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
842
|
+
onHandleSuccess?: ((response: any, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
843
|
+
onHandlError?: ((error: Error, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
834
844
|
onRemove?: ((fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
835
845
|
onPreview?: ((fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
836
846
|
onExceed?: ((files: File[], fileList: import('..').UploadFileItem[]) => any) | undefined;
|
|
@@ -850,7 +860,9 @@ export declare const componentMap: {
|
|
|
850
860
|
"update:modelValue": (value: string | string[] | import('..').UploadFileItem[]) => void;
|
|
851
861
|
change: (fileList: import('..').UploadFileItem[]) => void;
|
|
852
862
|
success: (response: any, fileItem: import('..').UploadFileItem) => void;
|
|
863
|
+
handleSuccess: (response: any, fileItem: import('..').UploadFileItem) => void;
|
|
853
864
|
error: (error: Error, fileItem: import('..').UploadFileItem) => void;
|
|
865
|
+
handlError: (error: Error, fileItem: import('..').UploadFileItem) => void;
|
|
854
866
|
progress: (percent: number, fileItem: import('..').UploadFileItem) => void;
|
|
855
867
|
remove: (fileItem: import('..').UploadFileItem) => void;
|
|
856
868
|
preview: (fileItem: import('..').UploadFileItem) => void;
|
|
@@ -878,6 +890,7 @@ export declare const componentMap: {
|
|
|
878
890
|
autoUpload: boolean;
|
|
879
891
|
resultType: "fileList" | "url" | "string";
|
|
880
892
|
uploadButtonType: "primary" | "secondary" | "outline" | "dashed" | "text";
|
|
893
|
+
responseUrlKey: string | ((fileItem: Input) => string);
|
|
881
894
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
882
895
|
P: {};
|
|
883
896
|
B: {};
|
|
@@ -978,6 +991,9 @@ export declare const componentMap: {
|
|
|
978
991
|
tip: {
|
|
979
992
|
type: import('vue').PropType<string>;
|
|
980
993
|
};
|
|
994
|
+
cardSize: {
|
|
995
|
+
type: import('vue').PropType<number>;
|
|
996
|
+
};
|
|
981
997
|
imagePreview: {
|
|
982
998
|
type: import('vue').PropType<boolean>;
|
|
983
999
|
default: boolean;
|
|
@@ -1016,6 +1032,10 @@ export declare const componentMap: {
|
|
|
1016
1032
|
type: import('vue').PropType<"text" | "outline" | "dashed" | "primary" | "secondary">;
|
|
1017
1033
|
default: string;
|
|
1018
1034
|
};
|
|
1035
|
+
responseUrlKey: {
|
|
1036
|
+
type: import('vue').PropType<string | ((fileItem: Input) => string)>;
|
|
1037
|
+
default: undefined;
|
|
1038
|
+
};
|
|
1019
1039
|
}>> & Readonly<{
|
|
1020
1040
|
onRegister?: ((uploadInstance: any) => any) | undefined;
|
|
1021
1041
|
onProgress?: ((percent: number, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
@@ -1023,6 +1043,8 @@ export declare const componentMap: {
|
|
|
1023
1043
|
"onUpdate:modelValue"?: ((value: string | string[] | import('..').UploadFileItem[]) => any) | undefined;
|
|
1024
1044
|
onChange?: ((fileList: import('..').UploadFileItem[]) => any) | undefined;
|
|
1025
1045
|
onSuccess?: ((response: any, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1046
|
+
onHandleSuccess?: ((response: any, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1047
|
+
onHandlError?: ((error: Error, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1026
1048
|
onRemove?: ((fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1027
1049
|
onPreview?: ((fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1028
1050
|
onExceed?: ((files: File[], fileList: import('..').UploadFileItem[]) => any) | undefined;
|
|
@@ -1060,6 +1082,7 @@ export declare const componentMap: {
|
|
|
1060
1082
|
autoUpload: boolean;
|
|
1061
1083
|
resultType: "fileList" | "url" | "string";
|
|
1062
1084
|
uploadButtonType: "primary" | "secondary" | "outline" | "dashed" | "text";
|
|
1085
|
+
responseUrlKey: string | ((fileItem: Input) => string);
|
|
1063
1086
|
}>;
|
|
1064
1087
|
__isFragment?: never;
|
|
1065
1088
|
__isTeleport?: never;
|
|
@@ -1157,6 +1180,9 @@ export declare const componentMap: {
|
|
|
1157
1180
|
tip: {
|
|
1158
1181
|
type: import('vue').PropType<string>;
|
|
1159
1182
|
};
|
|
1183
|
+
cardSize: {
|
|
1184
|
+
type: import('vue').PropType<number>;
|
|
1185
|
+
};
|
|
1160
1186
|
imagePreview: {
|
|
1161
1187
|
type: import('vue').PropType<boolean>;
|
|
1162
1188
|
default: boolean;
|
|
@@ -1195,6 +1221,10 @@ export declare const componentMap: {
|
|
|
1195
1221
|
type: import('vue').PropType<"text" | "outline" | "dashed" | "primary" | "secondary">;
|
|
1196
1222
|
default: string;
|
|
1197
1223
|
};
|
|
1224
|
+
responseUrlKey: {
|
|
1225
|
+
type: import('vue').PropType<string | ((fileItem: Input) => string)>;
|
|
1226
|
+
default: undefined;
|
|
1227
|
+
};
|
|
1198
1228
|
}>> & Readonly<{
|
|
1199
1229
|
onRegister?: ((uploadInstance: any) => any) | undefined;
|
|
1200
1230
|
onProgress?: ((percent: number, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
@@ -1202,6 +1232,8 @@ export declare const componentMap: {
|
|
|
1202
1232
|
"onUpdate:modelValue"?: ((value: string | string[] | import('..').UploadFileItem[]) => any) | undefined;
|
|
1203
1233
|
onChange?: ((fileList: import('..').UploadFileItem[]) => any) | undefined;
|
|
1204
1234
|
onSuccess?: ((response: any, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1235
|
+
onHandleSuccess?: ((response: any, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1236
|
+
onHandlError?: ((error: Error, fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1205
1237
|
onRemove?: ((fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1206
1238
|
onPreview?: ((fileItem: import('..').UploadFileItem) => any) | undefined;
|
|
1207
1239
|
onExceed?: ((files: File[], fileList: import('..').UploadFileItem[]) => any) | undefined;
|
|
@@ -1221,7 +1253,9 @@ export declare const componentMap: {
|
|
|
1221
1253
|
"update:modelValue": (value: string | string[] | import('..').UploadFileItem[]) => void;
|
|
1222
1254
|
change: (fileList: import('..').UploadFileItem[]) => void;
|
|
1223
1255
|
success: (response: any, fileItem: import('..').UploadFileItem) => void;
|
|
1256
|
+
handleSuccess: (response: any, fileItem: import('..').UploadFileItem) => void;
|
|
1224
1257
|
error: (error: Error, fileItem: import('..').UploadFileItem) => void;
|
|
1258
|
+
handlError: (error: Error, fileItem: import('..').UploadFileItem) => void;
|
|
1225
1259
|
progress: (percent: number, fileItem: import('..').UploadFileItem) => void;
|
|
1226
1260
|
remove: (fileItem: import('..').UploadFileItem) => void;
|
|
1227
1261
|
preview: (fileItem: import('..').UploadFileItem) => void;
|
|
@@ -1249,6 +1283,7 @@ export declare const componentMap: {
|
|
|
1249
1283
|
autoUpload: boolean;
|
|
1250
1284
|
resultType: "fileList" | "url" | "string";
|
|
1251
1285
|
uploadButtonType: "primary" | "secondary" | "outline" | "dashed" | "text";
|
|
1286
|
+
responseUrlKey: string | ((fileItem: Input) => string);
|
|
1252
1287
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
1253
1288
|
$slots: {
|
|
1254
1289
|
"upload-button"?(_: {}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentMap.d.ts","sourceRoot":"","sources":["../../../src/components/Form/componentMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"componentMap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aAAa,GAAG,MAAM,OAAO,YAAY,CAAC;AAOtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,QAEnE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAU5E;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,aAKpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,+BAA+B,aAO1C,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQvE"}
|
|
@@ -23,8 +23,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
23
23
|
showDownloadButton: boolean;
|
|
24
24
|
showPreviewButton: boolean;
|
|
25
25
|
showUploadButton: boolean;
|
|
26
|
-
showRetryButton: boolean;
|
|
27
|
-
showCancelButton: boolean;
|
|
28
26
|
imagePreview: boolean;
|
|
29
27
|
imageCrop: boolean;
|
|
30
28
|
imageCompress: boolean;
|
|
@@ -33,6 +31,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
33
31
|
autoUpload: boolean;
|
|
34
32
|
resultType: string;
|
|
35
33
|
uploadButtonType: string;
|
|
34
|
+
responseUrlKey: undefined;
|
|
36
35
|
}>>, {
|
|
37
36
|
submit: () => void;
|
|
38
37
|
abort: (fileItem?: UploadFileItem) => void;
|
|
@@ -49,7 +48,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
49
48
|
"update:modelValue": (value: string | string[] | UploadFileItem[]) => void;
|
|
50
49
|
change: (fileList: UploadFileItem[]) => void;
|
|
51
50
|
success: (response: any, fileItem: UploadFileItem) => void;
|
|
51
|
+
handleSuccess: (response: any, fileItem: UploadFileItem) => void;
|
|
52
52
|
error: (error: Error, fileItem: UploadFileItem) => void;
|
|
53
|
+
handlError: (error: Error, fileItem: UploadFileItem) => void;
|
|
53
54
|
progress: (percent: number, fileItem: UploadFileItem) => void;
|
|
54
55
|
remove: (fileItem: UploadFileItem) => void;
|
|
55
56
|
preview: (fileItem: UploadFileItem) => void;
|
|
@@ -69,8 +70,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
69
70
|
showDownloadButton: boolean;
|
|
70
71
|
showPreviewButton: boolean;
|
|
71
72
|
showUploadButton: boolean;
|
|
72
|
-
showRetryButton: boolean;
|
|
73
|
-
showCancelButton: boolean;
|
|
74
73
|
imagePreview: boolean;
|
|
75
74
|
imageCrop: boolean;
|
|
76
75
|
imageCompress: boolean;
|
|
@@ -79,6 +78,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
79
78
|
autoUpload: boolean;
|
|
80
79
|
resultType: string;
|
|
81
80
|
uploadButtonType: string;
|
|
81
|
+
responseUrlKey: undefined;
|
|
82
82
|
}>>> & Readonly<{
|
|
83
83
|
onRegister?: ((uploadInstance: any) => any) | undefined;
|
|
84
84
|
onProgress?: ((percent: number, fileItem: UploadFileItem) => any) | undefined;
|
|
@@ -86,6 +86,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
86
86
|
"onUpdate:modelValue"?: ((value: string | string[] | UploadFileItem[]) => any) | undefined;
|
|
87
87
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
88
88
|
onSuccess?: ((response: any, fileItem: UploadFileItem) => any) | undefined;
|
|
89
|
+
onHandleSuccess?: ((response: any, fileItem: UploadFileItem) => any) | undefined;
|
|
90
|
+
onHandlError?: ((error: Error, fileItem: UploadFileItem) => any) | undefined;
|
|
89
91
|
onRemove?: ((fileItem: UploadFileItem) => any) | undefined;
|
|
90
92
|
onPreview?: ((fileItem: UploadFileItem) => any) | undefined;
|
|
91
93
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
@@ -112,6 +114,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
112
114
|
autoUpload: boolean;
|
|
113
115
|
resultType: "fileList" | "url" | "string";
|
|
114
116
|
uploadButtonType: "primary" | "secondary" | "outline" | "dashed" | "text";
|
|
117
|
+
responseUrlKey: string | ((fileItem: FileItem) => string);
|
|
115
118
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
116
119
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
117
120
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicUpload.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Upload/BasicUpload.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BasicUpload.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Upload/BasicUpload.vue"],"names":[],"mappings":"AA0DA;AAKE,OAAO,KAAK,EACV,gBAAgB,EAEhB,cAAc,EAEf,MAAM,SAAS,CAAC;AA6oBnB,iBAAS,cAAc;6BAqPe,GAAG;qBACX,GAAG;iBACP,GAAG;;;QACF,GAAG;EAG7B;AAqBD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;uBA1aO,cAAc;;uBAiBhB,cAAc,EAAE;uBAOd,cAAc;4BAOT,OAAO,CAAC,gBAAgB,CAAC;yBAO5B,cAAc,EAAE;oBAQrB,cAAc;2BAQP,cAAc;2BAWd,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAiX5C,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
|
@@ -5,12 +5,19 @@ import { FileItem } from '@arco-design/web-vue';
|
|
|
5
5
|
* 上传文件项
|
|
6
6
|
*/
|
|
7
7
|
export interface UploadFileItem extends FileItem {
|
|
8
|
+
/** 文件唯一标识 */
|
|
8
9
|
uid?: string;
|
|
10
|
+
/** 文件名 */
|
|
9
11
|
name?: string;
|
|
12
|
+
/** 文件URL(上传成功后才有) */
|
|
10
13
|
url?: string;
|
|
14
|
+
/** 文件状态 */
|
|
11
15
|
status?: 'init' | 'uploading' | 'done' | 'error';
|
|
16
|
+
/** 上传进度 */
|
|
12
17
|
percent?: number;
|
|
18
|
+
/** 服务端响应数据 */
|
|
13
19
|
response?: any;
|
|
20
|
+
/** 原始文件对象 */
|
|
14
21
|
originFileObj?: File;
|
|
15
22
|
}
|
|
16
23
|
/**
|
|
@@ -107,6 +114,8 @@ export interface BasicUploadProps {
|
|
|
107
114
|
showUploadButton?: boolean;
|
|
108
115
|
/** 提示文字 */
|
|
109
116
|
tip?: string;
|
|
117
|
+
/** 卡片按钮尺寸 */
|
|
118
|
+
cardSize?: number;
|
|
110
119
|
/** 是否启用图片预览 */
|
|
111
120
|
imagePreview?: boolean;
|
|
112
121
|
/** 是否启用图片裁剪 */
|
|
@@ -127,6 +136,8 @@ export interface BasicUploadProps {
|
|
|
127
136
|
uploadButtonText?: string;
|
|
128
137
|
/** 上传按钮类型 */
|
|
129
138
|
uploadButtonType?: 'primary' | 'secondary' | 'outline' | 'dashed' | 'text';
|
|
139
|
+
/** Response中获取图片URL的key,开启后会用上传的图片替换预加载的图片 */
|
|
140
|
+
responseUrlKey?: string | ((fileItem: FileItem) => string);
|
|
130
141
|
}
|
|
131
142
|
/**
|
|
132
143
|
* BasicUpload 组件事件
|
|
@@ -139,8 +150,12 @@ export interface BasicUploadEmits {
|
|
|
139
150
|
(e: 'change', fileList: UploadFileItem[]): void;
|
|
140
151
|
/** 上传成功 */
|
|
141
152
|
(e: 'success', response: any, fileItem: UploadFileItem): void;
|
|
153
|
+
/** 自定义上传成功 */
|
|
154
|
+
(e: 'handleSuccess', response: any, fileItem: UploadFileItem): void;
|
|
142
155
|
/** 上传失败 */
|
|
143
156
|
(e: 'error', error: Error, fileItem: UploadFileItem): void;
|
|
157
|
+
/** 自定义上传失败事件 */
|
|
158
|
+
(e: 'handlError', error: Error, fileItem: UploadFileItem): void;
|
|
144
159
|
/** 上传进度 */
|
|
145
160
|
(e: 'progress', percent: number, fileItem: UploadFileItem): void;
|
|
146
161
|
/** 删除文件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AAU,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,WAAW;IACX,UAAU,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,qBAAqB;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;CACtB"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -658,14 +658,10 @@ const IconFullscreen = Object.assign(_IconFullscreen, {
|
|
|
658
658
|
});
|
|
659
659
|
const _hoisted_1$3 = { class: "basic-upload" };
|
|
660
660
|
const _hoisted_2$3 = {
|
|
661
|
-
key: 0,
|
|
662
|
-
class: "upload-card-button"
|
|
663
|
-
};
|
|
664
|
-
const _hoisted_3$2 = {
|
|
665
661
|
key: 0,
|
|
666
662
|
class: "upload-text"
|
|
667
663
|
};
|
|
668
|
-
const
|
|
664
|
+
const _hoisted_3$2 = { class: "upload-tip" };
|
|
669
665
|
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
670
666
|
...{
|
|
671
667
|
name: "BasicUpload",
|
|
@@ -674,8 +670,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
674
670
|
__name: "BasicUpload",
|
|
675
671
|
props: {
|
|
676
672
|
modelValue: {},
|
|
677
|
-
accept: { default: "" },
|
|
678
|
-
maxSize: { default:
|
|
673
|
+
accept: { default: "image/*" },
|
|
674
|
+
maxSize: { default: 30 },
|
|
679
675
|
maxCount: { default: 1 },
|
|
680
676
|
multiple: { type: Boolean, default: false },
|
|
681
677
|
disabled: { type: Boolean, default: false },
|
|
@@ -699,6 +695,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
699
695
|
showPreviewButton: { type: Boolean, default: true },
|
|
700
696
|
showUploadButton: { type: Boolean, default: true },
|
|
701
697
|
tip: {},
|
|
698
|
+
cardSize: {},
|
|
702
699
|
imagePreview: { type: Boolean, default: true },
|
|
703
700
|
imageCrop: { type: Boolean, default: false },
|
|
704
701
|
imageCompress: { type: Boolean, default: false },
|
|
@@ -706,17 +703,20 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
706
703
|
draggable: { type: Boolean, default: false },
|
|
707
704
|
directory: { type: Boolean, default: false },
|
|
708
705
|
autoUpload: { type: Boolean, default: true },
|
|
709
|
-
resultType: { default: "
|
|
706
|
+
resultType: { default: "fileList" },
|
|
710
707
|
uploadButtonText: {},
|
|
711
|
-
uploadButtonType: { default: "primary" }
|
|
708
|
+
uploadButtonType: { default: "primary" },
|
|
709
|
+
responseUrlKey: { type: [String, Function], default: void 0 }
|
|
712
710
|
},
|
|
713
|
-
emits: ["register", "update:modelValue", "change", "success", "error", "progress", "remove", "preview", "exceed"],
|
|
711
|
+
emits: ["register", "update:modelValue", "change", "success", "handleSuccess", "error", "handlError", "progress", "remove", "preview", "exceed"],
|
|
714
712
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
715
713
|
const props = __props;
|
|
716
714
|
const emit = __emit;
|
|
717
715
|
const uploadRef = vue.ref();
|
|
718
716
|
const fileListRef = vue.ref([]);
|
|
719
717
|
const propsRef = vue.ref({});
|
|
718
|
+
const hasShownActionError = vue.ref(false);
|
|
719
|
+
const processedFiles = vue.ref(/* @__PURE__ */ new Map());
|
|
720
720
|
const getProps = vue.computed(() => {
|
|
721
721
|
return { ...props, ...vue.unref(propsRef) };
|
|
722
722
|
});
|
|
@@ -737,7 +737,15 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
737
737
|
showRemoveButton: propsData.showRemoveButton && !propsData.readonly,
|
|
738
738
|
showUploadButton: !hideUploadButton.value,
|
|
739
739
|
// 只有在没有自定义预览时才启用 imagePreview
|
|
740
|
-
imagePreview: propsData.imagePreview && !propsData.onPreview
|
|
740
|
+
imagePreview: propsData.imagePreview && !propsData.onPreview,
|
|
741
|
+
onRemove: async (fileItem) => {
|
|
742
|
+
if (propsData.onRemove) {
|
|
743
|
+
const canRemove = await propsData.onRemove(fileItem);
|
|
744
|
+
if (!canRemove) return false;
|
|
745
|
+
}
|
|
746
|
+
emit("remove", fileItem);
|
|
747
|
+
return true;
|
|
748
|
+
}
|
|
741
749
|
};
|
|
742
750
|
});
|
|
743
751
|
const validateFileSize = (file) => {
|
|
@@ -818,18 +826,46 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
818
826
|
action: propsData.action,
|
|
819
827
|
withCredentials: propsData.withCredentials
|
|
820
828
|
};
|
|
821
|
-
propsData.customRequest(customOptions);
|
|
822
|
-
}
|
|
823
|
-
|
|
829
|
+
return propsData.customRequest(customOptions);
|
|
830
|
+
}
|
|
831
|
+
return defaultUpload(options);
|
|
832
|
+
};
|
|
833
|
+
const extractUrlFromResponse = (response) => {
|
|
834
|
+
const urlPaths = ["url", "data.pathUrl", "data.url", "data.path", "pathUrl", "path"];
|
|
835
|
+
for (const path of urlPaths) {
|
|
836
|
+
const value = path.split(".").reduce((obj, key) => obj == null ? void 0 : obj[key], response);
|
|
837
|
+
if (value && typeof value === "string") {
|
|
838
|
+
return value;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
if (response.data && typeof response.data === "string") {
|
|
842
|
+
return response.data;
|
|
824
843
|
}
|
|
844
|
+
return null;
|
|
845
|
+
};
|
|
846
|
+
const isDev = false;
|
|
847
|
+
const logger = {
|
|
848
|
+
debug: (...args) => isDev,
|
|
849
|
+
warn: (...args) => console.warn("[BasicUpload]", ...args),
|
|
850
|
+
error: (...args) => console.error("[BasicUpload]", ...args)
|
|
825
851
|
};
|
|
826
852
|
const defaultUpload = (options) => {
|
|
827
853
|
const propsData = vue.unref(getProps);
|
|
828
854
|
const { fileItem, onProgress, onSuccess, onError } = options;
|
|
829
855
|
if (!propsData.action) {
|
|
830
|
-
|
|
856
|
+
if (!hasShownActionError.value) {
|
|
857
|
+
webVue.Message.error("请配置上传地址 action");
|
|
858
|
+
hasShownActionError.value = true;
|
|
859
|
+
setTimeout(() => {
|
|
860
|
+
hasShownActionError.value = false;
|
|
861
|
+
}, 3e3);
|
|
862
|
+
}
|
|
831
863
|
onError(new Error("上传地址未配置"));
|
|
832
|
-
return
|
|
864
|
+
return {
|
|
865
|
+
abort() {
|
|
866
|
+
xhr.abort();
|
|
867
|
+
}
|
|
868
|
+
};
|
|
833
869
|
}
|
|
834
870
|
const formData = new FormData();
|
|
835
871
|
formData.append(propsData.name || "file", fileItem.file);
|
|
@@ -849,15 +885,31 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
849
885
|
if (xhr.status >= 200 && xhr.status < 300) {
|
|
850
886
|
try {
|
|
851
887
|
const response = JSON.parse(xhr.responseText);
|
|
852
|
-
|
|
888
|
+
const { code, message, data } = response;
|
|
889
|
+
if (code !== 200) {
|
|
890
|
+
const errorMsg = message ? `上传失败: ${message}` : "上传失败";
|
|
891
|
+
onError(new Error(errorMsg));
|
|
892
|
+
webVue.Message.error(errorMsg);
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
const extractedUrl = extractUrlFromResponse(response);
|
|
896
|
+
const normalizedResponse = extractedUrl ? { url: extractedUrl, name: fileItem.name, ...data } : response;
|
|
897
|
+
if (!extractedUrl) {
|
|
898
|
+
logger.warn("响应中未找到 URL 字段,可能导致上传状态异常");
|
|
899
|
+
}
|
|
900
|
+
webVue.Message.success(`${fileItem.name} 上传成功`);
|
|
901
|
+
onSuccess(normalizedResponse);
|
|
853
902
|
} catch (error) {
|
|
854
|
-
onSuccess(xhr.responseText);
|
|
903
|
+
onSuccess({ data: xhr.responseText });
|
|
855
904
|
}
|
|
856
905
|
} else {
|
|
857
|
-
|
|
906
|
+
const errorMsg = `上传失败: HTTP ${xhr.status}`;
|
|
907
|
+
webVue.Message.error(errorMsg);
|
|
908
|
+
onError(new Error(errorMsg));
|
|
858
909
|
}
|
|
859
910
|
});
|
|
860
911
|
xhr.addEventListener("error", () => {
|
|
912
|
+
logger.error("上传网络错误");
|
|
861
913
|
onError(new Error("网络错误"));
|
|
862
914
|
});
|
|
863
915
|
xhr.addEventListener("abort", () => {
|
|
@@ -873,32 +925,41 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
873
925
|
xhr.withCredentials = true;
|
|
874
926
|
}
|
|
875
927
|
xhr.send(formData);
|
|
928
|
+
return {
|
|
929
|
+
abort() {
|
|
930
|
+
xhr.abort();
|
|
931
|
+
}
|
|
932
|
+
};
|
|
876
933
|
};
|
|
877
934
|
const handleChange = (fileList, currentFile) => {
|
|
935
|
+
const oldLength = fileListRef.value.length;
|
|
936
|
+
const newLength = fileList.length;
|
|
878
937
|
fileListRef.value = fileList;
|
|
879
938
|
emit("change", fileList);
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
} else if (currentFile.status === "error") {
|
|
887
|
-
|
|
939
|
+
const isRemove = newLength < oldLength;
|
|
940
|
+
const fileKey = currentFile.uid;
|
|
941
|
+
const lastStatus = processedFiles.value.get(fileKey);
|
|
942
|
+
if (currentFile.status === "done" && lastStatus !== "done" && !isRemove) {
|
|
943
|
+
processedFiles.value.set(fileKey, "done");
|
|
944
|
+
emit("handleSuccess", currentFile.response, currentFile);
|
|
945
|
+
} else if (currentFile.status === "error" && lastStatus !== "error") {
|
|
946
|
+
processedFiles.value.set(fileKey, "error");
|
|
888
947
|
const error = new Error("上传失败");
|
|
889
|
-
emit("
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
948
|
+
emit("handlError", error, currentFile);
|
|
949
|
+
}
|
|
950
|
+
if (isRemove) {
|
|
951
|
+
const fileUids = new Set(fileList.map((f) => f.uid));
|
|
952
|
+
processedFiles.value.forEach((_, uid) => {
|
|
953
|
+
if (!fileUids.has(uid)) {
|
|
954
|
+
processedFiles.value.delete(uid);
|
|
955
|
+
}
|
|
956
|
+
});
|
|
893
957
|
}
|
|
894
958
|
updateModelValue(fileList);
|
|
895
959
|
};
|
|
896
960
|
const handleProgress = (currentFile, event) => {
|
|
897
961
|
const percent = currentFile.percent || 0;
|
|
898
962
|
emit("progress", percent, currentFile);
|
|
899
|
-
if (getProps.value.onProgress) {
|
|
900
|
-
getProps.value.onProgress(percent, currentFile);
|
|
901
|
-
}
|
|
902
963
|
};
|
|
903
964
|
const handlePreview = (fileItem) => {
|
|
904
965
|
const propsData = vue.unref(getProps);
|
|
@@ -965,6 +1026,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
965
1026
|
};
|
|
966
1027
|
const clearFiles = () => {
|
|
967
1028
|
fileListRef.value = [];
|
|
1029
|
+
processedFiles.value.clear();
|
|
968
1030
|
emit("update:modelValue", []);
|
|
969
1031
|
emit("change", []);
|
|
970
1032
|
};
|
|
@@ -987,18 +1049,14 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
987
1049
|
updateModelValue(fileListRef.value);
|
|
988
1050
|
};
|
|
989
1051
|
const removeFile = (fileItem) => {
|
|
990
|
-
const index = fileListRef.value.findIndex(
|
|
991
|
-
(item) => item.uid === fileItem.uid
|
|
992
|
-
);
|
|
1052
|
+
const index = fileListRef.value.findIndex((item) => item.uid === fileItem.uid);
|
|
993
1053
|
if (index !== -1) {
|
|
994
1054
|
fileListRef.value.splice(index, 1);
|
|
995
1055
|
updateModelValue(fileListRef.value);
|
|
996
1056
|
}
|
|
997
1057
|
};
|
|
998
1058
|
const updateFile = (fileItem) => {
|
|
999
|
-
const index = fileListRef.value.findIndex(
|
|
1000
|
-
(item) => item.uid === fileItem.uid
|
|
1001
|
-
);
|
|
1059
|
+
const index = fileListRef.value.findIndex((item) => item.uid === fileItem.uid);
|
|
1002
1060
|
if (index !== -1) {
|
|
1003
1061
|
fileListRef.value[index] = { ...fileListRef.value[index], ...fileItem };
|
|
1004
1062
|
updateModelValue(fileListRef.value);
|
|
@@ -1049,8 +1107,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1049
1107
|
}, getBindValue.value, {
|
|
1050
1108
|
"file-list": fileListRef.value,
|
|
1051
1109
|
"custom-request": handleCustomRequest,
|
|
1052
|
-
"before-upload": handleBeforeUpload,
|
|
1053
1110
|
onChange: handleChange,
|
|
1111
|
+
onBeforeUpload: handleBeforeUpload,
|
|
1054
1112
|
onProgress: handleProgress,
|
|
1055
1113
|
onPreview: handlePreview
|
|
1056
1114
|
}), vue.createSlots({ _: 2 }, [
|
|
@@ -1058,10 +1116,17 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1058
1116
|
name: "upload-button",
|
|
1059
1117
|
fn: vue.withCtx(() => [
|
|
1060
1118
|
vue.renderSlot(_ctx.$slots, "upload-button", {}, () => [
|
|
1061
|
-
getProps.value.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock("div",
|
|
1119
|
+
getProps.value.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1120
|
+
key: 0,
|
|
1121
|
+
class: "upload-card-button",
|
|
1122
|
+
style: vue.normalizeStyle({
|
|
1123
|
+
width: `${getProps.value.cardSize || 80}px`,
|
|
1124
|
+
height: `${getProps.value.cardSize || 80}px`
|
|
1125
|
+
})
|
|
1126
|
+
}, [
|
|
1062
1127
|
vue.createVNode(vue.unref(IconPlus), { size: 16 }),
|
|
1063
|
-
getProps.value.uploadButtonText ? (vue.openBlock(), vue.createElementBlock("div",
|
|
1064
|
-
])) : (vue.openBlock(), vue.createBlock(_component_a_button, {
|
|
1128
|
+
getProps.value.uploadButtonText ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, vue.toDisplayString(getProps.value.uploadButtonText), 1)) : vue.createCommentVNode("", true)
|
|
1129
|
+
], 4)) : (vue.openBlock(), vue.createBlock(_component_a_button, {
|
|
1065
1130
|
key: 1,
|
|
1066
1131
|
type: getProps.value.uploadButtonType || "primary"
|
|
1067
1132
|
}, {
|
|
@@ -1088,7 +1153,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1088
1153
|
name: "tip",
|
|
1089
1154
|
fn: vue.withCtx(() => [
|
|
1090
1155
|
vue.renderSlot(_ctx.$slots, "tip", {}, () => [
|
|
1091
|
-
vue.createElementVNode("div",
|
|
1156
|
+
vue.createElementVNode("div", _hoisted_3$2, vue.toDisplayString(getProps.value.tip), 1)
|
|
1092
1157
|
], true)
|
|
1093
1158
|
]),
|
|
1094
1159
|
key: "2"
|
|
@@ -1112,7 +1177,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
1112
1177
|
}
|
|
1113
1178
|
return target;
|
|
1114
1179
|
};
|
|
1115
|
-
const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
1180
|
+
const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-1a5a7ff7"]]);
|
|
1116
1181
|
const componentMap = {
|
|
1117
1182
|
Input: webVue.Input,
|
|
1118
1183
|
InputNumber: webVue.InputNumber,
|
|
@@ -2116,7 +2181,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2116
2181
|
const indexColumn = {
|
|
2117
2182
|
title: "序号",
|
|
2118
2183
|
dataIndex: "__index__",
|
|
2119
|
-
width:
|
|
2184
|
+
width: 60,
|
|
2120
2185
|
align: "center",
|
|
2121
2186
|
fixed: "left",
|
|
2122
2187
|
slotName: "__index__",
|
|
@@ -2997,7 +3062,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2997
3062
|
};
|
|
2998
3063
|
}
|
|
2999
3064
|
});
|
|
3000
|
-
const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
3065
|
+
const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-04667d35"]]);
|
|
3001
3066
|
function useTable(options = {}) {
|
|
3002
3067
|
const tableRef = vue.ref(null);
|
|
3003
3068
|
const formRef = vue.ref(null);
|