knt-shared 1.2.0 → 1.2.1
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 +12 -3
- package/dist/components/Form/componentMap.d.ts.map +1 -1
- package/dist/components/Upload/BasicUpload.vue.d.ts +2 -4
- package/dist/components/Upload/BasicUpload.vue.d.ts.map +1 -1
- package/dist/components/Upload/types.d.ts +21 -5
- package/dist/components/Upload/types.d.ts.map +1 -1
- package/dist/index.cjs.js +118 -45
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +118 -45
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +40 -40
- package/package.json +1 -1
|
@@ -749,7 +749,7 @@ export declare const componentMap: {
|
|
|
749
749
|
default: boolean;
|
|
750
750
|
};
|
|
751
751
|
customRequest: {
|
|
752
|
-
type: import('vue').PropType<(options: import('..').CustomRequestOptions) =>
|
|
752
|
+
type: import('vue').PropType<(options: import('..').CustomRequestOptions) => import('..').CustomRequestReturn>;
|
|
753
753
|
};
|
|
754
754
|
beforeUpload: {
|
|
755
755
|
type: import('vue').PropType<(file: File) => boolean | Promise<boolean>>;
|
|
@@ -786,6 +786,9 @@ export declare const componentMap: {
|
|
|
786
786
|
tip: {
|
|
787
787
|
type: import('vue').PropType<string>;
|
|
788
788
|
};
|
|
789
|
+
cardSize: {
|
|
790
|
+
type: import('vue').PropType<number>;
|
|
791
|
+
};
|
|
789
792
|
imagePreview: {
|
|
790
793
|
type: import('vue').PropType<boolean>;
|
|
791
794
|
default: boolean;
|
|
@@ -941,7 +944,7 @@ export declare const componentMap: {
|
|
|
941
944
|
default: boolean;
|
|
942
945
|
};
|
|
943
946
|
customRequest: {
|
|
944
|
-
type: import('vue').PropType<(options: import('..').CustomRequestOptions) =>
|
|
947
|
+
type: import('vue').PropType<(options: import('..').CustomRequestOptions) => import('..').CustomRequestReturn>;
|
|
945
948
|
};
|
|
946
949
|
beforeUpload: {
|
|
947
950
|
type: import('vue').PropType<(file: File) => boolean | Promise<boolean>>;
|
|
@@ -978,6 +981,9 @@ export declare const componentMap: {
|
|
|
978
981
|
tip: {
|
|
979
982
|
type: import('vue').PropType<string>;
|
|
980
983
|
};
|
|
984
|
+
cardSize: {
|
|
985
|
+
type: import('vue').PropType<number>;
|
|
986
|
+
};
|
|
981
987
|
imagePreview: {
|
|
982
988
|
type: import('vue').PropType<boolean>;
|
|
983
989
|
default: boolean;
|
|
@@ -1120,7 +1126,7 @@ export declare const componentMap: {
|
|
|
1120
1126
|
default: boolean;
|
|
1121
1127
|
};
|
|
1122
1128
|
customRequest: {
|
|
1123
|
-
type: import('vue').PropType<(options: import('..').CustomRequestOptions) =>
|
|
1129
|
+
type: import('vue').PropType<(options: import('..').CustomRequestOptions) => import('..').CustomRequestReturn>;
|
|
1124
1130
|
};
|
|
1125
1131
|
beforeUpload: {
|
|
1126
1132
|
type: import('vue').PropType<(file: File) => boolean | Promise<boolean>>;
|
|
@@ -1157,6 +1163,9 @@ export declare const componentMap: {
|
|
|
1157
1163
|
tip: {
|
|
1158
1164
|
type: import('vue').PropType<string>;
|
|
1159
1165
|
};
|
|
1166
|
+
cardSize: {
|
|
1167
|
+
type: import('vue').PropType<number>;
|
|
1168
|
+
};
|
|
1160
1169
|
imagePreview: {
|
|
1161
1170
|
type: import('vue').PropType<boolean>;
|
|
1162
1171
|
default: boolean;
|
|
@@ -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;AA0BhC;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;oBAyBzB;;uBAEG;oBACH,CAJA;;;;;;;;;;;;;;2BAsBG,CAAC;2BAGD,CAAC;;;;;;;;;;;;;;mBAmBK,CAAC;mBAMP,CAAC;oBACA,CAAC;kBAII,CAAC;mB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O,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,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;
|
|
@@ -69,8 +68,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
69
68
|
showDownloadButton: boolean;
|
|
70
69
|
showPreviewButton: boolean;
|
|
71
70
|
showUploadButton: boolean;
|
|
72
|
-
showRetryButton: boolean;
|
|
73
|
-
showCancelButton: boolean;
|
|
74
71
|
imagePreview: boolean;
|
|
75
72
|
imageCrop: boolean;
|
|
76
73
|
imageCompress: boolean;
|
|
@@ -79,6 +76,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
79
76
|
autoUpload: boolean;
|
|
80
77
|
resultType: string;
|
|
81
78
|
uploadButtonType: string;
|
|
79
|
+
responseUrlKey: undefined;
|
|
82
80
|
}>>> & Readonly<{
|
|
83
81
|
onRegister?: ((uploadInstance: any) => any) | undefined;
|
|
84
82
|
onProgress?: ((percent: number, fileItem: UploadFileItem) => any) | undefined;
|
|
@@ -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;AA8pBnB,iBAAS,cAAc;6BAqPe,GAAG;qBACX,GAAG;iBACP,GAAG;;;QACF,GAAG;EAG7B;AAqBD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;uBA9aO,cAAc;;uBAiBhB,cAAc,EAAE;uBAOd,cAAc;4BAOT,OAAO,CAAC,gBAAgB,CAAC;yBAO5B,cAAc,EAAE;oBAQrB,cAAc;2BAQP,cAAc;2BAWd,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAqX5C,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
|
-
|
|
9
|
-
|
|
8
|
+
/** 文件唯一标识 */
|
|
9
|
+
uid: string;
|
|
10
|
+
/** 文件名 */
|
|
11
|
+
name: string;
|
|
12
|
+
/** 文件URL(上传成功后才有) */
|
|
10
13
|
url?: string;
|
|
11
|
-
|
|
14
|
+
/** 文件状态 */
|
|
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
|
/**
|
|
@@ -26,6 +33,13 @@ export interface CompressOptions {
|
|
|
26
33
|
/** 是否保持宽高比 */
|
|
27
34
|
keepRatio?: boolean;
|
|
28
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* customRequest 返回值类型
|
|
38
|
+
*/
|
|
39
|
+
export interface CustomRequestReturn {
|
|
40
|
+
/** 取消上传方法 */
|
|
41
|
+
abort: () => void;
|
|
42
|
+
}
|
|
29
43
|
/**
|
|
30
44
|
* 自定义上传请求配置
|
|
31
45
|
*/
|
|
@@ -81,8 +95,8 @@ export interface BasicUploadProps {
|
|
|
81
95
|
name?: string;
|
|
82
96
|
/** 是否携带cookie */
|
|
83
97
|
withCredentials?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
customRequest?: (options: CustomRequestOptions) =>
|
|
98
|
+
/** 自定义上传实现(必须返回包含 abort 方法的对象) */
|
|
99
|
+
customRequest?: (options: CustomRequestOptions) => CustomRequestReturn;
|
|
86
100
|
/** 上传前的钩子 */
|
|
87
101
|
beforeUpload?: (file: File) => boolean | Promise<boolean>;
|
|
88
102
|
/** 上传成功的回调 */
|
|
@@ -107,6 +121,8 @@ export interface BasicUploadProps {
|
|
|
107
121
|
showUploadButton?: boolean;
|
|
108
122
|
/** 提示文字 */
|
|
109
123
|
tip?: string;
|
|
124
|
+
/** 卡片按钮尺寸 */
|
|
125
|
+
cardSize?: number;
|
|
110
126
|
/** 是否启用图片预览 */
|
|
111
127
|
imagePreview?: boolean;
|
|
112
128
|
/** 是否启用图片裁剪 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Upload/types.ts"],"names":[],"mappings":"AAAA,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EG;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,7 +703,7 @@ 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
708
|
uploadButtonType: { default: "primary" }
|
|
712
709
|
},
|
|
@@ -717,6 +714,9 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
717
714
|
const uploadRef = vue.ref();
|
|
718
715
|
const fileListRef = vue.ref([]);
|
|
719
716
|
const propsRef = vue.ref({});
|
|
717
|
+
const hasShownActionError = vue.ref(false);
|
|
718
|
+
const isInternalUpdate = 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
|
-
} else {
|
|
823
|
-
defaultUpload(options);
|
|
829
|
+
return propsData.customRequest(customOptions);
|
|
824
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;
|
|
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,42 @@ 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
|
+
if (isInternalUpdate.value) return;
|
|
936
|
+
const oldLength = fileListRef.value.length;
|
|
937
|
+
const newLength = fileList.length;
|
|
878
938
|
fileListRef.value = fileList;
|
|
879
939
|
emit("change", fileList);
|
|
880
|
-
|
|
881
|
-
|
|
940
|
+
const isRemove = newLength < oldLength;
|
|
941
|
+
const fileKey = currentFile.uid;
|
|
942
|
+
const lastStatus = processedFiles.value.get(fileKey);
|
|
943
|
+
if (currentFile.status === "done" && lastStatus !== "done" && !isRemove) {
|
|
944
|
+
processedFiles.value.set(fileKey, "done");
|
|
882
945
|
emit("success", currentFile.response, currentFile);
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
886
|
-
} else if (currentFile.status === "error") {
|
|
887
|
-
webVue.Message.error(`${currentFile.name} 上传失败`);
|
|
946
|
+
} else if (currentFile.status === "error" && lastStatus !== "error") {
|
|
947
|
+
processedFiles.value.set(fileKey, "error");
|
|
888
948
|
const error = new Error("上传失败");
|
|
889
949
|
emit("error", error, currentFile);
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
950
|
+
}
|
|
951
|
+
if (isRemove) {
|
|
952
|
+
const fileUids = new Set(fileList.map((f) => f.uid));
|
|
953
|
+
processedFiles.value.forEach((_, uid) => {
|
|
954
|
+
if (!fileUids.has(uid)) {
|
|
955
|
+
processedFiles.value.delete(uid);
|
|
956
|
+
}
|
|
957
|
+
});
|
|
893
958
|
}
|
|
894
959
|
updateModelValue(fileList);
|
|
895
960
|
};
|
|
896
961
|
const handleProgress = (currentFile, event) => {
|
|
897
962
|
const percent = currentFile.percent || 0;
|
|
898
963
|
emit("progress", percent, currentFile);
|
|
899
|
-
if (getProps.value.onProgress) {
|
|
900
|
-
getProps.value.onProgress(percent, currentFile);
|
|
901
|
-
}
|
|
902
964
|
};
|
|
903
965
|
const handlePreview = (fileItem) => {
|
|
904
966
|
const propsData = vue.unref(getProps);
|
|
@@ -910,6 +972,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
910
972
|
const updateModelValue = (fileList) => {
|
|
911
973
|
var _a;
|
|
912
974
|
const propsData = vue.unref(getProps);
|
|
975
|
+
isInternalUpdate.value = true;
|
|
913
976
|
switch (propsData.resultType) {
|
|
914
977
|
case "fileList":
|
|
915
978
|
emit("update:modelValue", fileList);
|
|
@@ -930,6 +993,11 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
930
993
|
default:
|
|
931
994
|
emit("update:modelValue", fileList);
|
|
932
995
|
}
|
|
996
|
+
vue.nextTick(() => {
|
|
997
|
+
setTimeout(() => {
|
|
998
|
+
isInternalUpdate.value = false;
|
|
999
|
+
}, 50);
|
|
1000
|
+
});
|
|
933
1001
|
};
|
|
934
1002
|
const parseModelValue = (value) => {
|
|
935
1003
|
if (!value) return [];
|
|
@@ -965,6 +1033,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
965
1033
|
};
|
|
966
1034
|
const clearFiles = () => {
|
|
967
1035
|
fileListRef.value = [];
|
|
1036
|
+
processedFiles.value.clear();
|
|
968
1037
|
emit("update:modelValue", []);
|
|
969
1038
|
emit("change", []);
|
|
970
1039
|
};
|
|
@@ -987,18 +1056,14 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
987
1056
|
updateModelValue(fileListRef.value);
|
|
988
1057
|
};
|
|
989
1058
|
const removeFile = (fileItem) => {
|
|
990
|
-
const index = fileListRef.value.findIndex(
|
|
991
|
-
(item) => item.uid === fileItem.uid
|
|
992
|
-
);
|
|
1059
|
+
const index = fileListRef.value.findIndex((item) => item.uid === fileItem.uid);
|
|
993
1060
|
if (index !== -1) {
|
|
994
1061
|
fileListRef.value.splice(index, 1);
|
|
995
1062
|
updateModelValue(fileListRef.value);
|
|
996
1063
|
}
|
|
997
1064
|
};
|
|
998
1065
|
const updateFile = (fileItem) => {
|
|
999
|
-
const index = fileListRef.value.findIndex(
|
|
1000
|
-
(item) => item.uid === fileItem.uid
|
|
1001
|
-
);
|
|
1066
|
+
const index = fileListRef.value.findIndex((item) => item.uid === fileItem.uid);
|
|
1002
1067
|
if (index !== -1) {
|
|
1003
1068
|
fileListRef.value[index] = { ...fileListRef.value[index], ...fileItem };
|
|
1004
1069
|
updateModelValue(fileListRef.value);
|
|
@@ -1018,7 +1083,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1018
1083
|
});
|
|
1019
1084
|
vue.watch(
|
|
1020
1085
|
() => props.modelValue,
|
|
1021
|
-
(val) => {
|
|
1086
|
+
(val, oldVal) => {
|
|
1087
|
+
if (isInternalUpdate.value) return;
|
|
1022
1088
|
fileListRef.value = parseModelValue(val);
|
|
1023
1089
|
},
|
|
1024
1090
|
{ immediate: true }
|
|
@@ -1049,8 +1115,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1049
1115
|
}, getBindValue.value, {
|
|
1050
1116
|
"file-list": fileListRef.value,
|
|
1051
1117
|
"custom-request": handleCustomRequest,
|
|
1052
|
-
"before-upload": handleBeforeUpload,
|
|
1053
1118
|
onChange: handleChange,
|
|
1119
|
+
onBeforeUpload: handleBeforeUpload,
|
|
1054
1120
|
onProgress: handleProgress,
|
|
1055
1121
|
onPreview: handlePreview
|
|
1056
1122
|
}), vue.createSlots({ _: 2 }, [
|
|
@@ -1058,10 +1124,17 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1058
1124
|
name: "upload-button",
|
|
1059
1125
|
fn: vue.withCtx(() => [
|
|
1060
1126
|
vue.renderSlot(_ctx.$slots, "upload-button", {}, () => [
|
|
1061
|
-
getProps.value.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock("div",
|
|
1127
|
+
getProps.value.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1128
|
+
key: 0,
|
|
1129
|
+
class: "upload-card-button",
|
|
1130
|
+
style: vue.normalizeStyle({
|
|
1131
|
+
width: `${getProps.value.cardSize || 80}px`,
|
|
1132
|
+
height: `${getProps.value.cardSize || 80}px`
|
|
1133
|
+
})
|
|
1134
|
+
}, [
|
|
1062
1135
|
vue.createVNode(vue.unref(IconPlus), { size: 16 }),
|
|
1063
|
-
getProps.value.uploadButtonText ? (vue.openBlock(), vue.createElementBlock("div",
|
|
1064
|
-
])) : (vue.openBlock(), vue.createBlock(_component_a_button, {
|
|
1136
|
+
getProps.value.uploadButtonText ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, vue.toDisplayString(getProps.value.uploadButtonText), 1)) : vue.createCommentVNode("", true)
|
|
1137
|
+
], 4)) : (vue.openBlock(), vue.createBlock(_component_a_button, {
|
|
1065
1138
|
key: 1,
|
|
1066
1139
|
type: getProps.value.uploadButtonType || "primary"
|
|
1067
1140
|
}, {
|
|
@@ -1088,7 +1161,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1088
1161
|
name: "tip",
|
|
1089
1162
|
fn: vue.withCtx(() => [
|
|
1090
1163
|
vue.renderSlot(_ctx.$slots, "tip", {}, () => [
|
|
1091
|
-
vue.createElementVNode("div",
|
|
1164
|
+
vue.createElementVNode("div", _hoisted_3$2, vue.toDisplayString(getProps.value.tip), 1)
|
|
1092
1165
|
], true)
|
|
1093
1166
|
]),
|
|
1094
1167
|
key: "2"
|
|
@@ -1112,7 +1185,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
1112
1185
|
}
|
|
1113
1186
|
return target;
|
|
1114
1187
|
};
|
|
1115
|
-
const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
1188
|
+
const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-10587859"]]);
|
|
1116
1189
|
const componentMap = {
|
|
1117
1190
|
Input: webVue.Input,
|
|
1118
1191
|
InputNumber: webVue.InputNumber,
|
|
@@ -2116,7 +2189,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2116
2189
|
const indexColumn = {
|
|
2117
2190
|
title: "序号",
|
|
2118
2191
|
dataIndex: "__index__",
|
|
2119
|
-
width:
|
|
2192
|
+
width: 60,
|
|
2120
2193
|
align: "center",
|
|
2121
2194
|
fixed: "left",
|
|
2122
2195
|
slotName: "__index__",
|
|
@@ -2997,7 +3070,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2997
3070
|
};
|
|
2998
3071
|
}
|
|
2999
3072
|
});
|
|
3000
|
-
const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
3073
|
+
const BasicTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-04667d35"]]);
|
|
3001
3074
|
function useTable(options = {}) {
|
|
3002
3075
|
const tableRef = vue.ref(null);
|
|
3003
3076
|
const formRef = vue.ref(null);
|