@dazhicheng/ui 1.5.37 → 1.5.39
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as TtUploadConstructor } from './src/TtUpload';
|
|
2
|
+
import { TtUploadExposed } from './src/typing';
|
|
2
3
|
export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
4
|
readonly action: {
|
|
4
5
|
readonly type: import('vue').PropType<string>;
|
|
@@ -181,7 +182,7 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<im
|
|
|
181
182
|
readonly disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
182
183
|
readonly limit: NumberConstructor;
|
|
183
184
|
readonly directory: BooleanConstructor;
|
|
184
|
-
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("delete" | "
|
|
185
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("delete" | "close" | "update:modelValue" | "afterUpload" | "preview" | "download" | "templateDownload" | "ok")[], "delete" | "close" | "update:modelValue" | "afterUpload" | "preview" | "download" | "templateDownload" | "ok", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
185
186
|
readonly action: {
|
|
186
187
|
readonly type: import('vue').PropType<string>;
|
|
187
188
|
readonly default: "";
|
|
@@ -364,8 +365,7 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<im
|
|
|
364
365
|
readonly limit: NumberConstructor;
|
|
365
366
|
readonly directory: BooleanConstructor;
|
|
366
367
|
}>> & Readonly<{
|
|
367
|
-
|
|
368
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
368
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
369
369
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
370
370
|
onPreview?: ((...args: any[]) => any) | undefined;
|
|
371
371
|
onOk?: ((...args: any[]) => any) | undefined;
|
|
@@ -423,6 +423,6 @@ export declare const TtUpload: import('../../../../utils/src').SFCWithInstall<im
|
|
|
423
423
|
}) => import('vue').VNode[];
|
|
424
424
|
footer?: () => import('vue').VNode[];
|
|
425
425
|
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>> & Record<string, any>;
|
|
426
|
-
export type TtUploadInstance = InstanceType<typeof TtUploadConstructor
|
|
426
|
+
export type TtUploadInstance = InstanceType<typeof TtUploadConstructor> & TtUploadExposed;
|
|
427
427
|
export * from './src/typing';
|
|
428
428
|
export default TtUpload;
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
import { UploadFile, UploadFiles } from 'element-plus';
|
|
2
2
|
import { SlotsType, VNode } from 'vue';
|
|
3
3
|
import { OssSignatureResult, TtUploadFileItem } from './typing';
|
|
4
|
-
/**
|
|
5
|
-
* TtUpload 上传组件
|
|
6
|
-
*
|
|
7
|
-
* 基于 ElUpload 封装,支持弹框 / 非弹框两种模式,
|
|
8
|
-
* 内置文件列表展示(列表 / 网格自动切换)、文件大小校验、数量限制等功能。
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```vue
|
|
12
|
-
* <!-- 弹框模式 -->
|
|
13
|
-
* <TtUpload ref="uploadRef" :limit="10" accept=".pdf,.docx" />
|
|
14
|
-
* <button @click="uploadRef.openModal()">打开上传</button>
|
|
15
|
-
*
|
|
16
|
-
* <!-- 非弹框模式 -->
|
|
17
|
-
* <TtUpload :modal="false" :limit="5" />
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
4
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
21
5
|
readonly action: {
|
|
22
6
|
readonly type: import('vue').PropType<string>;
|
|
@@ -199,7 +183,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
199
183
|
readonly disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
200
184
|
readonly limit: NumberConstructor;
|
|
201
185
|
readonly directory: BooleanConstructor;
|
|
202
|
-
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("delete" | "
|
|
186
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("delete" | "close" | "update:modelValue" | "afterUpload" | "preview" | "download" | "templateDownload" | "ok")[], "delete" | "close" | "update:modelValue" | "afterUpload" | "preview" | "download" | "templateDownload" | "ok", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
203
187
|
readonly action: {
|
|
204
188
|
readonly type: import('vue').PropType<string>;
|
|
205
189
|
readonly default: "";
|
|
@@ -382,8 +366,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
382
366
|
readonly limit: NumberConstructor;
|
|
383
367
|
readonly directory: BooleanConstructor;
|
|
384
368
|
}>> & Readonly<{
|
|
385
|
-
|
|
386
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
369
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
387
370
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
388
371
|
onPreview?: ((...args: any[]) => any) | undefined;
|
|
389
372
|
onOk?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { UploadRawFile } from 'element-plus';
|
|
2
3
|
/** 后端返回的阿里云 OSS V4 签名信息(服务端签名直传) */
|
|
3
4
|
export interface OssSignatureResult {
|
|
4
5
|
/** HMAC-SHA256 签名 */
|
|
@@ -34,10 +35,17 @@ export interface TtUploadFileItem {
|
|
|
34
35
|
/** 上传时间 */
|
|
35
36
|
uploadTime?: string;
|
|
36
37
|
/** 原始文件对象 */
|
|
37
|
-
raw?:
|
|
38
|
+
raw?: UploadRawFile;
|
|
38
39
|
/** 扩展数据 */
|
|
39
40
|
[key: string]: unknown;
|
|
40
41
|
}
|
|
42
|
+
export type TtUploadExposed = {
|
|
43
|
+
/** 获取当前文件列表的浅拷贝 */
|
|
44
|
+
getFileList: () => TtUploadFileItem[];
|
|
45
|
+
openModal: () => void;
|
|
46
|
+
setModalProps: (props: any) => void;
|
|
47
|
+
closeModal: () => void;
|
|
48
|
+
};
|
|
41
49
|
export declare const ttUploadProps: {
|
|
42
50
|
readonly action: {
|
|
43
51
|
readonly type: PropType<string>;
|
|
@@ -125,12 +133,12 @@ export declare const ttUploadProps: {
|
|
|
125
133
|
readonly type: PropType<boolean>;
|
|
126
134
|
readonly default: true;
|
|
127
135
|
};
|
|
128
|
-
readonly beforeUpload: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (rawFile:
|
|
129
|
-
(): (rawFile:
|
|
136
|
+
readonly beforeUpload: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>) | (() => (rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>) | {
|
|
137
|
+
(): (rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>;
|
|
130
138
|
new (): any;
|
|
131
139
|
readonly prototype: any;
|
|
132
|
-
} | ((new (...args: any[]) => (rawFile:
|
|
133
|
-
(): (rawFile:
|
|
140
|
+
} | ((new (...args: any[]) => (rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>) | (() => (rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>) | {
|
|
141
|
+
(): (rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>;
|
|
134
142
|
new (): any;
|
|
135
143
|
readonly prototype: any;
|
|
136
144
|
})[], unknown, unknown, () => void, boolean>;
|
|
@@ -216,7 +224,7 @@ export declare const ttUploadProps: {
|
|
|
216
224
|
__epPropKey: true;
|
|
217
225
|
};
|
|
218
226
|
readonly method: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "post", boolean>;
|
|
219
|
-
readonly data: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>> | Promise<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile:
|
|
227
|
+
readonly data: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>> | Promise<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus').UploadData>)) | (() => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus').UploadData>)) | ((new (...args: any[]) => import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>> | Promise<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus').UploadData>)) | (() => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile: UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus').UploadData>)))[], unknown, unknown, () => import('element-plus/es/utils/typescript.mjs').Mutable<{}>, boolean>;
|
|
220
228
|
readonly name: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "file", boolean>;
|
|
221
229
|
readonly withCredentials: BooleanConstructor;
|
|
222
230
|
readonly fileList: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus').UploadUserFile[]) | (() => import('element-plus').UploadUserFile[]) | ((new (...args: any[]) => import('element-plus').UploadUserFile[]) | (() => import('element-plus').UploadUserFile[]))[], unknown, unknown, () => [], boolean>;
|
|
@@ -244,8 +252,8 @@ export interface TtUploadEmits {
|
|
|
244
252
|
(e: "download", file: TtUploadFileItem): void;
|
|
245
253
|
(e: "delete", file: TtUploadFileItem): void;
|
|
246
254
|
(e: "templateDownload"): void;
|
|
247
|
-
(e: "ok", fileList: TtUploadFileItem[]): void;
|
|
248
255
|
/** 弹框模式下点击确定时抛出,携带当前文件列表 */
|
|
249
|
-
(e: "
|
|
250
|
-
|
|
256
|
+
(e: "ok", fileList: TtUploadFileItem[]): void;
|
|
257
|
+
/** 弹框关闭时抛出 */
|
|
258
|
+
(e: "close"): void;
|
|
251
259
|
}
|